Beispiel #1
0
        /// <summary>
        /// 修改员工资料
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static Hashtable Update(Model.Member model, Hashtable MyHs)
        {
            if (model == null)
            {
                return(MyHs);
            }
            string        guid   = Guid.NewGuid().ToString();
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Member set ");

            strSql.Append(" Bank = @Bank , ");
            strSql.Append(" Branch = @Branch , ");
            strSql.Append(" BankNumber = @BankNumber , ");
            strSql.Append(" BankCardName = @BankCardName , ");
            strSql.Append(" Password = @Password , ");
            strSql.Append(" SecPsd = @SecPsd , ");
            strSql.Append(" MTJ = @MTJ , ");
            strSql.Append(" MSH = @MSH , ");
            strSql.Append(" MBD = @MBD , ");
            strSql.Append(" MBDIndex = @MBDIndex , ");
            strSql.Append(" MID = @MID , ");
            strSql.Append(" MCreateDate = @MCreateDate , ");
            strSql.Append(" MDate = @MDate , ");
            strSql.Append(" MState = @MState , ");
            strSql.Append(" IsClose = @IsClose , ");
            strSql.Append(" IsClock = @IsClock , ");
            strSql.Append(" RoleCode = @RoleCode , ");
            strSql.Append(" AgencyCode = @AgencyCode , ");
            strSql.Append(" MName = @MName , ");
            strSql.Append(" Salt = @Salt , ");
            strSql.Append(" ThrPsd = @ThrPsd , ");
            strSql.Append(" SHMoney = @SHMoney , ");
            strSql.Append(" NumID = @NumID , ");
            strSql.Append(" Province = @Province , ");
            strSql.Append(" QQ = @QQ , ");
            strSql.Append(" City = @City , ");
            strSql.Append(" Zone = @Zone , ");
            strSql.Append(" Tel = @Tel , ");
            strSql.Append(" Email = @Email , ");
            strSql.Append(" FMID = @FMID , ");
            strSql.Append(" QRCode = @QRCode , ");
            strSql.Append(" Address = @Address,  ");
            strSql.Append(" NAgencyCode = @NAgencyCode,  ");
            strSql.Append(" RegistAgency = @RegistAgency,  ");
            strSql.Append(" FHState=@FHState, ");
            strSql.Append(" validtime=@validtime, ");
            strSql.Append(" Alipay=@Alipay, ");
            strSql.Append(" WeChat=@WeChat, ");
            strSql.Append(" Country = @Country  ");
            strSql.Append(" where MID=@MID  ");
            strSql.AppendFormat(" ;select '{0}'", guid).Append(UpdateThrPsd(model.MID));;

            SqlParameter[] parameters =
            {
                new SqlParameter("@ID",           SqlDbType.Int,        4),
                new SqlParameter("@Bank",         SqlDbType.VarChar,   50),
                new SqlParameter("@Branch",       SqlDbType.VarChar,   50),
                new SqlParameter("@BankNumber",   SqlDbType.VarChar,   30),
                new SqlParameter("@BankCardName", SqlDbType.NVarChar,  50),
                new SqlParameter("@Password",     SqlDbType.VarChar,   32),
                new SqlParameter("@SecPsd",       SqlDbType.VarChar,   32),
                new SqlParameter("@MTJ",          SqlDbType.VarChar,   20),
                new SqlParameter("@MSH",          SqlDbType.VarChar,   20),
                new SqlParameter("@MBD",          SqlDbType.VarChar,   20),
                new SqlParameter("@MBDIndex",     SqlDbType.Int,        4),
                new SqlParameter("@MID",          SqlDbType.VarChar,   20),
                new SqlParameter("@MCreateDate",  SqlDbType.DateTime),
                new SqlParameter("@MDate",        SqlDbType.DateTime),
                new SqlParameter("@MState",       SqlDbType.Bit,        1),
                new SqlParameter("@IsClose",      SqlDbType.Bit,        1),
                new SqlParameter("@IsClock",      SqlDbType.Bit,        1),
                new SqlParameter("@RoleCode",     SqlDbType.VarChar,   10),
                new SqlParameter("@AgencyCode",   SqlDbType.VarChar,   10),
                new SqlParameter("@MName",        SqlDbType.NVarChar,  50),
                new SqlParameter("@Salt",         SqlDbType.VarChar,   10),
                new SqlParameter("@ThrPsd",       SqlDbType.VarChar,   50),
                new SqlParameter("@SHMoney",      SqlDbType.Int,        4),
                new SqlParameter("@NumID",        SqlDbType.VarChar,   50),
                new SqlParameter("@Province",     SqlDbType.VarChar,   20),
                new SqlParameter("@QQ",           SqlDbType.VarChar,   20),
                new SqlParameter("@City",         SqlDbType.VarChar,   20),
                new SqlParameter("@Zone",         SqlDbType.VarChar,   20),
                new SqlParameter("@Tel",          SqlDbType.VarChar,   20),
                new SqlParameter("@Email",        SqlDbType.VarChar,   50),
                new SqlParameter("@FMID",         SqlDbType.VarChar,   20),
                new SqlParameter("@Address",      SqlDbType.Text),
                new SqlParameter("@Country",      SqlDbType.VarChar,   20),
                new SqlParameter("@NAgencyCode",  SqlDbType.VarChar,   10),
                new SqlParameter("@RegistAgency", SqlDbType.VarChar,   10),
                new SqlParameter("@FHState",      SqlDbType.Bit,        1),
                new SqlParameter("@validtime",    SqlDbType.DateTime),
                new SqlParameter("@Alipay",       SqlDbType.VarChar,   20),
                new SqlParameter("@WeChat",       SqlDbType.VarChar,   20),
                new SqlParameter("@QRCode",       SqlDbType.VarChar, 200)
            };

            parameters[0].Value  = model.ID;
            parameters[1].Value  = model.Bank;
            parameters[2].Value  = model.Branch;
            parameters[3].Value  = model.BankNumber;
            parameters[4].Value  = model.BankCardName;
            parameters[5].Value  = model.Password;
            parameters[6].Value  = model.SecPsd;
            parameters[7].Value  = model.MTJ.ToLower();
            parameters[8].Value  = model.MSH.ToLower();
            parameters[9].Value  = model.MBD.ToLower();
            parameters[10].Value = model.MBDIndex;
            parameters[11].Value = model.MID.ToLower();
            parameters[12].Value = model.MCreateDate;
            parameters[13].Value = model.MDate;
            parameters[14].Value = model.MState;
            parameters[15].Value = model.IsClose;
            parameters[16].Value = model.IsClock;
            parameters[17].Value = model.RoleCode;
            parameters[18].Value = model.AgencyCode;
            parameters[19].Value = model.MName;
            parameters[20].Value = model.Salt;
            parameters[21].Value = model.ThrPsd;
            parameters[22].Value = model.SHMoney;
            parameters[23].Value = model.NumID;
            parameters[24].Value = model.Province;
            parameters[25].Value = model.QQ;
            parameters[26].Value = model.City;
            parameters[27].Value = model.Zone;
            parameters[28].Value = model.Tel;
            parameters[29].Value = model.Email;
            parameters[30].Value = model.FMID;
            parameters[31].Value = model.Address;
            parameters[32].Value = model.Country;
            parameters[33].Value = model.NAgencyCode;
            parameters[34].Value = model.RegistAgency;
            parameters[35].Value = model.FHState;
            parameters[36].Value = model.ValidTime;
            parameters[37].Value = model.Alipay;
            parameters[38].Value = model.WeChat;
            parameters[39].Value = model.QRCode;

            MyHs.Add(strSql.ToString(), parameters);
            if (DAL.MemberConfig.GetModel(model.MID, model) != null)
            {
                MemberConfig.Update(model.MConfig, MyHs);
            }
            else if (model.IsNewMemberSH)
            {
                MemberConfig.Insert(model.MConfig, MyHs);
            }
            return(MyHs);
        }
Beispiel #2
0
        /// <summary>
        /// 插入员工
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool Insert(Model.Member model)
        {
            string        guid   = Guid.NewGuid().ToString();
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Member(");
            strSql.Append("Bank,Branch,BankNumber,BankCardName,Password,SecPsd,MTJ,MSH,MBD,MBDIndex,MID,MCreateDate,MDate,MState,IsClose,IsClock,RoleCode,AgencyCode,MName,Salt,ThrPsd,SHMoney,NumID,Province,QQ,City,Zone,Tel,Email,Address,FMID,Country,NAgencyCode,RegistAgency,FHState,validtime,Alipay,WeChat,QRCode");
            strSql.Append(") values (");
            strSql.Append("@Bank,@Branch,@BankNumber,@BankCardName,@Password,@SecPsd,@MTJ,@MSH,@MBD,@MBDIndex,@MID,@MCreateDate,@MDate,@MState,@IsClose,@IsClock,@RoleCode,@AgencyCode,@MName,@Salt,@ThrPsd,@SHMoney,@NumID,@Province,@QQ,@City,@Zone,@Tel,@Email,@Address,@FMID,@Country,@NAgencyCode,@RegistAgency,@FHState,@validtime,@Alipay,@WeChat,@QRCode");
            strSql.Append(") ");
            strSql.AppendFormat(";select '{0}'", guid).Append(UpdateThrPsd(model.MID));
            SqlParameter[] parameters =
            {
                new SqlParameter("@Bank",         SqlDbType.VarChar,   50),
                new SqlParameter("@Branch",       SqlDbType.VarChar,   50),
                new SqlParameter("@BankNumber",   SqlDbType.VarChar,   30),
                new SqlParameter("@BankCardName", SqlDbType.NVarChar,  50),
                new SqlParameter("@Password",     SqlDbType.VarChar,   32),
                new SqlParameter("@SecPsd",       SqlDbType.VarChar,   32),
                new SqlParameter("@MTJ",          SqlDbType.VarChar,   20),
                new SqlParameter("@MSH",          SqlDbType.VarChar,   20),
                new SqlParameter("@MBD",          SqlDbType.VarChar,   20),
                new SqlParameter("@MBDIndex",     SqlDbType.Int,        4),
                new SqlParameter("@MID",          SqlDbType.VarChar,   20),
                new SqlParameter("@MCreateDate",  SqlDbType.DateTime),
                new SqlParameter("@MDate",        SqlDbType.DateTime),
                new SqlParameter("@MState",       SqlDbType.Bit,        1),
                new SqlParameter("@IsClose",      SqlDbType.Bit,        1),
                new SqlParameter("@IsClock",      SqlDbType.Bit,        1),
                new SqlParameter("@RoleCode",     SqlDbType.VarChar,   10),
                new SqlParameter("@AgencyCode",   SqlDbType.VarChar,   10),
                new SqlParameter("@MName",        SqlDbType.NVarChar,  50),
                new SqlParameter("@Salt",         SqlDbType.VarChar,   10),
                new SqlParameter("@ThrPsd",       SqlDbType.VarChar,   50),
                new SqlParameter("@SHMoney",      SqlDbType.Int,        4),
                new SqlParameter("@NumID",        SqlDbType.VarChar,   50),
                new SqlParameter("@Province",     SqlDbType.VarChar,   20),
                new SqlParameter("@QQ",           SqlDbType.VarChar,   20),
                new SqlParameter("@City",         SqlDbType.VarChar,   20),
                new SqlParameter("@Zone",         SqlDbType.VarChar,   20),
                new SqlParameter("@Tel",          SqlDbType.VarChar,   20),
                new SqlParameter("@Email",        SqlDbType.VarChar,   50),
                new SqlParameter("@Address",      SqlDbType.Text),
                new SqlParameter("@FMID",         SqlDbType.VarChar,   20),
                new SqlParameter("@Country",      SqlDbType.VarChar,   20),
                new SqlParameter("@NAgencyCode",  SqlDbType.VarChar,   10),
                new SqlParameter("@RegistAgency", SqlDbType.VarChar,   10),
                new SqlParameter("@FHState",      SqlDbType.Bit,        1),
                new SqlParameter("@validtime",    SqlDbType.DateTime),
                new SqlParameter("@Alipay",       SqlDbType.VarChar,   20),
                new SqlParameter("@WeChat",       SqlDbType.VarChar,   20),
                new SqlParameter("@QRCode",       SqlDbType.VarChar, 200)
            };

            parameters[0].Value  = model.Bank;
            parameters[1].Value  = model.Branch;
            parameters[2].Value  = model.BankNumber;
            parameters[3].Value  = model.BankCardName;
            parameters[4].Value  = model.Password;
            parameters[5].Value  = model.SecPsd;
            parameters[6].Value  = model.MTJ.ToLower();
            parameters[7].Value  = model.MSH.ToLower();
            parameters[8].Value  = model.MBD.ToLower();
            parameters[9].Value  = model.MBDIndex;
            parameters[10].Value = model.MID.ToLower();
            parameters[11].Value = model.MCreateDate;
            parameters[12].Value = model.MDate;
            parameters[13].Value = model.MState;
            parameters[14].Value = model.IsClose;
            parameters[15].Value = model.IsClock;
            parameters[16].Value = model.RoleCode;
            parameters[17].Value = model.AgencyCode;
            parameters[18].Value = model.MName;
            parameters[19].Value = model.Salt;
            parameters[20].Value = model.ThrPsd;
            parameters[21].Value = model.SHMoney;
            parameters[22].Value = model.NumID;
            parameters[23].Value = model.Province;
            parameters[24].Value = model.QQ;
            parameters[25].Value = model.City;
            parameters[26].Value = model.Zone;
            parameters[27].Value = model.Tel;
            parameters[28].Value = model.Email;
            parameters[29].Value = model.Address;
            parameters[30].Value = model.FMID;
            parameters[31].Value = model.Country;
            parameters[32].Value = model.NAgencyCode;
            parameters[33].Value = model.RegistAgency;
            parameters[34].Value = model.FHState;
            parameters[35].Value = model.ValidTime;
            parameters[36].Value = model.Alipay;
            parameters[37].Value = model.WeChat;
            parameters[38].Value = model.QRCode;


            Hashtable MyHs = new Hashtable();

            MyHs.Add(strSql, parameters);
            if (model.MConfig != null)
            {
                MemberConfig.Insert(model.MConfig, MyHs);
            }
            return(DAL.CommonBase.RunHashtable(MyHs));
        }