Exemplo n.º 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(BWJS.Model.OrderRebateSettlementDetails model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update dbo.[OrderRebateSettlementDetails] set ");

            strSql.Append(" OrderRebateSettlementApplyId = @OrderRebateSettlementApplyId , ");
            strSql.Append(" OrderRebateId = @OrderRebateId , ");
            strSql.Append(" CreateDate = @CreateDate , ");
            strSql.Append(" CreateId = @CreateId  ");
            strSql.Append(" where OrderRebateSettlementDetailsId=@OrderRebateSettlementDetailsId ");

            SqlParameter[] parameters =
            {
                new SqlParameter("@OrderRebateSettlementDetailsId", model.OrderRebateSettlementDetailsId),
                new SqlParameter("@OrderRebateSettlementApplyId",   model.OrderRebateSettlementApplyId),
                new SqlParameter("@OrderRebateId",                  model.OrderRebateId),
                new SqlParameter("@CreateDate",                     model.CreateDate),
                new SqlParameter("@CreateId",                       model.CreateId)
            };

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(BWJS.Model.OrderRebateSettlementDetails model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into dbo.[OrderRebateSettlementDetails](");
            strSql.Append("OrderRebateSettlementApplyId,OrderRebateId,CreateDate,CreateId");
            strSql.Append(") values (");
            strSql.Append("@OrderRebateSettlementApplyId,@OrderRebateId,@CreateDate,@CreateId");
            strSql.Append(") ");
            strSql.Append(";select SCOPE_IDENTITY()");
            SqlParameter[] parameters =
            {
                new SqlParameter("@OrderRebateSettlementApplyId", model.OrderRebateSettlementApplyId),
                new SqlParameter("@OrderRebateId",                model.OrderRebateId),
                new SqlParameter("@CreateDate",                   model.CreateDate),
                new SqlParameter("@CreateId",                     model.CreateId)
            };


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

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// datarow转成对象实体
        /// </summary>
        public BWJS.Model.OrderRebateSettlementDetails DataRowToModel(DataRow row)
        {
            BWJS.Model.OrderRebateSettlementDetails model = new BWJS.Model.OrderRebateSettlementDetails();

            if (row != null)
            {
                if (row["OrderRebateSettlementDetailsId"].ToString() != "")
                {
                    model.OrderRebateSettlementDetailsId = int.Parse(row["OrderRebateSettlementDetailsId"].ToString());
                }
                if (row["OrderRebateSettlementApplyId"].ToString() != "")
                {
                    model.OrderRebateSettlementApplyId = int.Parse(row["OrderRebateSettlementApplyId"].ToString());
                }
                if (row["OrderRebateId"].ToString() != "")
                {
                    model.OrderRebateId = int.Parse(row["OrderRebateId"].ToString());
                }
                if (row["CreateDate"].ToString() != "")
                {
                    model.CreateDate = DateTime.Parse(row["CreateDate"].ToString());
                }
                if (row["CreateId"].ToString() != "")
                {
                    model.CreateId = int.Parse(row["CreateId"].ToString());
                }

                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public BWJS.Model.OrderRebateSettlementDetails GetModel(int OrderRebateSettlementDetailsId)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select OrderRebateSettlementDetailsId, OrderRebateSettlementApplyId, OrderRebateId, CreateDate, CreateId  ");
            strSql.Append("  from dbo.[OrderRebateSettlementDetails] ");
            strSql.Append(" where OrderRebateSettlementDetailsId=@OrderRebateSettlementDetailsId");
            SqlParameter[] parameters =
            {
                new SqlParameter("@OrderRebateSettlementDetailsId", SqlDbType.Int, 4)
            };
            parameters[0].Value = OrderRebateSettlementDetailsId;


            BWJS.Model.OrderRebateSettlementDetails model = new BWJS.Model.OrderRebateSettlementDetails();
            DataSet ds = BWJSHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(BWJS.Model.OrderRebateSettlementDetails model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 6
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(BWJS.Model.OrderRebateSettlementDetails model)
 {
     return(dal.Add(model));
 }