Exemple #1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.Finance.Agent.WithdrawAgent GetModel(int id)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@id", SqlDbType.Int, 4)
            };
            parameters[0].Value = id;

            Model.Finance.Agent.WithdrawAgent model = new Model.Finance.Agent.WithdrawAgent();
            DataSet ds = DbHelperSQL.RunProcedure("proc_withdrawAgent_getmodel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Model.Finance.Agent.WithdrawAgent model)
 {
     return(dal.Update(model));
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Model.Finance.Agent.WithdrawAgent model)
 {
     return(dal.Add(model));
 }
Exemple #4
0
        /// <summary>
        ///  增加一条数据
        /// </summary>
        public int Add(Model.Finance.Agent.WithdrawAgent model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@id",              SqlDbType.Int,         4),
                new SqlParameter("@mode",            SqlDbType.TinyInt,     1),
                new SqlParameter("@lotno",           SqlDbType.VarChar,    30),
                new SqlParameter("@serial",          SqlDbType.Int,         4),
                new SqlParameter("@trade_no",        SqlDbType.VarChar,    40),
                new SqlParameter("@out_trade_no",    SqlDbType.VarChar,    64),
                new SqlParameter("@service",         SqlDbType.VarChar,    40),
                new SqlParameter("@input_charset",   SqlDbType.VarChar,    20),
                new SqlParameter("@userid",          SqlDbType.Int,         4),
                new SqlParameter("@sign_type",       SqlDbType.VarChar,     8),
                new SqlParameter("@return_url",      SqlDbType.VarChar,   256),
                new SqlParameter("@provinceCode",    SqlDbType.VarChar,    50),
                new SqlParameter("@cityCode",        SqlDbType.VarChar,    50),
                new SqlParameter("@bankProvince",    SqlDbType.VarChar,    50),
                new SqlParameter("@bankCity",        SqlDbType.VarChar,    50),
                new SqlParameter("@bankCode",        SqlDbType.VarChar,    10),
                new SqlParameter("@bankName",        SqlDbType.NVarChar,   20),
                new SqlParameter("@bankBranch",      SqlDbType.NVarChar,  255),
                new SqlParameter("@bankAccountName", SqlDbType.NVarChar,   20),
                new SqlParameter("@bankaccoutType",  SqlDbType.TinyInt,     1),
                new SqlParameter("@bankAccount",     SqlDbType.VarChar,    50),
                new SqlParameter("@amount",          SqlDbType.Decimal,     9),
                new SqlParameter("@charge",          SqlDbType.Decimal,     9),
                new SqlParameter("@totalamt",        SqlDbType.Decimal,     9),
                new SqlParameter("@addTime",         SqlDbType.DateTime),
                new SqlParameter("@processingTime",  SqlDbType.DateTime),
                new SqlParameter("@audit_status",    SqlDbType.TinyInt,     1),
                new SqlParameter("@auditTime",       SqlDbType.DateTime),
                new SqlParameter("@auditUser",       SqlDbType.Int,         4),
                new SqlParameter("@auditUserName",   SqlDbType.VarChar,    50),
                new SqlParameter("@payment_status",  SqlDbType.TinyInt,     1),
                new SqlParameter("@is_cancel",       SqlDbType.Bit,         1),
                new SqlParameter("@ext1",            SqlDbType.VarChar,    50),
                new SqlParameter("@ext2",            SqlDbType.VarChar,    50),
                new SqlParameter("@ext3",            SqlDbType.VarChar,    50),
                new SqlParameter("@remark",          SqlDbType.NVarChar,  500),
                new SqlParameter("@tranApi",         SqlDbType.Int,         4),
                new SqlParameter("@suppstatus",      SqlDbType.TinyInt,     1),
                new SqlParameter("@notifyTimes",     SqlDbType.Int,         4),
                new SqlParameter("@notifystatus",    SqlDbType.TinyInt,     1),
                new SqlParameter("@callbackText",    SqlDbType.NVarChar,   50),
                new SqlParameter("@issure",          SqlDbType.TinyInt,     1),
                new SqlParameter("@suretime",        SqlDbType.DateTime),
                new SqlParameter("@sureclientip",    SqlDbType.VarChar,    50),
                new SqlParameter("@sureuser",        SqlDbType.NVarChar, 50)
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = model.mode;
            parameters[2].Value     = model.lotno;
            parameters[3].Value     = model.serial;
            parameters[4].Value     = model.trade_no;
            parameters[5].Value     = model.out_trade_no;
            parameters[6].Value     = model.service;
            parameters[7].Value     = model.input_charset;
            parameters[8].Value     = model.userid;
            parameters[9].Value     = model.sign_type;
            parameters[10].Value    = model.return_url;
            parameters[11].Value    = model.provinceCode;
            parameters[12].Value    = model.cityCode;
            parameters[13].Value    = model.bankProvince;
            parameters[14].Value    = model.bankCity;
            parameters[15].Value    = model.bankCode;
            parameters[16].Value    = model.bankName;
            parameters[17].Value    = model.bankBranch;
            parameters[18].Value    = model.bankAccountName;
            parameters[19].Value    = model.bankaccoutType;
            parameters[20].Value    = model.bankAccount;
            parameters[21].Value    = model.amount;
            parameters[22].Value    = model.charge;
            parameters[23].Value    = model.totalamt;
            parameters[24].Value    = model.addTime;
            parameters[25].Value    = model.processingTime;
            parameters[26].Value    = model.audit_status;
            parameters[27].Value    = model.auditTime;
            parameters[28].Value    = model.auditUser;
            parameters[29].Value    = model.auditUserName;
            parameters[30].Value    = model.payment_status;
            parameters[31].Value    = model.is_cancel;
            parameters[32].Value    = model.ext1;
            parameters[33].Value    = model.ext2;
            parameters[34].Value    = model.ext3;
            parameters[35].Value    = model.remark;
            parameters[36].Value    = model.tranApi;
            parameters[37].Value    = model.suppstatus;
            parameters[38].Value    = model.notifyTimes;
            parameters[39].Value    = model.notifystatus;
            parameters[40].Value    = model.callbackText;
            parameters[41].Value    = model.issure;
            parameters[42].Value    = model.suretime;
            parameters[43].Value    = model.sureclientip;
            parameters[44].Value    = model.sureuser;

            DbHelperSQL.RunProcedure("proc_withdrawAgent_add", parameters, out rowsAffected);
            return((int)parameters[0].Value);
        }
Exemple #5
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Model.Finance.Agent.WithdrawAgent DataRowToModel(DataRow row)
 {
     Model.Finance.Agent.WithdrawAgent model = new Model.Finance.Agent.WithdrawAgent();
     if (row != null)
     {
         if (row["id"] != null && row["id"].ToString() != "")
         {
             model.id = int.Parse(row["id"].ToString());
         }
         if (row["mode"] != null && row["mode"].ToString() != "")
         {
             model.mode = int.Parse(row["mode"].ToString());
         }
         if (row["lotno"] != null)
         {
             model.lotno = row["lotno"].ToString();
         }
         if (row["serial"] != null && row["serial"].ToString() != "")
         {
             model.serial = int.Parse(row["serial"].ToString());
         }
         if (row["trade_no"] != null)
         {
             model.trade_no = row["trade_no"].ToString();
         }
         if (row["out_trade_no"] != null)
         {
             model.out_trade_no = row["out_trade_no"].ToString();
         }
         if (row["service"] != null)
         {
             model.service = row["service"].ToString();
         }
         if (row["input_charset"] != null)
         {
             model.input_charset = row["input_charset"].ToString();
         }
         if (row["userid"] != null && row["userid"].ToString() != "")
         {
             model.userid = int.Parse(row["userid"].ToString());
         }
         if (row["sign_type"] != null)
         {
             model.sign_type = row["sign_type"].ToString();
         }
         if (row["return_url"] != null)
         {
             model.return_url = row["return_url"].ToString();
         }
         if (row["provinceCode"] != null)
         {
             model.provinceCode = row["provinceCode"].ToString();
         }
         if (row["cityCode"] != null)
         {
             model.cityCode = row["cityCode"].ToString();
         }
         if (row["bankProvince"] != null)
         {
             model.bankProvince = row["bankProvince"].ToString();
         }
         if (row["bankCity"] != null)
         {
             model.bankCity = row["bankCity"].ToString();
         }
         if (row["bankCode"] != null)
         {
             model.bankCode = row["bankCode"].ToString();
         }
         if (row["bankName"] != null)
         {
             model.bankName = row["bankName"].ToString();
         }
         if (row["bankBranch"] != null)
         {
             model.bankBranch = row["bankBranch"].ToString();
         }
         if (row["bankAccountName"] != null)
         {
             model.bankAccountName = row["bankAccountName"].ToString();
         }
         if (row["bankaccoutType"] != null && row["bankaccoutType"].ToString() != "")
         {
             model.bankaccoutType = int.Parse(row["bankaccoutType"].ToString());
         }
         if (row["bankAccount"] != null)
         {
             model.bankAccount = row["bankAccount"].ToString();
         }
         if (row["amount"] != null && row["amount"].ToString() != "")
         {
             model.amount = decimal.Parse(row["amount"].ToString());
         }
         if (row["charge"] != null && row["charge"].ToString() != "")
         {
             model.charge = decimal.Parse(row["charge"].ToString());
         }
         if (row["totalamt"] != null && row["totalamt"].ToString() != "")
         {
             model.totalamt = decimal.Parse(row["totalamt"].ToString());
         }
         if (row["addTime"] != null && row["addTime"].ToString() != "")
         {
             model.addTime = DateTime.Parse(row["addTime"].ToString());
         }
         if (row["processingTime"] != null && row["processingTime"].ToString() != "")
         {
             model.processingTime = DateTime.Parse(row["processingTime"].ToString());
         }
         if (row["audit_status"] != null && row["audit_status"].ToString() != "")
         {
             model.audit_status = int.Parse(row["audit_status"].ToString());
         }
         if (row["auditTime"] != null && row["auditTime"].ToString() != "")
         {
             model.auditTime = DateTime.Parse(row["auditTime"].ToString());
         }
         if (row["auditUser"] != null && row["auditUser"].ToString() != "")
         {
             model.auditUser = int.Parse(row["auditUser"].ToString());
         }
         if (row["auditUserName"] != null)
         {
             model.auditUserName = row["auditUserName"].ToString();
         }
         if (row["payment_status"] != null && row["payment_status"].ToString() != "")
         {
             model.payment_status = int.Parse(row["payment_status"].ToString());
         }
         if (row["is_cancel"] != null && row["is_cancel"].ToString() != "")
         {
             if ((row["is_cancel"].ToString() == "1") || (row["is_cancel"].ToString().ToLower() == "true"))
             {
                 model.is_cancel = true;
             }
             else
             {
                 model.is_cancel = false;
             }
         }
         if (row["ext1"] != null)
         {
             model.ext1 = row["ext1"].ToString();
         }
         if (row["ext2"] != null)
         {
             model.ext2 = row["ext2"].ToString();
         }
         if (row["ext3"] != null)
         {
             model.ext3 = row["ext3"].ToString();
         }
         if (row["remark"] != null)
         {
             model.remark = row["remark"].ToString();
         }
         if (row["tranApi"] != null && row["tranApi"].ToString() != "")
         {
             model.tranApi = int.Parse(row["tranApi"].ToString());
         }
         if (row["suppstatus"] != null && row["suppstatus"].ToString() != "")
         {
             model.suppstatus = int.Parse(row["suppstatus"].ToString());
         }
         if (row["notifyTimes"] != null && row["notifyTimes"].ToString() != "")
         {
             model.notifyTimes = int.Parse(row["notifyTimes"].ToString());
         }
         if (row["notifystatus"] != null && row["notifystatus"].ToString() != "")
         {
             model.notifystatus = int.Parse(row["notifystatus"].ToString());
         }
         if (row["callbackText"] != null)
         {
             model.callbackText = row["callbackText"].ToString();
         }
         if (row["issure"] != null && row["issure"].ToString() != "")
         {
             model.issure = int.Parse(row["issure"].ToString());
         }
         if (row["suretime"] != null && row["suretime"].ToString() != "")
         {
             model.suretime = DateTime.Parse(row["suretime"].ToString());
         }
         if (row["sureclientip"] != null)
         {
             model.sureclientip = row["sureclientip"].ToString();
         }
         if (row["sureuser"] != null)
         {
             model.sureuser = row["sureuser"].ToString();
         }
     }
     return(model);
 }