Example #1
0
        protected void BtnUserSave_Click(object sender, EventArgs e)
        {
            ENTITY.CusUsers u1 = new ENTITY.CusUsers();
            u1.Customername = txtU_Name.Value.ToString();
            u1.customerpwd  = Common.EncryptString.encryptMD5(txtU_PassW.Value.Trim()).ToUpper();
            u1.Realname     = txtRealName.Value.ToString();
            u1.CustomerSfz  = txtSfz.Value.ToString();
            u1.address      = txtAddress.Value.ToString();
            u1.telphone     = txtTel.Value.ToString();
            u1.IsCusAdmin   = 1;
            u1.CusType      = 0;


            if (!BLL.bllCusUsers.Vld_UserName(ref u1))
            {
                if (BLL.bllCusUsers.AddUsersInfo(u1))
                {
                    Common.ShowMessage.Show(Page, "Suess", "用户注册成功..");
                }
                else
                {
                    Common.ShowMessage.Show(Page, "error", "用户注册失败..");
                }
            }
            else
            {
                Common.ShowMessage.Show(Page, "error", "此用户名已经被占用..");
            }
        }
 private void LoadData()
 {
     if (!string.IsNullOrEmpty(Common.GetMes.GetRequestQuery(Request, "usersid")))
     {
         ENTITY.CusUsers user1 = BLL.bllCusUsers.getSomeUserInfo(Convert.ToInt32(Common.GetMes.GetRequestQuery(Request, "usersid")));
         txtU_Name.Value = user1.Customername;
     }
 }
 private void LoadData()
 {
     if (!string.IsNullOrEmpty(Common.GetMes.GetRequestQuery(Request, "usersid")))
     {
         ENTITY.CusUsers user1 = BLL.bllCusUsers.getSomeUserInfo(Convert.ToInt32(Common.GetMes.GetRequestQuery(Request, "usersid")));
         txtU_Name.Value   = user1.Customername;
         txtRealName.Value = user1.Realname;
         txtSfz.Value      = user1.CustomerSfz;
         txtAddress.Value  = user1.address;
         txtTel.Value      = user1.telphone;
     }
 }
        protected void BtnUserSave_Click(object sender, EventArgs e)
        {
            ENTITY.CusUsers u1 = new ENTITY.CusUsers();
            u1.Customername = txtU_Name.Value.ToString();
            u1.customerpwd  = Common.EncryptString.encryptMD5(txtU_PassW.Value.Trim()).ToUpper();
            u1.Realname     = "";
            u1.CustomerSfz  = "";
            u1.address      = "";
            u1.telphone     = "";
            u1.IsCusAdmin   = 0;
            u1.CusType      = 0;

            if (!string.IsNullOrEmpty(Common.GetMes.GetRequestQuery(Request, "usersid")))
            {
                u1.customerid = int.Parse(Request["usersid"]);
                if (BLL.bllCusUsers.EditUsersInfo(u1))
                {
                    Common.ShowMessage.myScriptMes(Page, "Suess", "if(confirm(\"信息修改成功,是否继续修改?否则返回信息列表。\")) {location.href=\"M_AddUsersInfo.aspx?usersid=" + int.Parse(Request["usersid"]) + "\"} else  {location.href=\"M_UsersList.aspx\"} ");
                }
                else
                {
                    Common.ShowMessage.Show(Page, "error", "信息修改失败,请重试或联系管理人员..");
                }
            }
            else
            {
                if (!BLL.bllCusUsers.Vld_UserName(ref u1))
                {
                    if (BLL.bllCusUsers.AddUsersInfo(u1))
                    {
                        Common.ShowMessage.myScriptMes(Page, "Suess", "if(confirm(\"信息添加成功,是否继续添加?否则返回信息列表。\")) {location.href=\"M_AddUsersInfo.aspx\"} else  {location.href=\"M_UsersList.aspx\"} ");
                    }
                    else
                    {
                        Common.ShowMessage.Show(Page, "error", "信息添加失败,请重试或联系管理人员..");
                    }
                }
                else
                {
                    Common.ShowMessage.Show(Page, "error", "此管理员名已经被占用..");
                }
            }
        }
        protected void BtnUserSave_Click(object sender, EventArgs e)
        {
            ENTITY.CusUsers u1 = BLL.bllCusUsers.getSomeUserInfo(int.Parse(Request["usersid"]));
            u1.Customername = txtU_Name.Value.ToString();
            if (Request["eables"] != null)
            {
                u1.customerpwd = u1.customerpwd;
            }
            else
            {
                u1.customerpwd = Common.EncryptString.encryptMD5(txtU_PassW.Value.Trim()).ToUpper();
            }
            u1.Realname    = txtRealName.Value.ToString();
            u1.CustomerSfz = txtSfz.Value.ToString();
            u1.address     = txtAddress.Value.ToString();
            u1.telphone    = txtTel.Value.ToString();
            u1.IsCusAdmin  = 1;
            u1.CusType     = 0;

            if (!string.IsNullOrEmpty(Common.GetMes.GetRequestQuery(Request, "usersid")))
            {
                u1.customerid = int.Parse(Request["usersid"]);
                if (BLL.bllCusUsers.EditUsersInfo(u1))
                {
                    if (Request["eables"] != null)
                    {
                        Common.ShowMessage.Show(Page, "Suess", "信息修改成功..");
                    }
                    else
                    {
                        Common.ShowMessage.myScriptMes(Page, "Suess", "if(confirm(\"信息修改成功,是否继续修改?否则返回信息列表。\")) {location.href=\"M_EditCusInfo.aspx?usersid=" + int.Parse(Request["usersid"]) + "\"} else  {location.href=\"M_CusList.aspx\"} ");
                    }
                }
                else
                {
                    Common.ShowMessage.Show(Page, "error", "信息修改失败,请重试或联系管理人员..");
                }
            }
        }
Example #6
0
        protected void BtnLogin_Click(object sender, EventArgs e)
        {
            if (CheckNull())
            {
                string uID    = txtU_Name.Value.Trim();
                string pwdMd5 = Common.EncryptString.encryptMD5(txtU_Pass.Value.ToString()).ToUpper();

                int             isadmincus = int.Parse(rblcustype.SelectedValue.Trim());
                ENTITY.CusUsers userlogin  = new ENTITY.CusUsers(uID, pwdMd5, isadmincus);
                string          checkCode  = Session["CheckCode"].ToString().ToUpper();
                if (txtU_Check.Value.Trim().ToUpper() != checkCode)
                {
                    Common.ShowMessage.Show(Page, "Error1", "验证密码有误,请重新登录...", "M_UserLogin.aspx");
                }
                else
                {
                    bool success = BLL.bllCusUsers.ulogin(ref userlogin);
                    Session["Customername"] = uID;
                    Session["IsCusAdmin"]   = isadmincus.ToString();


                    if (success && (Session["Customername"] != null) && Session["IsCusAdmin"].ToString() == "0")
                    {
                        Response.Redirect("AdminIndex.aspx");
                    }
                    else if (success && (Session["Customername"] != null) && Session["IsCusAdmin"].ToString() == "1")
                    {
                        Response.Redirect("CusIndex.aspx");
                    }
                    else
                    {
                        Common.ShowMessage.Show(Page, "Error1", "帐号和密码输入不匹配,请重新登录..." + pwdMd5, "M_UserLogin.aspx");
                    }
                }
            }
        }
Example #7
0
 public static bool AddUsersInfo(ENTITY.CusUsers u1)
 {
     return(DAL.dalCusUsers.AddUsersInfo(u1));
 }
Example #8
0
 public static bool Vld_UserName(ref ENTITY.CusUsers userlogin)
 {
     return(DAL.dalCusUsers.Vld_UserName(userlogin));
 }
Example #9
0
 public static bool ulogin(ref ENTITY.CusUsers userlogin)
 {
     return(DAL.dalCusUsers.ulogin(userlogin));
 }