diff --git a/Src/Asp.Net/SqlServerTest/BugTest/Bug2.cs b/Src/Asp.Net/SqlServerTest/BugTest/Bug2.cs index cdf1c3e44..7507ad582 100644 --- a/Src/Asp.Net/SqlServerTest/BugTest/Bug2.cs +++ b/Src/Asp.Net/SqlServerTest/BugTest/Bug2.cs @@ -137,6 +137,16 @@ namespace OrmTest.BugTest s.HeatNo, s.CmdNo }).ExecuteCommand(); + DB.CodeFirst.InitTables(typeof(VMaterialInfo),typeof(TStock),typeof(TTempStock)); + var GoodsList = DB.Queryable((vmg, ts) => new object[] { + JoinType.Left,vmg.FMICode==ts.FMICode + }) + .Select((vmg, ts) => new + { + + AbleQty = SqlFunc.ToInt32(ts.FQty - SqlFunc.Subqueryable().Where(s => s.FMICode == vmg.FMICode && s.FK_Store =="") + .Select(s => SqlFunc.AggregateSum(s.FKCSL))) + }).ToList(); } } /// diff --git a/Src/Asp.Net/SqlServerTest/BugTest/BugModels/TStock.cs b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/TStock.cs new file mode 100644 index 000000000..f7ff54791 --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/TStock.cs @@ -0,0 +1,158 @@ +using System; + +namespace OrmTest.BugTest +{ + + public partial class TStock + { + public TStock() + { } + #region Model + private string _pkid; + private string _fk_store; + private string _fstorename; + private string _fmicode; + private string _fminame; + private decimal _fqty = 0M; + private string _fremark; + private DateTime? _fupdatetime = DateTime.Now; + private string _flaster; + private string _fk_fsp_id; + private string _fspname; + private string _fk_sfsp_id; + private string _sfspname; + private decimal? _fprice = 0M; + private string _fk_materialinfo; + private decimal? _stocktotalcost = 0M; + /// + /// + /// + public string PKID + { + set { _pkid = value; } + get { return _pkid; } + } + /// + /// + /// + public string FK_Store + { + set { _fk_store = value; } + get { return _fk_store; } + } + /// + /// + /// + public string FStoreName + { + set { _fstorename = value; } + get { return _fstorename; } + } + /// + /// + /// + public string FMICode + { + set { _fmicode = value; } + get { return _fmicode; } + } + /// + /// + /// + public string FMIName + { + set { _fminame = value; } + get { return _fminame; } + } + /// + /// + /// + public decimal FQty + { + set { _fqty = value; } + get { return _fqty; } + } + /// + /// + /// + public string FRemark + { + set { _fremark = value; } + get { return _fremark; } + } + /// + /// + /// + public DateTime? FUpdateTime + { + set { _fupdatetime = value; } + get { return _fupdatetime; } + } + /// + /// + /// + public string FLaster + { + set { _flaster = value; } + get { return _flaster; } + } + /// + /// + /// + public string FK_FSP_ID + { + set { _fk_fsp_id = value; } + get { return _fk_fsp_id; } + } + /// + /// + /// + public string FSPName + { + set { _fspname = value; } + get { return _fspname; } + } + /// + /// + /// + public string FK_SFSP_ID + { + set { _fk_sfsp_id = value; } + get { return _fk_sfsp_id; } + } + /// + /// + /// + public string SFSPName + { + set { _sfspname = value; } + get { return _sfspname; } + } + /// + /// + /// + public decimal? FPrice + { + set { _fprice = value; } + get { return _fprice; } + } + /// + /// + /// + public string FK_Materialinfo + { + set { _fk_materialinfo = value; } + get { return _fk_materialinfo; } + } + /// + /// 库存总成本 + /// + public decimal? stockTotalCost + { + set { _stocktotalcost = value; } + get { return _stocktotalcost; } + } + #endregion Model + + } +} \ No newline at end of file diff --git a/Src/Asp.Net/SqlServerTest/BugTest/BugModels/TTempStock.cs b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/TTempStock.cs new file mode 100644 index 000000000..1ea134b8e --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/TTempStock.cs @@ -0,0 +1,112 @@ +using System; + +namespace OrmTest.BugTest +{ + public partial class TTempStock + { + public TTempStock() + { } + #region Model + private string _pkid; + private string _fk_store; + private string _fstore; + private string _fmicode; + private string _fminame; + private decimal _fkcsl = 0M; + private string _fbillno; + private string _fbilltype; + private string _fremark; + private DateTime? _fupdatetime; + private string _fk_materialinfo; + /// + /// + /// + public string PKID + { + set { _pkid = value; } + get { return _pkid; } + } + /// + /// + /// + public string FK_Store + { + set { _fk_store = value; } + get { return _fk_store; } + } + /// + /// + /// + public string FStore + { + set { _fstore = value; } + get { return _fstore; } + } + /// + /// + /// + public string FMICode + { + set { _fmicode = value; } + get { return _fmicode; } + } + /// + /// + /// + public string FMIName + { + set { _fminame = value; } + get { return _fminame; } + } + /// + /// + /// + public decimal FKCSL + { + set { _fkcsl = value; } + get { return _fkcsl; } + } + /// + /// + /// + public string FBillNo + { + set { _fbillno = value; } + get { return _fbillno; } + } + /// + /// + /// + public string FBillType + { + set { _fbilltype = value; } + get { return _fbilltype; } + } + /// + /// + /// + public string FRemark + { + set { _fremark = value; } + get { return _fremark; } + } + /// + /// + /// + public DateTime? FUpdateTime + { + set { _fupdatetime = value; } + get { return _fupdatetime; } + } + /// + /// + /// + public string FK_Materialinfo + { + set { _fk_materialinfo = value; } + get { return _fk_materialinfo; } + } + #endregion Model + + } +} \ No newline at end of file diff --git a/Src/Asp.Net/SqlServerTest/BugTest/BugModels/VMaterialInfo.cs b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/VMaterialInfo.cs new file mode 100644 index 000000000..efb366fed --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/BugTest/BugModels/VMaterialInfo.cs @@ -0,0 +1,447 @@ +using System; + +namespace OrmTest.BugTest +{ + + + public partial class VMaterialInfo + { + public VMaterialInfo() + { } + #region Model + private string _pkid; + private string _fmicode; + private string _fminame; + private string _fpy; + private string _fsiname; + private string _fgauge; + private string _foem; + private string _fk_forigin; + private string _fselfcode; + private decimal? _flength; + private decimal? _fwidth; + private decimal? _fhigh; + private decimal? _fweight; + private bool _fishalf; + private string _fbiname; + private string _fuiname; + private string _flsname; + private int? _finboxqty; + private string _fperformancetype; + private bool _fassembly; + private string _fptname; + private decimal? _fretailprice; + private decimal? _ftradeprice; + private decimal? _fminimumprice; + private decimal? _fminbuyqty; + private string _fmanufacturernum; + private string _fciname; + private string _fspname; + private string _deffspname; + private DateTime? _fregdate; + private string _fremark; + private string _fadder; + private string _bakspfspname; + private string _fftname; + private string _fstoretype; + private string _fstate; + private DateTime? _faddtime; + private string _fk_seriesinfo; + private string _fk_brandinfo; + private string _fk_unitinfo; + private string _fk_lablestyle; + private string _fk_pricetype; + private string _fk_clientinfo; + private string _fk_storeplace; + private string _fk_baksp; + private string _fk_adder; + private string _fk_flowtype; + private string _lfptname; + /// + /// + /// + public string PKID + { + set { _pkid = value; } + get { return _pkid; } + } + /// + /// + /// + public string FMICode + { + set { _fmicode = value; } + get { return _fmicode; } + } + /// + /// + /// + public string FMIName + { + set { _fminame = value; } + get { return _fminame; } + } + /// + /// + /// + public string FPY + { + set { _fpy = value; } + get { return _fpy; } + } + /// + /// + /// + public string FSIName + { + set { _fsiname = value; } + get { return _fsiname; } + } + /// + /// + /// + public string FGauge + { + set { _fgauge = value; } + get { return _fgauge; } + } + /// + /// + /// + public string FOEM + { + set { _foem = value; } + get { return _foem; } + } + /// + /// + /// + public string FK_FOrigin + { + set { _fk_forigin = value; } + get { return _fk_forigin; } + } + /// + /// + /// + public string FSelfCode + { + set { _fselfcode = value; } + get { return _fselfcode; } + } + /// + /// + /// + public decimal? FLength + { + set { _flength = value; } + get { return _flength; } + } + /// + /// + /// + public decimal? FWidth + { + set { _fwidth = value; } + get { return _fwidth; } + } + /// + /// + /// + public decimal? FHigh + { + set { _fhigh = value; } + get { return _fhigh; } + } + /// + /// + /// + public decimal? FWeight + { + set { _fweight = value; } + get { return _fweight; } + } + /// + /// + /// + public bool FIsHalf + { + set { _fishalf = value; } + get { return _fishalf; } + } + /// + /// + /// + public string FBIName + { + set { _fbiname = value; } + get { return _fbiname; } + } + /// + /// + /// + public string FUIName + { + set { _fuiname = value; } + get { return _fuiname; } + } + /// + /// + /// + public string FLSName + { + set { _flsname = value; } + get { return _flsname; } + } + /// + /// + /// + public int? FInBoxQty + { + set { _finboxqty = value; } + get { return _finboxqty; } + } + /// + /// + /// + public string FPerformanceType + { + set { _fperformancetype = value; } + get { return _fperformancetype; } + } + /// + /// + /// + public bool FAssembly + { + set { _fassembly = value; } + get { return _fassembly; } + } + /// + /// + /// + public string FPTName + { + set { _fptname = value; } + get { return _fptname; } + } + /// + /// + /// + public decimal? FRetailPrice + { + set { _fretailprice = value; } + get { return _fretailprice; } + } + /// + /// + /// + public decimal? FTradePrice + { + set { _ftradeprice = value; } + get { return _ftradeprice; } + } + /// + /// + /// + public decimal? FMinimumPrice + { + set { _fminimumprice = value; } + get { return _fminimumprice; } + } + /// + /// + /// + public decimal? FMinBuyQty + { + set { _fminbuyqty = value; } + get { return _fminbuyqty; } + } + /// + /// + /// + public string FManufacturerNum + { + set { _fmanufacturernum = value; } + get { return _fmanufacturernum; } + } + /// + /// + /// + public string FCIName + { + set { _fciname = value; } + get { return _fciname; } + } + /// + /// + /// + public string FSPName + { + set { _fspname = value; } + get { return _fspname; } + } + /// + /// + /// + public string DefFSPName + { + set { _deffspname = value; } + get { return _deffspname; } + } + /// + /// + /// + public DateTime? FRegDate + { + set { _fregdate = value; } + get { return _fregdate; } + } + /// + /// + /// + public string FRemark + { + set { _fremark = value; } + get { return _fremark; } + } + /// + /// + /// + public string FAdder + { + set { _fadder = value; } + get { return _fadder; } + } + /// + /// + /// + public string BakSPFSPName + { + set { _bakspfspname = value; } + get { return _bakspfspname; } + } + /// + /// + /// + public string FFTName + { + set { _fftname = value; } + get { return _fftname; } + } + /// + /// + /// + public string FStoreType + { + set { _fstoretype = value; } + get { return _fstoretype; } + } + /// + /// + /// + public string FState + { + set { _fstate = value; } + get { return _fstate; } + } + /// + /// + /// + public DateTime? FAddTime + { + set { _faddtime = value; } + get { return _faddtime; } + } + /// + /// + /// + public string FK_SeriesInfo + { + set { _fk_seriesinfo = value; } + get { return _fk_seriesinfo; } + } + /// + /// + /// + public string FK_BrandInfo + { + set { _fk_brandinfo = value; } + get { return _fk_brandinfo; } + } + /// + /// + /// + public string FK_UnitInfo + { + set { _fk_unitinfo = value; } + get { return _fk_unitinfo; } + } + /// + /// + /// + public string FK_LableStyle + { + set { _fk_lablestyle = value; } + get { return _fk_lablestyle; } + } + /// + /// + /// + public string FK_PriceType + { + set { _fk_pricetype = value; } + get { return _fk_pricetype; } + } + /// + /// + /// + public string FK_ClientInfo + { + set { _fk_clientinfo = value; } + get { return _fk_clientinfo; } + } + /// + /// + /// + public string FK_StorePlace + { + set { _fk_storeplace = value; } + get { return _fk_storeplace; } + } + /// + /// + /// + public string FK_BakSP + { + set { _fk_baksp = value; } + get { return _fk_baksp; } + } + /// + /// + /// + public string FK_Adder + { + set { _fk_adder = value; } + get { return _fk_adder; } + } + /// + /// + /// + public string FK_FlowType + { + set { _fk_flowtype = value; } + get { return _fk_flowtype; } + } + /// + /// + /// + public string LFPTName + { + set { _lfptname = value; } + get { return _lfptname; } + } + #endregion Model + + } +} \ No newline at end of file diff --git a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj index 5afa6983a..fb4bf1ff6 100644 --- a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj +++ b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj @@ -58,6 +58,9 @@ + + +