예제 #1
0
        public bool RegAccount(LoginInfo reg)
        {
            AccountInfoVO info = new AccountInfoVO();
            info.Email = reg.UserName;
            info.LastLoginDate = DateTime.Now;
            info.NickName = reg.UserName;
            info.UserPwd = DN.Framework.Utility.EncryptHelper.GetMd5(reg.UserPwd);
            info.RegDate = DateTime.Now;
            info.RegIp = DN.Framework.Utility.ClientHelper.ClientIP();
            info.UserName = reg.UserName;

            return AccountInfoBLL.Instance.Add(info);
        }
예제 #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            AccountInfoVO info = new AccountInfoVO();

            info.AccountType      = 0;
            info.ConsumptionMoney = 0;
            info.Email            = txtEmail.Value;
            info.LastLoginDate    = DateTime.Now;
            info.LastMoneyDate    = DateTime.Now;
            info.Money            = 0;
            info.MoneyCount       = 0;
            info.MoneyFree        = 0;
            info.NickName         = txtUserName.Value;
            info.Phone            = txtPhone.Value;
            info.RegDate          = DateTime.Now;
            info.RegIp            = DN.Framework.Utility.ClientHelper.ClientIP();
            info.UserImg          = "";
            info.UserName         = txtUserName.Value;
            info.UserType         = int.Parse(ddlUserType.SelectedValue);
            info.UserPwd          = DN.Framework.Utility.EncryptHelper.GetMd5(txtPwd.Value);
            info.IsLock           = chkIsLock.Checked ? 1 : 0;

            AccountInfoPara ap = new AccountInfoPara();

            ap.UserName = info.UserName;

            var list = AccountInfoBLL.Instance.GetModels(ap);

            if (list.Count == 0)
            {
                AccountInfoBLL.Instance.Add(info);
                Response.Redirect("/Admin/Users/UserList.aspx");
            }
            else
            {
                lblMsg.Text = "【登录名称】登录名称己经存在,请重新输入。";
            }
        }
예제 #3
0
        public override bool Edit(AccountInfoVO m)
        {
            CodeCommand command = new CodeCommand();

            command.CommandText = EDIT;

            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@UserName", Value = ParameterHelper.ConvertValue(m.UserName)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@NickName", Value = ParameterHelper.ConvertValue(m.NickName)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Email", Value = ParameterHelper.ConvertValue(m.Email)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Phone", Value = ParameterHelper.ConvertValue(m.Phone)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@UserType", Value = ParameterHelper.ConvertValue(m.UserType)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@UserPwd", Value = ParameterHelper.ConvertValue(m.UserPwd)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@UserImg", Value = ParameterHelper.ConvertValue(m.UserImg)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@RegDate", Value = ParameterHelper.ConvertValue(m.RegDate)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@RegIp", Value = ParameterHelper.ConvertValue(m.RegIp)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@IsLock", Value = ParameterHelper.ConvertValue(m.IsLock)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@LastLoginDate", Value = ParameterHelper.ConvertValue(m.LastLoginDate)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@AccountType", Value = ParameterHelper.ConvertValue(m.AccountType)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@OpenId", Value = ParameterHelper.ConvertValue(m.OpenId)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@ConsumptionMoney", Value = ParameterHelper.ConvertValue(m.ConsumptionMoney)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Money", Value = ParameterHelper.ConvertValue(m.Money)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@MoneyFree", Value = ParameterHelper.ConvertValue(m.MoneyFree)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@MoneyCount", Value = ParameterHelper.ConvertValue(m.MoneyCount)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@LastMoneyDate", Value = ParameterHelper.ConvertValue(m.LastMoneyDate)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Id", Value = ParameterHelper.ConvertValue(m.Id)
            });


            int result = DbProxyFactory.Instance.Proxy.ExecuteNonQuery(command);

            if (result >= 1)
            {
                return(true);
            }

            return(false);
        }
예제 #4
0
        public override int InsertIdentityId(AccountInfoVO m)
        {
            CodeCommand command = new CodeCommand();

            command.CommandText = INSERT + "; select @@Identity";

            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@UserName", Value = ParameterHelper.ConvertValue(m.UserName)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@NickName", Value = ParameterHelper.ConvertValue(m.NickName)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Email", Value = ParameterHelper.ConvertValue(m.Email)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Phone", Value = ParameterHelper.ConvertValue(m.Phone)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@UserType", Value = ParameterHelper.ConvertValue(m.UserType)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@UserPwd", Value = ParameterHelper.ConvertValue(m.UserPwd)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@UserImg", Value = ParameterHelper.ConvertValue(m.UserImg)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@RegDate", Value = ParameterHelper.ConvertValue(m.RegDate)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@RegIp", Value = ParameterHelper.ConvertValue(m.RegIp)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@IsLock", Value = ParameterHelper.ConvertValue(m.IsLock)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@LastLoginDate", Value = ParameterHelper.ConvertValue(m.LastLoginDate)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@AccountType", Value = ParameterHelper.ConvertValue(m.AccountType)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@OpenId", Value = ParameterHelper.ConvertValue(m.OpenId)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@ConsumptionMoney", Value = ParameterHelper.ConvertValue(m.ConsumptionMoney)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Money", Value = ParameterHelper.ConvertValue(m.Money)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@MoneyFree", Value = ParameterHelper.ConvertValue(m.MoneyFree)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@MoneyCount", Value = ParameterHelper.ConvertValue(m.MoneyCount)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@LastMoneyDate", Value = ParameterHelper.ConvertValue(m.LastMoneyDate)
            });


            var result = DbProxyFactory.Instance.Proxy.ExecuteScalar(command);

            return(int.Parse(result.ToString()));
        }
예제 #5
0
 public override string GetOtherConditionByModel(AccountInfoVO m)
 {
     return("");
 }
예제 #6
0
 public override string GetOrderByModel(AccountInfoVO m)
 {
     return("");
 }