Esempio n. 1
0
 public Account.UserRegistration getUser()
 {
     try
     {
         Account.UserRegistration          obj = new Account.UserRegistration();
         DataGridViewSelectedRowCollection row = gridUserMaster.SelectedRows;
         if (row.Count > 0)
         {
             user = user.getUser(Convert.ToInt32(row[0].Cells["UserId"].Value));
             obj.txtUserName.Text  = user.UserName;
             obj.cmbRole           = user.RoleId;
             obj.txtFirstName.Text = user.FirstName;
             obj.txtLastName.Text  = user.LastName;
             obj.txtEmailId.Text   = user.EmailId;
             obj.txtMobileNo.Text  = user.MobileNo;
             return(obj);
         }
         else
         {
             return(new Account.UserRegistration());
         }
     }
     catch (Exception ex)
     {
         Common.showDenger(ex.Message);
         return(null);
     }
 }
Esempio n. 2
0
 private void btnEditUser_Click(object sender, EventArgs e)
 {
     try
     {
         Account.UserRegistration objForm = getUser();
         btn             = objForm.btnSave;
         objForm.btnSave = Common.setUpdate(btn);
         objForm.ShowDialog();
         onPageLoad();
     }
     catch (Exception ex)
     {
         Common.showDenger(ex.Message);
     }
 }
 private void btnNewUser_Click(object sender, EventArgs e)
 {
     Account.UserRegistration objForm = new Account.UserRegistration();
     objForm.ShowDialog();
     onPageLoad();
 }