private void bindData()
    {
        string[] genders = new string[] { "M", "F" };
        this.ddlGender.DataSource = genders;
        this.ddlGender.DataBind();

        BLL.SystemUser user = base.CurrentUser;
        this.txtRealName.Text   = user.RealName;
        this.txtPhone.Text      = user.Phone;
        this.txtMobile.Text     = user.Mobile;
        this.txtEmail.Text      = user.Email;
        ddlGender.Text          = user.Gender;
        this.txtPageCount.Text  = user.PageCount.ToString();
        this.txtColumn.Text     = user.CaseDisplayColumn.ToString();
        this.txtPromisdate.Text = user.AlertDays.ToString();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string userName = txtUser.Text.Trim();
        string password = txtPass.Text.Trim();

        if (BLL.AdminBLL.Login(userName, password))
        {
            BLL.SystemUser user = Session["CurrentUser"] as BLL.SystemUser;
            var            bean = WebBeanUse.GetInstance();
            bean.Account = user.ID;
            FormsAuthentication.SetAuthCookie(userName, false);
            Response.Redirect("default.aspx");
            // FormsAuthentication.RedirectFromLoginPage("userName",false);
        }
        else
        {
            this.Msg.InnerHtml = Common.StrTable.GetStr("loginerror");
        }
    }
Beispiel #3
0
    private void bindData()
    {
        bindList();
        if (UserID != string.Empty)
        {
            BLL.SystemUser user = BLL.AdminBLL.GetUserByID(UserID);

            this.txtUserName.Text = user.UserName;
            this.txtPassword.Attributes.Add("value", user.Password);
            this.txtRealName.Text = user.RealName;
            this.txtPhone.Text    = user.Phone;
            this.txtMobile.Text   = user.Mobile;
            this.txtEmail.Text    = user.Email;
            string roleid = user.RoleID;


            checkDropDownlistSelected(ddlGender, user.Gender);
            FillCompanyDiv();
        }
    }
Beispiel #4
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        BLL.SystemUser user = new BLL.SystemUser();
        user.ID = UserID;
        string usr = this.txtUserName.Text.Trim();

        user.UserName = usr;
        user.Password = this.txtPassword.Text.Trim();
        user.RealName = this.txtRealName.Text.Trim();
        user.Phone    = this.txtPhone.Text.Trim();
        user.Mobile   = this.txtMobile.Text.Trim();
        user.Email    = this.txtEmail.Text.Trim();
        if (usr == "Super1" || usr == "Super2" || usr == "Super3")
        {
            user.RoleID = "1";
        }
        else
        {
            user.RoleID = "3"; //业务人员
        }
        user.Gender = this.ddlGender.Text;


        int rtn = BLL.AdminBLL.UpdateUser(user);

        if (rtn == 1)
        {
            string script = string.Format("window.location.href='{0}';", returnUrl);
            base.ExceuteScript(script);
        }
        else
        {
            string script = @"window.alert(""{0} {1}"")";
            script = string.Format(script, Common.StrTable.GetStr("userName"), Common.StrTable.GetStr("exist"));
            base.ExceuteScript(script);
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        BLL.SystemUser user = base.CurrentUser;


        int current;

        if (this.txtPageCount.Text.Trim() == "")
        {
            base.ExceuteScript("alert('请输入5到1000之间的数据')");
            return;
        }
        try
        {
            current = int.Parse(this.txtPageCount.Text.Trim());
            if (current < 5 || current > 10000)
            {
                base.ExceuteScript("alert('请输入5到10000之间的数据')");
                return;
            }
            user.PageCount = current;
        }
        catch
        {
            base.ExceuteScript("alert('请输入5到1000之间的数据')");
            return;
        }

        if (this.txtColumn.Text.Trim() == "")
        {
            Alert("input110");
            return;
        }
        try
        {
            current = int.Parse(this.txtColumn.Text.Trim());
            if (current < 1 || current > 10)
            {
                Alert("input110");
                return;
            }
            user.CaseDisplayColumn = current;
        }
        catch
        {
            Alert("input110");
            return;
        }


        try
        {
            current = int.Parse(this.txtPromisdate.Text.Trim());
            if (current < 1 || current > 30)
            {
                base.ExceuteScript("alert('请输入0到30之间的数据')");
                return;
            }
            user.AlertDays = current;
        }
        catch
        {
            base.ExceuteScript("alert('请输入0到30之间的数据')");
            return;
        }

        user.RealName = this.txtRealName.Text.Trim();
        user.Phone    = this.txtPhone.Text.Trim();
        user.Mobile   = this.txtMobile.Text.Trim();
        user.Email    = this.txtEmail.Text.Trim();


        user.Gender = this.ddlGender.Text;

        BLL.AdminBLL.UpdateCurrentUser(user);

        Alert("saveSuccess");
    }