Пример #1
0
        private void btnAccountManagerSave_Click(object sender, EventArgs e)
        {
            LoginBLL lg     = new LoginBLL();
            DicBLL   dic    = new DicBLL();
            string   email  = txtAccountManagerEmail.Text;
            string   name   = txtname.Text;
            int      auth   = int.Parse(cboAccountManagerType.SelectedValue.ToString());
            bool     ad     = false;
            bool     active = false;

            if (checkboxActive.Checked == true)
            {
                active = true;
            }
            if (auth == 1)
            {
                ad = true;
            }

            if (idAc == "")
            {
                if (lg.isvaildEmail(email) == true)
                {
                    if (at.AddAccount(email, name, ad, active) == true)
                    {
                        MessageBox.Show(dic.successAccountMessage("add"));
                        clear();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show(dic.errorAccountMessage("else"));
                    }
                }
                else
                {
                    MessageBox.Show(dic.errorAccountMessage("sai email"));
                }
            }
            else
            {
                if (lg.isvaildEmail(email) == true)
                {
                    if (at.EditAccount(idAc, email, name, ad, active) == true)
                    {
                        MessageBox.Show(dic.successAccountMessage("edit"));
                        clear();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show(dic.errorAccountMessage("else"));
                    }
                }
                else
                {
                    MessageBox.Show(dic.errorAccountMessage("sai email"));
                }
            }
        }
Пример #2
0
        public bool EditAccountTest(
            [PexAssumeUnderTest] AccountBLL target,
            string id,
            string user,
            string name,
            bool isadmin,
            bool active
            )
        {
            bool result = target.EditAccount(id, user, name, isadmin, active);

            return(result);
            // TODO: add assertions to method AccountBLLTest.EditAccountTest(AccountBLL, String, String, String, Boolean, Boolean)
        }
Пример #3
0
        public JsonResult AccountEdit(string Id, string title, string contents)
        {
            JsonResult js = new JsonResult();

            Account loginAccount = membership.GetUser();

            //未登录
            if (loginAccount == null)
            {
                js.Data = "false";
                return(js);
            }
            Account picOld = accountBll.GetAccountById(Guid.Parse(Id));

            picOld.Mobile   = title;
            picOld.Password = contents;

            accountBll.EditAccount();

            js.Data = "true";
            return(js);
        }