master
cmj 4 days ago
parent 7c63c69e59
commit 23ae8ddf95

@ -31429,6 +31429,185 @@ where c.SKU1=@SKU";
}
#endregion
#region 保存
public static int Save_CustomFee(HT_CustomFee Model)
{
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
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)
set @id=SCOPE_IDENTITY()
end
select @id";
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetSqlStringCommand(tsql);
db.AddInParameter(cmd, "@id", DbType.Int32, Model.id);
db.AddInParameter(cmd, "@customname", DbType.String, Model.customname);
db.AddInParameter(cmd, "@htdate", DbType.DateTime, Model.htdate);
db.AddInParameter(cmd, "@htcode", DbType.String, Model.htcode);
db.AddInParameter(cmd, "@yjprice", DbType.Decimal, Model.yjprice);
db.AddInParameter(cmd, "@rmbprice", DbType.Decimal, Model.rmbprice);
db.AddInParameter(cmd, "@usdprice", DbType.Decimal, Model.usdprice);
db.AddInParameter(cmd, "@njprice", DbType.Decimal, Model.njprice);
db.AddInParameter(cmd, "@hyprice", DbType.Decimal, Model.hyprice);
db.AddInParameter(cmd, "@hlrate", DbType.Decimal, Model.hlrate);
db.AddInParameter(cmd, "@llrate", DbType.Decimal, Model.llrate);
db.AddInParameter(cmd, "@totalrmbprice", DbType.Decimal, Model.totalrmbprice);
db.AddInParameter(cmd, "@totalusdprice", DbType.Decimal, Model.totalusdprice);
db.AddInParameter(cmd, "@yfprice", DbType.Decimal, Model.yfprice);
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, "@state", DbType.Int32, Model.state);
int a = Convert.ToInt32(db.ExecuteScalar(cmd));
return a;
}
#endregion
#region 删除
public static void Delete_CustomFee(int id)
{
string tsql = @"
delete from HT_CustomFee where id=@id";
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetSqlStringCommand(tsql);
db.AddInParameter(cmd, "@id", DbType.Int32, id);
db.ExecuteNonQuery(cmd);
}
#endregion
#region 返回Model
public static HT_CustomFee GetModel_CustomFee(int id)
{
HT_CustomFee model = null;
//string tsql = "select a.id,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";
string tsql = @"
select * from HT_CustomFee where id=@id";
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetSqlStringCommand(tsql);
db.AddInParameter(cmd, "@id", DbType.Int32, id);
DataSet ds = db.ExecuteDataSet(cmd);
if (ds.Tables[0].Rows.Count > 0)
{
model = ds.Tables[0].Rows[0].ToModel<HT_CustomFee>();
}
return model;
}
#endregion
#region 返回列表
public static List<HT_CustomFee> GetListCustomFee()
{
//string tsql = "select a.id,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";
string tsql = "select * from HT_CustomFee";
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetSqlStringCommand(tsql);
DataTable tb = db.ExecuteDataTable(cmd);
List<HT_CustomFee> ListModel = tb.ToList<HT_CustomFee>();
return ListModel;
}
#endregion
#region 分页动态条件查询
public static List<HT_CustomFee> 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 += " " + ser.Filter(where);
ser.PageIndex = PageIndex;
ser.PageSize = PageSize;
if (string.IsNullOrEmpty(Sort) == true) { ser.Sort = "a.id desc"; }
else { ser.Sort = Sort; }
string tsql = ser.GetText();
List<HT_CustomFee> ListModel = null;
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetSqlStringCommand(tsql);
db.AddOutParameter(cmd, "@RowCount", DbType.Int32, 4);
DataTable tb = db.ExecuteDataTable(cmd);
RowCount = Convert.ToInt32(cmd.Parameters["@RowCount"].Value);
ListModel = tb.ToList<HT_CustomFee>();
return ListModel;
}
#endregion
#region 保存
public static int Save_CustomFeeDetail(HT_CustomFeeDetail Model)
{
string tsql = @"
if @id>0
begin
Update [HT_CustomFeeDetail] set [feeid]=@feeid,[feedate]=@feedate,[feermbprice]=@feermbprice,[feeusdprice]=@feeusdprice,[hlrate]=@hlrate,[feetype]=@feetype,[jsbprice]=@jsbprice,[jslxprice]=@jslxprice where id=@id
end
else
begin
INSERT INTO [HT_CustomFeeDetail]([feeid],[feedate],[feermbprice],[feeusdprice],[hlrate],[feetype],[jsbprice],[jslxprice])values(@feeid,@feedate,@feermbprice,@feeusdprice,@hlrate,@feetype,@jsbprice,@jslxprice)
set @id=SCOPE_IDENTITY()
end
select @id";
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetSqlStringCommand(tsql);
db.AddInParameter(cmd, "@id", DbType.Int32, Model.id);
db.AddInParameter(cmd, "@feeid", DbType.Int32, Model.feeid);
db.AddInParameter(cmd, "@feedate", DbType.DateTime, Model.feedate);
db.AddInParameter(cmd, "@feermbprice", DbType.Decimal, Model.feermbprice);
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, "@jslxprice", DbType.Decimal, Model.jslxprice);
int a = Convert.ToInt32(db.ExecuteScalar(cmd));
return a;
}
#endregion
#region 删除
public static void Delete_CustomFeeDetail(int id)
{
string tsql = @"
delete from HT_CustomFeeDetail where id=@id";
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetSqlStringCommand(tsql);
db.AddInParameter(cmd, "@id", DbType.Int32, id);
db.ExecuteNonQuery(cmd);
}
#endregion
#region 返回Model
public static HT_CustomFeeDetail GetModel_CustomFeeDetail(int id)
{
HT_CustomFeeDetail model = null;
//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 id=@id";
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetSqlStringCommand(tsql);
db.AddInParameter(cmd, "@id", DbType.Int32, id);
DataSet ds = db.ExecuteDataSet(cmd);
if (ds.Tables[0].Rows.Count > 0)
{
model = ds.Tables[0].Rows[0].ToModel<HT_CustomFeeDetail>();
}
return model;
}
#endregion
#region 返回列表
public static List<HT_CustomFeeDetail> 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";
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetSqlStringCommand(tsql);
db.AddInParameter(cmd, "@feeid", DbType.Int32, feeid);
DataTable tb = db.ExecuteDataTable(cmd);
List<HT_CustomFeeDetail> ListModel = tb.ToList<HT_CustomFeeDetail>();
return ListModel;
}
#endregion
}
}

@ -11427,4 +11427,120 @@ namespace TradeManageNew
public Decimal? cb { get; set; }
public Decimal? hwsf { get; set; }
}
public class HT_CustomFee
{
/// <summary>
/// id
/// </summary>
public Int32? id { get; set; }
/// <summary>
/// 客户
/// </summary>
public String customname { get; set; }
/// <summary>
/// 合同日期
/// </summary>
public DateTime? htdate { get; set; }
/// <summary>
/// htcode
/// </summary>
public String htcode { get; set; }
/// <summary>
/// 佣金
/// </summary>
public Decimal? yjprice { get; set; }
/// <summary>
/// rmbprice
/// </summary>
public Decimal? rmbprice { get; set; }
/// <summary>
/// usdprice
/// </summary>
public Decimal? usdprice { get; set; }
/// <summary>
/// 内际金额
/// </summary>
public Decimal? njprice { get; set; }
/// <summary>
/// 海运费
/// </summary>
public Decimal? hyprice { get; set; }
/// <summary>
/// 汇率
/// </summary>
public Decimal? hlrate { get; set; }
/// <summary>
/// 利率
/// </summary>
public Decimal? llrate { get; set; }
/// <summary>
/// totalrmbprice
/// </summary>
public Decimal? totalrmbprice { get; set; }
/// <summary>
/// totalusdprice
/// </summary>
public Decimal? totalusdprice { get; set; }
/// <summary>
/// 已付多少
/// </summary>
public Decimal? yfprice { get; set; }
/// <summary>
/// 累计利息多少
/// </summary>
public Decimal? lxprice { get; set; }
/// <summary>
/// inname
/// </summary>
public String inname { get; set; }
/// <summary>
/// indate
/// </summary>
public DateTime? indate { get; set; }
/// <summary>
/// 0 未结清 1已结清
/// </summary>
public Int32? state { get; set; }
public List<HT_CustomFeeDetail> ListModel { get; set; }
}
public class HT_CustomFeeDetail
{
/// <summary>
/// id
/// </summary>
public Int32? id { get; set; }
/// <summary>
/// feeid
/// </summary>
public Int32? feeid { get; set; }
/// <summary>
/// 支付日期
/// </summary>
public DateTime? feedate { get; set; }
/// <summary>
/// feermbprice
/// </summary>
public Decimal? feermbprice { get; set; }
/// <summary>
/// feeusdprice
/// </summary>
public Decimal? feeusdprice { get; set; }
/// <summary>
/// 结算汇率
/// </summary>
public Decimal? hlrate { get; set; }
/// <summary>
/// 1人民币结算 2美金结算
/// </summary>
public Int32? feetype { get; set; }
/// <summary>
/// 结算时欠费金额
/// </summary>
public Decimal? jsbprice { get; set; }
/// <summary>
/// 结算时产生的总利息
/// </summary>
public Decimal? jslxprice { get; set; }
}
}
Loading…
Cancel
Save