You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

545 lines
26 KiB
C#

10 months ago
using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Collections.Generic;
using DSWeb.Models;
using WebSqlHelper;
namespace DSWeb.EntityDA
{
public class FeeTemplateDetailDA
{
private const string PARM_FEE_TEMPLATE_DETAIL_GID = "@gid";
private const string PARM_FEE_TEMPLATE_DETAIL_TEMPLATE_ID = "@template_id";
private const string PARM_FEE_TEMPLATE_DETAIL_FEE_CODE = "@fee_code";
private const string PARM_FEE_TEMPLATE_DETAIL_FEE_NAME = "@fee_name";
private const string PARM_FEE_TEMPLATE_DETAIL_CUSTOMER_NAME = "@customer_name";
private const string PARM_FEE_TEMPLATE_DETAIL_CLIENT = "@client";
private const string PARM_FEE_TEMPLATE_DETAIL_UNIT = "@unit";
private const string PARM_FEE_TEMPLATE_DETAIL_CURRENCY = "@currency";
private const string PARM_FEE_TEMPLATE_DETAIL_UNIT_PRICE = "@unit_price";
private const string PARM_FEE_TEMPLATE_DETAIL_REMARK = "@remark";
private const string PARM_FEE_TEMPLATE_DETAIL_SORT = "@sort";
private const string PARM_FEE_TEMPLATE_DETAIL_CREATE_USER = "@create_user";
private const string PARM_FEE_TEMPLATE_DETAIL_CREATE_TIME = "@create_time";
private const string PARM_FEE_TEMPLATE_DETAIL_MODIFIED_USER = "@modified_user";
private const string PARM_FEE_TEMPLATE_DETAIL_MODIFIED_TIME = "@modified_time";
private const string PARM_FEE_TEMPLATE_DETAIL_FEE_TYPE = "@fee_type";
private const string PARM_FEE_TEMPLATE_DETAIL_EXCHANGE_RATE = "@exchange_rate";
private const string SQL_SELECT_FEE_TEMPLATE_DETAIL_BY_GID = "SELECT GID, TEMPLATEID, FEECODE, FEENAME, CUSTOMERNAME, CLIENT, UNIT, CURRENCY, UNITPRICE, REMARK, SORT, CREATEUSER, "
+ " CREATETIME, MODIFIEDUSER, MODIFIEDTIME,FEETYPE,EXCHANGERATE FROM code_fee_templatedetail WHERE GID = @gid ";
private const string SQL_SELECT_FEE_TEMPLATE_DETAIL_BY_TEMPLATEID = "SELECT GID, TEMPLATEID, FEECODE, FEENAME, CUSTOMERNAME, CLIENT, UNIT, CURRENCY, UNITPRICE, REMARK, SORT, CREATEUSER, "
+ " CREATETIME, MODIFIEDUSER, MODIFIEDTIME,FEETYPE,EXCHANGERATE FROM code_fee_templatedetail WHERE GID = @gid ";
private const string SQL_INSERT_FEE_TEMPLATE_DETAIL = " INSERT INTO code_fee_templatedetail(GID,TEMPLATEID,FEECODE,FEENAME,CUSTOMERNAME,CLIENT,UNIT,CURRENCY,UNITPRICE,REMARK,SORT,CREATEUSER,CREATETIME,FEETYPE,EXCHANGERATE) "
+ " VALUES(@gid,@template_id,@fee_code,@fee_name,@customer_name,@client,@unit,@currency,@unit_price,@remark,@sort,@create_user,GETDATE(),@fee_type,@exchange_rate) ";
private const string SQL_UPDATE_FEE_TEMPLATE_DETAIL = " UPDATE code_fee_templatedetail SET FEECODE = @fee_code,FEENAME = @fee_name,CUSTOMERNAME = @customer_name,CLIENT = @client, "
+ " UNIT = @unit,CURRENCY = @currency,UNITPRICE = @unit_price,REMARK = @remark,SORT = @sort,MODIFIEDUSER = @modified_user,MODIFIEDTIME = GETDATE(),FEETYPE = @fee_type,EXCHANGERATE = @exchange_rate WHERE GID = @gid ";
private const string SQL_SELECT_COUNT_BY_GID = "SELECT COUNT(*) FROM code_fee_templatedetail WHERE GID = @gid ";
private const string SQL_DELETE_FEE_TEMPLATE_DETAIL_BY_GID = " DELETE FROM code_fee_templatedetail WHERE GID = @gid ";
#region 根据费用模板明细GID获取费用模板明细信息
/// <summary>
/// 根据费用模板明细GID获取费用模板明细信息
/// </summary>
/// <returns>返回实体类</returns>
public FeeTemplateDetailEntity GetFeeTemplateDetailByGID(string tempFeeTemplateDetailID)
{
FeeTemplateDetailEntity feeTemplateDetailEntity = null;
SqlParameter parm = new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_GID, SqlDbType.VarChar, 36);
parm.Value = tempFeeTemplateDetailID;
using (SqlDataReader sqlRead = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, SQL_SELECT_FEE_TEMPLATE_DETAIL_BY_GID, parm))
{
try
{
while (sqlRead.Read())
{
feeTemplateDetailEntity = new FeeTemplateDetailEntity();
if (!sqlRead.IsDBNull(0))
{
feeTemplateDetailEntity.GID = sqlRead.GetString(0);
}
if (!sqlRead.IsDBNull(1))
{
feeTemplateDetailEntity.TemplateID = sqlRead.GetString(1);
}
if (!sqlRead.IsDBNull(2))
{
feeTemplateDetailEntity.FeeCode = sqlRead.GetString(2);
}
if (!sqlRead.IsDBNull(3))
{
feeTemplateDetailEntity.FeeName = sqlRead.GetString(3);
}
if (!sqlRead.IsDBNull(4))
{
feeTemplateDetailEntity.CustomerName = sqlRead.GetString(4);
}
if (!sqlRead.IsDBNull(5))
{
feeTemplateDetailEntity.Client = sqlRead.GetInt32(5);
}
if (!sqlRead.IsDBNull(6))
{
feeTemplateDetailEntity.Unit = sqlRead.GetString(6);
}
if (!sqlRead.IsDBNull(7))
{
feeTemplateDetailEntity.Currency = sqlRead.GetString(7);
}
if (!sqlRead.IsDBNull(8))
{
feeTemplateDetailEntity.UnitPrice = sqlRead.GetDecimal(8);
}
if (!sqlRead.IsDBNull(9))
{
feeTemplateDetailEntity.Remark = sqlRead.GetString(9);
}
if (!sqlRead.IsDBNull(10))
{
feeTemplateDetailEntity.Sort = sqlRead.GetInt32(10);
}
if (!sqlRead.IsDBNull(11))
{
feeTemplateDetailEntity.CreateUser = sqlRead.GetString(11);
}
if (!sqlRead.IsDBNull(12))
{
feeTemplateDetailEntity.CreateTime = sqlRead.GetDateTime(12);
}
if (!sqlRead.IsDBNull(13))
{
feeTemplateDetailEntity.ModifiedUser = sqlRead.GetString(13);
}
if (!sqlRead.IsDBNull(14))
{
feeTemplateDetailEntity.ModifiedTime = sqlRead.GetDateTime(14);
}
if (!sqlRead.IsDBNull(15))
{
feeTemplateDetailEntity.FeeType = sqlRead.GetInt32(15);
}
if (!sqlRead.IsDBNull(16))
{
feeTemplateDetailEntity.ExchangeRate = sqlRead.GetDecimal(16);
}
}
}
catch (Exception execError)
{
throw execError;
}
}
return feeTemplateDetailEntity;
}
#endregion
#region 通过费用模板明细GID删除费用明细数据
/// <summary>
/// 通过费用模板明细GID删除费用明细数据
/// </summary>
/// <param name="tempFeeTemplateDetailID">费用模板费用明细GID</param>
/// <returns>值1表示删除成功 值不等于1表示删除失败</returns>
public int Delete(string tempFeeTemplateDetailID)
{
int iResult = 0;
SqlParameter[] delParms = new SqlParameter[] {
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_GID,SqlDbType.VarChar,36)
};
delParms[0].Value = tempFeeTemplateDetailID;
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
int existVal = SqlHelper.ExecuteNonQuery(conn, CommandType.Text, SQL_DELETE_FEE_TEMPLATE_DETAIL_BY_GID, delParms);
if (existVal > 0)
{
iResult = 1;
}
else
{
iResult = -1;//执行异常
}
}
return iResult;
}
#endregion
#region 通过费用模板TemplateID获取所有明细数据
/// <summary>
/// 通过费用模板TemplateID获取所有明细数据
/// </summary>
/// <param name="tempFeeTemplateID">费用模板GID</param>
/// <returns>返回实体类</returns>
public IList<FeeTemplateDetailEntity> GetFeeTemplateDetailByTemplateID(string tempFeeTemplateID)
{
IList<FeeTemplateDetailEntity> feeTemplateDetailEntities = new List<FeeTemplateDetailEntity>();
SqlParameter parm = new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_TEMPLATE_ID, SqlDbType.VarChar, 36);
parm.Value = tempFeeTemplateID;
using (SqlDataReader sqlRead = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, SQL_SELECT_FEE_TEMPLATE_DETAIL_BY_GID, parm))
{
try
{
while (sqlRead.Read())
{
FeeTemplateDetailEntity feeTemplateDetailEntity = new FeeTemplateDetailEntity();
if (!sqlRead.IsDBNull(0))
{
feeTemplateDetailEntity.GID = sqlRead.GetString(0);
}
if (!sqlRead.IsDBNull(1))
{
feeTemplateDetailEntity.TemplateID = sqlRead.GetString(1);
}
if (!sqlRead.IsDBNull(2))
{
feeTemplateDetailEntity.FeeCode = sqlRead.GetString(2);
}
if (!sqlRead.IsDBNull(3))
{
feeTemplateDetailEntity.FeeName = sqlRead.GetString(3);
}
if (!sqlRead.IsDBNull(4))
{
feeTemplateDetailEntity.CustomerName = sqlRead.GetString(4);
}
if (!sqlRead.IsDBNull(5))
{
feeTemplateDetailEntity.Client = sqlRead.GetInt32(5);
}
if (!sqlRead.IsDBNull(6))
{
feeTemplateDetailEntity.Unit = sqlRead.GetString(6);
}
if (!sqlRead.IsDBNull(7))
{
feeTemplateDetailEntity.Currency = sqlRead.GetString(7);
}
if (!sqlRead.IsDBNull(8))
{
feeTemplateDetailEntity.UnitPrice = sqlRead.GetDecimal(8);
}
if (!sqlRead.IsDBNull(9))
{
feeTemplateDetailEntity.Remark = sqlRead.GetString(9);
}
if (!sqlRead.IsDBNull(10))
{
feeTemplateDetailEntity.Sort = sqlRead.GetInt32(10);
}
if (!sqlRead.IsDBNull(11))
{
feeTemplateDetailEntity.CreateUser = sqlRead.GetString(11);
}
if (!sqlRead.IsDBNull(12))
{
feeTemplateDetailEntity.CreateTime = sqlRead.GetDateTime(12);
}
if (!sqlRead.IsDBNull(13))
{
feeTemplateDetailEntity.ModifiedUser = sqlRead.GetString(13);
}
if (!sqlRead.IsDBNull(14))
{
feeTemplateDetailEntity.ModifiedTime = sqlRead.GetDateTime(14);
}
if (!sqlRead.IsDBNull(15))
{
feeTemplateDetailEntity.FeeType = sqlRead.GetInt32(15);
}
if (!sqlRead.IsDBNull(16))
{
feeTemplateDetailEntity.ExchangeRate = sqlRead.GetDecimal(16);
}
feeTemplateDetailEntities.Add(feeTemplateDetailEntity);
}
}
catch (Exception execError)
{
throw execError;
}
}
return feeTemplateDetailEntities;
}
#endregion
public int InsertFeeTemplateDetail(FeeTemplateDetailEntity tempFeeTemplateDetailEntity)
{
int iResult = 0;
SqlParameter[] insertParms = new SqlParameter[] {
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_GID,SqlDbType.VarChar,36),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_TEMPLATE_ID,SqlDbType.VarChar,36),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_FEE_CODE,SqlDbType.VarChar,50),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_FEE_NAME,SqlDbType.VarChar,100),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_CUSTOMER_NAME,SqlDbType.VarChar,100),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_CLIENT,SqlDbType.Int),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_UNIT,SqlDbType.VarChar,20),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_CURRENCY,SqlDbType.VarChar,20),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_UNIT_PRICE,SqlDbType.Decimal,20),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_REMARK,SqlDbType.VarChar,200),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_SORT,SqlDbType.Int),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_CREATE_USER,SqlDbType.VarChar,36),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_FEE_TYPE,SqlDbType.Int),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_EXCHANGE_RATE,SqlDbType.Decimal,23)
};
insertParms[0].Value = tempFeeTemplateDetailEntity.GID;
insertParms[1].Value = tempFeeTemplateDetailEntity.TemplateID;
insertParms[2].Value = tempFeeTemplateDetailEntity.FeeCode;
insertParms[3].Value = tempFeeTemplateDetailEntity.FeeName;
insertParms[4].Value = tempFeeTemplateDetailEntity.CustomerName;
insertParms[5].Value = tempFeeTemplateDetailEntity.Client;
insertParms[6].Value = tempFeeTemplateDetailEntity.Unit;
insertParms[7].Value = tempFeeTemplateDetailEntity.Currency;
insertParms[8].Value = tempFeeTemplateDetailEntity.UnitPrice;
insertParms[9].Value = tempFeeTemplateDetailEntity.Remark;
insertParms[10].Value = tempFeeTemplateDetailEntity.Sort;
insertParms[11].Value = tempFeeTemplateDetailEntity.CreateUser;
insertParms[12].Value = tempFeeTemplateDetailEntity.FeeType;
insertParms[13].Value = tempFeeTemplateDetailEntity.ExchangeRate;
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
int existVal = SqlHelper.ExecuteNonQuery(conn, CommandType.Text, SQL_INSERT_FEE_TEMPLATE_DETAIL, insertParms);
if (existVal > 0)
{
iResult = 1;
}
else
{
iResult = -1;//执行异常
}
}
return iResult;
}
public int UpdateFeeTemplateDetail(FeeTemplateDetailEntity tempFeeTemplateDetailEntity)
{
int iResult = 0;
SqlParameter[] updateParms = new SqlParameter[] {
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_TEMPLATE_ID,SqlDbType.VarChar,36),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_FEE_CODE,SqlDbType.VarChar,50),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_FEE_NAME,SqlDbType.VarChar,100),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_CUSTOMER_NAME,SqlDbType.VarChar,100),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_CLIENT,SqlDbType.Int),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_UNIT,SqlDbType.VarChar,20),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_CURRENCY,SqlDbType.VarChar,20),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_UNIT_PRICE,SqlDbType.Decimal,20),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_REMARK,SqlDbType.VarChar,200),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_SORT,SqlDbType.Int),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_MODIFIED_USER,SqlDbType.VarChar,36),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_FEE_TYPE,SqlDbType.Int),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_EXCHANGE_RATE,SqlDbType.Decimal,23)
};
updateParms[0].Value = tempFeeTemplateDetailEntity.GID;
updateParms[1].Value = tempFeeTemplateDetailEntity.TemplateID;
updateParms[2].Value = tempFeeTemplateDetailEntity.FeeCode;
updateParms[3].Value = tempFeeTemplateDetailEntity.FeeName;
updateParms[4].Value = tempFeeTemplateDetailEntity.CustomerName;
updateParms[5].Value = tempFeeTemplateDetailEntity.Client;
updateParms[6].Value = tempFeeTemplateDetailEntity.Unit;
updateParms[7].Value = tempFeeTemplateDetailEntity.Currency;
updateParms[8].Value = tempFeeTemplateDetailEntity.UnitPrice;
updateParms[9].Value = tempFeeTemplateDetailEntity.Remark;
updateParms[10].Value = tempFeeTemplateDetailEntity.Sort;
updateParms[11].Value = tempFeeTemplateDetailEntity.ModifiedUser;
updateParms[12].Value = tempFeeTemplateDetailEntity.FeeType;
updateParms[13].Value = tempFeeTemplateDetailEntity.ExchangeRate;
using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
{
int existVal = SqlHelper.ExecuteNonQuery(conn, CommandType.Text, SQL_UPDATE_FEE_TEMPLATE_DETAIL, updateParms);
if (existVal > 0)
{
iResult = 1;
}
else
{
iResult = -1;//执行异常
}
}
return iResult;
}
public int SaveFeeTemplateDetail(IList<FeeTemplateDetailEntity> tempFeeTemplateDetailEntities)
{
int iResult = 0;
SqlParameter checkParm = new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_GID,SqlDbType.VarChar,36);
#region 插入参数
SqlParameter[] insertParms = new SqlParameter[] {
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_GID,SqlDbType.VarChar,36),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_TEMPLATE_ID,SqlDbType.VarChar,36),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_FEE_CODE,SqlDbType.VarChar,50),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_FEE_NAME,SqlDbType.VarChar,100),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_CUSTOMER_NAME,SqlDbType.VarChar,100),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_CLIENT,SqlDbType.Int),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_UNIT,SqlDbType.VarChar,20),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_CURRENCY,SqlDbType.VarChar,20),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_UNIT_PRICE,SqlDbType.Decimal,20),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_REMARK,SqlDbType.VarChar,200),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_SORT,SqlDbType.Int),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_CREATE_USER,SqlDbType.VarChar,36),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_FEE_TYPE,SqlDbType.Int),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_EXCHANGE_RATE,SqlDbType.Decimal,23)
};
#endregion
#region 更新参数
SqlParameter[] updateParms = new SqlParameter[] {
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_GID,SqlDbType.VarChar,36),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_TEMPLATE_ID,SqlDbType.VarChar,36),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_FEE_CODE,SqlDbType.VarChar,50),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_FEE_NAME,SqlDbType.VarChar,100),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_CUSTOMER_NAME,SqlDbType.VarChar,100),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_CLIENT,SqlDbType.Int),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_UNIT,SqlDbType.VarChar,20),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_CURRENCY,SqlDbType.VarChar,20),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_UNIT_PRICE,SqlDbType.Decimal,20),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_REMARK,SqlDbType.VarChar,200),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_SORT,SqlDbType.Int),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_MODIFIED_USER,SqlDbType.VarChar,36),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_FEE_TYPE,SqlDbType.Int),
new SqlParameter(PARM_FEE_TEMPLATE_DETAIL_EXCHANGE_RATE,SqlDbType.Decimal,23)
};
#endregion
using (SqlTransaction sqlTran = SqlHelper.BeginTransaction(SqlHelper.ConnectionStringLocalTransaction))
{
try
{
foreach(FeeTemplateDetailEntity detailEntity in tempFeeTemplateDetailEntities)
{
checkParm.Value = detailEntity.GID;
int checkState = (int)SqlHelper.ExecuteScalar(sqlTran, CommandType.Text, SQL_SELECT_COUNT_BY_GID, checkParm);
//如果费用模板明细GID,表中不存在,则执行插入操作,否则执行更新操作
if (checkState == 0)
{
insertParms[0].Value = detailEntity.GID;
insertParms[1].Value = detailEntity.TemplateID;
insertParms[2].Value = detailEntity.FeeCode;
insertParms[3].Value = detailEntity.FeeName;
insertParms[4].Value = detailEntity.CustomerName;
insertParms[5].Value = detailEntity.Client;
insertParms[6].Value = detailEntity.Unit;
insertParms[7].Value = detailEntity.Currency;
insertParms[8].Value = detailEntity.UnitPrice;
insertParms[9].Value = detailEntity.Remark;
insertParms[10].Value = detailEntity.Sort;
insertParms[11].Value = detailEntity.CreateUser;
insertParms[12].Value = detailEntity.FeeType;
insertParms[13].Value = detailEntity.ExchangeRate;
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, SQL_INSERT_FEE_TEMPLATE_DETAIL, insertParms);
}
else
{
updateParms[0].Value = detailEntity.GID;
updateParms[1].Value = detailEntity.TemplateID;
updateParms[2].Value = detailEntity.FeeCode;
updateParms[3].Value = detailEntity.FeeName;
updateParms[4].Value = detailEntity.CustomerName;
updateParms[5].Value = detailEntity.Client;
updateParms[6].Value = detailEntity.Unit;
updateParms[7].Value = detailEntity.Currency;
updateParms[8].Value = detailEntity.UnitPrice;
updateParms[9].Value = detailEntity.Remark;
updateParms[10].Value = detailEntity.Sort;
updateParms[11].Value = detailEntity.ModifiedUser;
updateParms[12].Value = detailEntity.FeeType;
updateParms[13].Value = detailEntity.ExchangeRate;
SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, SQL_UPDATE_FEE_TEMPLATE_DETAIL, updateParms);
}
}
//事务提交
sqlTran.Commit();
iResult = 1;//状态为1表示插入成功
}
catch (Exception execError)
{
iResult = -1;//有异常,插入失败
sqlTran.Rollback();
iResult = -2;//插入异常,事务已回滚成功
throw execError;
}
finally
{
SqlHelper.CloseConnection();
}
}
return iResult;
}
#region 获取SQL语句查询数据集
/// <summary>
/// 获取SQL语句查询数据集
/// </summary>
/// <param name="strSql"></param>
/// <returns></returns>
public DataSet GetExcuteSql(string strSql)
{
DataSet tempSet = new DataSet();
tempSet = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, strSql);
return tempSet;
}
#endregion
}
}