示例#1
0
        /// <summary>
        /// datarow转成对象实体
        /// </summary>
        public BWJS.Model.OrderPayApply DataRowToModel(DataRow row)
        {
            BWJS.Model.OrderPayApply model = new BWJS.Model.OrderPayApply();

            if (row != null)
            {
                if (row["OrderPayApplyId"].ToString() != "")
                {
                    model.OrderPayApplyId = int.Parse(row["OrderPayApplyId"].ToString());
                }
                model.PayJson = row["PayJson"].ToString();
                if (row["CreateDate"].ToString() != "")
                {
                    model.CreateDate = DateTime.Parse(row["CreateDate"].ToString());
                }
                if (row["PayDate"].ToString() != "")
                {
                    model.PayDate = DateTime.Parse(row["PayDate"].ToString());
                }
                model.Remark = row["Remark"].ToString();
                if (row["IsDeleted"].ToString() != "")
                {
                    model.IsDeleted = int.Parse(row["IsDeleted"].ToString());
                }
                if (row["OrderRebateId"].ToString() != "")
                {
                    model.OrderRebateId = int.Parse(row["OrderRebateId"].ToString());
                }
                if (row["OrderMoney"].ToString() != "")
                {
                    model.OrderMoney = decimal.Parse(row["OrderMoney"].ToString());
                }
                model.PayOrderNumber = row["PayOrderNumber"].ToString();
                if (row["PayStatus"].ToString() != "")
                {
                    model.PayStatus = int.Parse(row["PayStatus"].ToString());
                }
                if (row["PayPlatform"].ToString() != "")
                {
                    model.PayPlatform = int.Parse(row["PayPlatform"].ToString());
                }
                if (row["PayMethod"].ToString() != "")
                {
                    model.PayMethod = int.Parse(row["PayMethod"].ToString());
                }
                model.PayCode = row["PayCode"].ToString();
                model.PayText = row["PayText"].ToString();

                return(model);
            }
            else
            {
                return(null);
            }
        }
示例#2
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(BWJS.Model.OrderPayApply model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update OrderPayApply set ");

            strSql.Append(" PayJson = @PayJson , ");
            strSql.Append(" CreateDate = @CreateDate , ");
            strSql.Append(" PayDate = @PayDate , ");
            strSql.Append(" Remark = @Remark , ");
            strSql.Append(" IsDeleted = @IsDeleted , ");
            strSql.Append(" OrderRebateId = @OrderRebateId , ");
            strSql.Append(" OrderMoney = @OrderMoney , ");
            strSql.Append(" PayOrderNumber = @PayOrderNumber , ");
            strSql.Append(" PayStatus = @PayStatus , ");
            strSql.Append(" PayPlatform = @PayPlatform , ");
            strSql.Append(" PayMethod = @PayMethod , ");
            strSql.Append(" PayCode = @PayCode , ");
            strSql.Append(" PayText = @PayText  ");
            strSql.Append(" where OrderPayApplyId=@OrderPayApplyId ");

            SqlParameter[] parameters =
            {
                new SqlParameter("@OrderPayApplyId", model.OrderPayApplyId),
                new SqlParameter("@PayJson",         model.PayJson),
                new SqlParameter("@CreateDate",      model.CreateDate),
                new SqlParameter("@PayDate",         model.PayDate),
                new SqlParameter("@Remark",          model.Remark),
                new SqlParameter("@IsDeleted",       model.IsDeleted),
                new SqlParameter("@OrderRebateId",   model.OrderRebateId),
                new SqlParameter("@OrderMoney",      model.OrderMoney),
                new SqlParameter("@PayOrderNumber",  model.PayOrderNumber),
                new SqlParameter("@PayStatus",       model.PayStatus),
                new SqlParameter("@PayPlatform",     model.PayPlatform),
                new SqlParameter("@PayMethod",       model.PayMethod),
                new SqlParameter("@PayCode",         model.PayCode),
                new SqlParameter("@PayText",         model.PayText)
            };

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(BWJS.Model.OrderPayApply model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into OrderPayApply(");
            strSql.Append("PayJson,CreateDate,PayDate,Remark,IsDeleted,OrderRebateId,OrderMoney,PayOrderNumber,PayStatus,PayPlatform,PayMethod,PayCode,PayText");
            strSql.Append(") values (");
            strSql.Append("@PayJson,@CreateDate,@PayDate,@Remark,@IsDeleted,@OrderRebateId,@OrderMoney,@PayOrderNumber,@PayStatus,@PayPlatform,@PayMethod,@PayCode,@PayText");
            strSql.Append(") ");
            strSql.Append(";select SCOPE_IDENTITY()");
            SqlParameter[] parameters =
            {
                new SqlParameter("@PayJson",        model.PayJson),
                new SqlParameter("@CreateDate",     model.CreateDate),
                new SqlParameter("@PayDate",        model.PayDate),
                new SqlParameter("@Remark",         model.Remark),
                new SqlParameter("@IsDeleted",      model.IsDeleted),
                new SqlParameter("@OrderRebateId",  model.OrderRebateId),
                new SqlParameter("@OrderMoney",     model.OrderMoney),
                new SqlParameter("@PayOrderNumber", model.PayOrderNumber),
                new SqlParameter("@PayStatus",      model.PayStatus),
                new SqlParameter("@PayPlatform",    model.PayPlatform),
                new SqlParameter("@PayMethod",      model.PayMethod),
                new SqlParameter("@PayCode",        model.PayCode),
                new SqlParameter("@PayText",        model.PayText)
            };


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

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
示例#4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(BWJS.Model.OrderPayApply model)
 {
     return(dal.Update(model));
 }
示例#5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(BWJS.Model.OrderPayApply model)
 {
     return(dal.Add(model));
 }