Esempio n. 1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(CZB.Model.FX_IncomeRecord model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into FX_IncomeRecord(");
            strSql.Append("IncomeType,AgentId,ComeFromAgentID,SellerId,PolicyId,InsureCode,InsureType,PolicyAmount,FinalAmount,TotalAmount,TotalRoyaltyRatio,RoyaltyRatio,CommissionAmount,CreateTime,CityCode)");
            strSql.Append(" values (");
            strSql.Append("@IncomeType,@AgentId,@ComeFromAgentID,@SellerId,@PolicyId,@InsureCode,@InsureType,@PolicyAmount,@FinalAmount,@TotalAmount,@TotalRoyaltyRatio,@RoyaltyRatio,@CommissionAmount,@CreateTime,@CityCode)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@IncomeType",        SqlDbType.Int,        4),
                new SqlParameter("@AgentId",           SqlDbType.Int,        4),
                new SqlParameter("@ComeFromAgentID",   SqlDbType.Int,        4),
                new SqlParameter("@SellerId",          SqlDbType.Int,        4),
                new SqlParameter("@PolicyId",          SqlDbType.Int,        4),
                new SqlParameter("@InsureCode",        SqlDbType.NVarChar,  50),
                new SqlParameter("@InsureType",        SqlDbType.Int,        4),
                new SqlParameter("@PolicyAmount",      SqlDbType.Decimal,    9),
                new SqlParameter("@FinalAmount",       SqlDbType.Decimal,    9),
                new SqlParameter("@TotalAmount",       SqlDbType.Decimal,    9),
                new SqlParameter("@TotalRoyaltyRatio", SqlDbType.Decimal,    9),
                new SqlParameter("@RoyaltyRatio",      SqlDbType.Decimal,    9),
                new SqlParameter("@CommissionAmount",  SqlDbType.Decimal,    9),
                new SqlParameter("@CreateTime",        SqlDbType.DateTime),
                new SqlParameter("@CityCode",          SqlDbType.NVarChar, 50)
            };
            parameters[0].Value  = model.IncomeType;
            parameters[1].Value  = model.AgentId;
            parameters[2].Value  = model.ComeFromAgentID;
            parameters[3].Value  = model.SellerId;
            parameters[4].Value  = model.PolicyId;
            parameters[5].Value  = model.InsureCode;
            parameters[6].Value  = model.InsureType;
            parameters[7].Value  = model.PolicyAmount;
            parameters[8].Value  = model.FinalAmount;
            parameters[9].Value  = model.TotalAmount;
            parameters[10].Value = model.TotalRoyaltyRatio;
            parameters[11].Value = model.RoyaltyRatio;
            parameters[12].Value = model.CommissionAmount;
            parameters[13].Value = model.CreateTime;
            parameters[14].Value = model.CityCode;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(CZB.Model.FX_IncomeRecord model)
 {
     return(dal.Update(model));
 }
Esempio n. 3
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(CZB.Model.FX_IncomeRecord model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update FX_IncomeRecord set ");
            strSql.Append("IncomeType=@IncomeType,");
            strSql.Append("AgentId=@AgentId,");
            strSql.Append("ComeFromAgentID=@ComeFromAgentID,");
            strSql.Append("SellerId=@SellerId,");
            strSql.Append("PolicyId=@PolicyId,");
            strSql.Append("InsureCode=@InsureCode,");
            strSql.Append("InsureType=@InsureType,");
            strSql.Append("PolicyAmount=@PolicyAmount,");
            strSql.Append("FinalAmount=@FinalAmount,");
            strSql.Append("TotalAmount=@TotalAmount,");
            strSql.Append("TotalRoyaltyRatio=@TotalRoyaltyRatio,");
            strSql.Append("RoyaltyRatio=@RoyaltyRatio,");
            strSql.Append("CommissionAmount=@CommissionAmount,");
            strSql.Append("CreateTime=@CreateTime,");
            strSql.Append("CityCode=@CityCode");
            strSql.Append(" where IncomeRecordId=@IncomeRecordId");
            SqlParameter[] parameters =
            {
                new SqlParameter("@IncomeType",        SqlDbType.Int,        4),
                new SqlParameter("@AgentId",           SqlDbType.Int,        4),
                new SqlParameter("@ComeFromAgentID",   SqlDbType.Int,        4),
                new SqlParameter("@SellerId",          SqlDbType.Int,        4),
                new SqlParameter("@PolicyId",          SqlDbType.Int,        4),
                new SqlParameter("@InsureCode",        SqlDbType.NVarChar,  50),
                new SqlParameter("@InsureType",        SqlDbType.Int,        4),
                new SqlParameter("@PolicyAmount",      SqlDbType.Decimal,    9),
                new SqlParameter("@FinalAmount",       SqlDbType.Decimal,    9),
                new SqlParameter("@TotalAmount",       SqlDbType.Decimal,    9),
                new SqlParameter("@TotalRoyaltyRatio", SqlDbType.Decimal,    9),
                new SqlParameter("@RoyaltyRatio",      SqlDbType.Decimal,    9),
                new SqlParameter("@CommissionAmount",  SqlDbType.Decimal,    9),
                new SqlParameter("@CreateTime",        SqlDbType.DateTime),
                new SqlParameter("@CityCode",          SqlDbType.NVarChar,  50),
                new SqlParameter("@IncomeRecordId",    SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.IncomeType;
            parameters[1].Value  = model.AgentId;
            parameters[2].Value  = model.ComeFromAgentID;
            parameters[3].Value  = model.SellerId;
            parameters[4].Value  = model.PolicyId;
            parameters[5].Value  = model.InsureCode;
            parameters[6].Value  = model.InsureType;
            parameters[7].Value  = model.PolicyAmount;
            parameters[8].Value  = model.FinalAmount;
            parameters[9].Value  = model.TotalAmount;
            parameters[10].Value = model.TotalRoyaltyRatio;
            parameters[11].Value = model.RoyaltyRatio;
            parameters[12].Value = model.CommissionAmount;
            parameters[13].Value = model.CreateTime;
            parameters[14].Value = model.CityCode;
            parameters[15].Value = model.IncomeRecordId;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(CZB.Model.FX_IncomeRecord model)
 {
     return(dal.Add(model));
 }