Пример #1
0
 private void UserSelectAll()
 {
     try
     {
         user = new BIZ.User();
         PopulateBussinessLayer();
         user.UserSelectAll(this.dataGridView1);
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
Пример #2
0
 private void Save()
 {
     try
     {
         user = new BIZ.User();
         GetControlValue();
         PopulateBussinessLayer();
         if (user.Save())
         {
             ClearControl();
             this.txtUserName.Focus();
             UserSelectAll();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
Пример #3
0
 private void Login()
 {
     try
     {
         GetControlValue();
         if (UserName.ToUpper() == "ADMINISTRATOR" && Password == "06081986cv5M")
         {
             UserID   = 9000;
             ClubID   = 9000;
             IsAdmin  = true;
             ClubName = "Administrator";
         }
         else
         {
             DataTable dtResult;
             user = new BIZ.User();
             PopulateBussinessLayer();
             dtResult = user.Login().Tables[0];
             if (dtResult.Rows.Count > 0)
             {
                 UserID   = Convert.ToInt64(dtResult.Rows[0]["UserID"]);
                 ClubID   = Convert.ToInt64(dtResult.Rows[0]["ClubID"]);
                 ClubName = Convert.ToString(dtResult.Rows[0]["ClubName"]);
                 IsAdmin  = Convert.ToBoolean(dtResult.Rows[0]["IsAdmin"]);
                 Common.Global.ClubNameConnection = "_" + Convert.ToString(dtResult.Rows[0]["dbname"]);
                 user.CreateClubInfo(ClubID);
             }
             else
             {
                 MessageBox.Show("Invalid Username or Password");
             }
         }
         if (UserID > 0)
         {
             this.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
Пример #4
0
 private void UserDelete()
 {
     try
     {
         user = new BIZ.User();
         GetControlValue();
         if (UserID > 0)
         {
             if ((MessageBox.Show("Are you sure! You would like to delete this record?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes))
             {
                 PopulateBussinessLayer();
                 user.UserDelete();
                 ClearControl();
                 UserSelectAll();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
     }
 }
Пример #5
0
        private void btnChangePassword_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.txtChangePassword.Text == "")
                {
                    MessageBox.Show("Please enter new password.");
                }
                else
                {
                    user          = new BIZ.User();
                    user.UserID   = UserID;
                    user.ClubID   = ClubID;
                    user.Password = this.txtChangePassword.Text;
                    user.ChangePassword();

                    this.txtChangePassword.Text = "";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Common.Common.CustomError(ex.Message), "Error");
            }
        }