Beispiel #1
0
 private void ChangePassWord()
 {
     String pw1 = textBoxPw1.Text;
     String pw2 = textBoxPw2.Text;
     if (String.IsNullOrEmpty(pw1))
     {
         labelMessage.Text = "请输入密码";
     }
     else
     {
         if (String.IsNullOrEmpty(pw2))
         {
             labelMessage.Text = "请输入确认密码";
         }
         else
         {
             if (!pw1.Equals(pw2))
             {
                 labelMessage.Text = "两次输入的密码不一致";
             }
             else
             {
                 UserAction action=new UserAction();
                 action.ChangePassword(UserInformationContext.ID,pw1);
                 MessageHelper.ShowInformationNotify(this,"密码修改完成");
                 Close();
             }
         }
     }
 }
Beispiel #2
0
 private void Add()
 {
     HandlingResult result = ValidateBeforeSave();
     if (result.Successed)
     {
         UserModel model = (UserModel) result.Result;
         _action=new UserAction();
         result= _action.Add(model);
         if (result.Successed)
         {
             MessageHelper.ShowInformationNotify(this, result.Message);
         }
         else
         {
             MessageHelper.ShowErrorNotify(this, result.Message);
         }
     }
     else
     {
         MessageHelper.ShowErrorNotify(this,result.Message);
     }
 }
Beispiel #3
0
 private void dataGridViewList_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     //TODO del
     try
     {
         DataRowView drv = (DataRowView)dataGridViewList.CurrentRow.DataBoundItem;
         DataRow dr = drv.Row;
         DialogResult result= MessageBox.Show(String.Format("确认删除[{0}]?", dr["LoginName"]), "提示", MessageBoxButtons.YesNo);
         if (result == DialogResult.Yes)
         {
             _action=new UserAction();
             _action.Delete(Guid.Parse(dr["ID"].ToString()));
         }
     }
     catch (Exception ex)
     {
         _log.Error(ex);
     }
 }