diff --git a/TradeManage/bin/TradeManageNew.dll b/TradeManage/bin/TradeManageNew.dll index cd8610a..2cc5a85 100644 Binary files a/TradeManage/bin/TradeManageNew.dll and b/TradeManage/bin/TradeManageNew.dll differ diff --git a/TradeManageNew/DataNew.cs b/TradeManageNew/DataNew.cs index a1f11de..dace0f5 100644 --- a/TradeManageNew/DataNew.cs +++ b/TradeManageNew/DataNew.cs @@ -31466,11 +31466,11 @@ where c.SKU1=@SKU"; string tsql = @" if @id>0 begin -Update [HT_CustomFee] set [customname]=@customname,[htdate]=@htdate,[htcode]=@htcode,[yjprice]=@yjprice,[rmbprice]=@rmbprice,[usdprice]=@usdprice,[njprice]=@njprice,[hyprice]=@hyprice,[hlrate]=@hlrate,[llrate]=@llrate,[totalrmbprice]=@totalrmbprice,[totalusdprice]=@totalusdprice,[yfprice]=@yfprice,[lxprice]=@lxprice,[inname]=@inname,[indate]=@indate,[state]=@state where id=@id +Update [HT_CustomFee] set [customname]=@customname,[htdate]=@htdate,[htcode]=@htcode,[yjprice]=@yjprice,[rmbprice]=@rmbprice,[usdprice]=@usdprice,[njprice]=@njprice,[hyprice]=@hyprice,[hlrate]=@hlrate,[llrate]=@llrate,[totalrmbprice]=@totalrmbprice,[totalusdprice]=@totalusdprice,[yfprice]=@yfprice,[lxprice]=@lxprice,[inname]=@inname,[indate]=@indate,[state]=@state,jxdate=@jxdate,feetype=@feetype,hyrmbprice=@hyrmbprice,njrmbprice=@njrmbprice,yjrate=@yjrate,yjrmbprice=@yjrmbprice where id=@id end else begin -INSERT INTO [HT_CustomFee]([customname],[htdate],[htcode],[yjprice],[rmbprice],[usdprice],[njprice],[hyprice],[hlrate],[llrate],[totalrmbprice],[totalusdprice],[yfprice],[lxprice],[inname],[indate],[state])values(@customname,@htdate,@htcode,@yjprice,@rmbprice,@usdprice,@njprice,@hyprice,@hlrate,@llrate,@totalrmbprice,@totalusdprice,@yfprice,@lxprice,@inname,@indate,@state) +INSERT INTO [HT_CustomFee]([customname],[htdate],[htcode],[yjprice],[rmbprice],[usdprice],[njprice],[hyprice],[hlrate],[llrate],[totalrmbprice],[totalusdprice],[yfprice],[lxprice],[inname],[indate],[state],jxdate,feetype,yjrate,njrmbprice,hyrmbprice,yjrmbprice)values(@customname,@htdate,@htcode,@yjprice,@rmbprice,@usdprice,@njprice,@hyprice,@hlrate,@llrate,@totalrmbprice,@totalusdprice,@yfprice,@lxprice,@inname,@indate,@state,@jxdate,@feetype,@yjrate,@njrmbprice,@hyrmbprice,@yjrmbprice) set @id=SCOPE_IDENTITY() end select @id"; @@ -31493,6 +31493,12 @@ select @id"; db.AddInParameter(cmd, "@lxprice", DbType.Decimal, Model.lxprice); db.AddInParameter(cmd, "@inname", DbType.String, Model.inname); db.AddInParameter(cmd, "@indate", DbType.DateTime, Model.indate); + db.AddInParameter(cmd, "@jxdate", DbType.DateTime, Model.jxdate); + db.AddInParameter(cmd, "@feetype", DbType.Int32, Model.feetype); + db.AddInParameter(cmd, "@yjrate", DbType.Decimal, Model.yjrate); + db.AddInParameter(cmd, "@njrmbprice", DbType.Decimal, Model.njrmbprice); + db.AddInParameter(cmd, "@hyrmbprice", DbType.Decimal, Model.hyrmbprice); + db.AddInParameter(cmd, "@yjrmbprice", DbType.Decimal, Model.yjrmbprice); db.AddInParameter(cmd, "@state", DbType.Int32, Model.state); int a = Convert.ToInt32(db.ExecuteScalar(cmd)); return a; @@ -31547,7 +31553,7 @@ select @id"; public static List GetListCustomFee(string where, int PageIndex, int PageSize, string Sort, out int RowCount) { QueryService2 ser = new QueryService2(); - ser.Tsql = "select id=cast(a.id as int),a.customname,a.htdate,a.htcode,a.yjprice,a.rmbprice,a.usdprice,a.njprice,a.hyprice,a.hlrate,a.llrate,a.totalrmbprice,a.totalusdprice,a.yfprice,a.lxprice,a.inname,a.indate,a.state from HT_CustomFee a"; + ser.Tsql = "select id=cast(a.id as int),a.customname,a.htdate,a.htcode,a.yjprice,a.rmbprice,a.usdprice,a.njprice,a.hyprice,a.hlrate,a.llrate,a.totalrmbprice,a.totalusdprice,yfprice=isnull(a.yfprice,0),a.lxprice,a.inname,a.indate,a.state,a.jxdate,a.feetype,zfprice=case when a.feetype=1 then a.rmbprice else a.usdprice end,a.yjrate,a.njrmbprice,a.hyrmbprice,a.yjrmbprice,days=DATEDIFF(day,jxdate,getdate()),a.predate,days2=case when predate is not null then DATEDIFF(day,predate,getdate()) else -1 end from HT_CustomFee a"; ser.Tsql += " " + ser.Filter(where); ser.PageIndex = PageIndex; ser.PageSize = PageSize; @@ -31575,8 +31581,13 @@ Update [HT_CustomFeeDetail] set [feeid]=@feeid,[feedate]=@feedate,[feermbprice]= end else begin -INSERT INTO [HT_CustomFeeDetail]([feeid],[feedate],[feermbprice],[feeusdprice],[hlrate],[feetype],[jsbprice],[jslxprice])values(@feeid,@feedate,@feermbprice,@feeusdprice,@hlrate,@feetype,@jsbprice,@jslxprice) +declare @prefeedate datetime,@prejsbprice decimal(18,2),@preyfprice decimal(18,2) +select @prefeedate=predate,@prejsbprice=lxprice,@preyfprice=yfprice from HT_CustomFee where id=@feeid +INSERT INTO [HT_CustomFeeDetail]([feeid],[feedate],[feermbprice],[feeusdprice],[hlrate],[feetype],[jsbprice],[jslxprice],prefeedate,prejsbprice,preyfprice)values(@feeid,@feedate,@feermbprice,@feeusdprice,@hlrate,@feetype,@jsbprice,@jslxprice,@prefeedate,@prejsbprice,@preyfprice) set @id=SCOPE_IDENTITY() + +update HT_CustomFee set yfprice=@hkprice,lxprice=@leftprice,predate=@feedate where id=@feeid +update HT_CustomFee set state=1 where lxprice<=0 end select @id"; Database db = DatabaseFactory.CreateDatabase(); @@ -31588,8 +31599,10 @@ select @id"; db.AddInParameter(cmd, "@feeusdprice", DbType.Decimal, Model.feeusdprice); db.AddInParameter(cmd, "@hlrate", DbType.Decimal, Model.hlrate); db.AddInParameter(cmd, "@feetype", DbType.Int32, Model.feetype); - db.AddInParameter(cmd, "@jsbprice", DbType.Decimal, Model.jsbprice); + db.AddInParameter(cmd, "@jsbprice", DbType.String, Model.jsbprice); db.AddInParameter(cmd, "@jslxprice", DbType.Decimal, Model.jslxprice); + db.AddInParameter(cmd, "@hkprice", DbType.Decimal, Model.hkprice); + db.AddInParameter(cmd, "@leftprice", DbType.Decimal, Model.leftprice); int a = Convert.ToInt32(db.ExecuteScalar(cmd)); return a; } @@ -31598,7 +31611,11 @@ select @id"; public static void Delete_CustomFeeDetail(int id) { string tsql = @" - delete from HT_CustomFeeDetail where id=@id"; +declare @prefeedate datetime,@prejsbprice decimal(18,2),@preyfprice decimal(18,2),@feeid int +select @prefeedate=prefeedate,@prejsbprice=prejsbprice,@preyfprice=preyfprice,@feeid=feeid from HT_CustomFeeDetail where id=@id + delete from HT_CustomFeeDetail where id=@id +update HT_CustomFee set yfprice=@preyfprice,lxprice=@prejsbprice,predate=@prefeedate,state=0 where id=@feeid +"; Database db = DatabaseFactory.CreateDatabase(); DbCommand cmd = db.GetSqlStringCommand(tsql); db.AddInParameter(cmd, "@id", DbType.Int32, id); @@ -31628,7 +31645,7 @@ select @id"; public static List GetListCustomFeeDetail(int feeid) { //string tsql = "select a.id,a.feeid,a.feedate,a.feermbprice,a.feeusdprice,a.hlrate,a.feetype,a.jsbprice,a.jslxprice from HT_CustomFeeDetail"; - string tsql = "select * from HT_CustomFeeDetail where feeid=@feeid order by a.feedate"; + string tsql = "select * from HT_CustomFeeDetail where feeid=@feeid order by feedate"; Database db = DatabaseFactory.CreateDatabase(); DbCommand cmd = db.GetSqlStringCommand(tsql); db.AddInParameter(cmd, "@feeid", DbType.Int32, feeid); diff --git a/TradeManageNew/HT_CustomList.aspx b/TradeManageNew/HT_CustomList.aspx index 662d9e6..49b18dc 100644 --- a/TradeManageNew/HT_CustomList.aspx +++ b/TradeManageNew/HT_CustomList.aspx @@ -29,6 +29,7 @@