예제 #1
0
파일: Login.cs 프로젝트: AikoArgel/Template
 private void Log_in()
 {
     try
     {
         if (Txt_User.Text.Length <= 0 || Txt_Password.Text.Length <= 0)
         {
             throw new Exception("Any field is empty");
         }
         RetriveServicesUsers_ = new RetriveServicesUsers();
         var User = RetriveServicesUsers_.GetUserLogin(Txt_User.Text, Txt_Password.Text);
         UserName = User.UserName;
         Hide();
         Home_ = new Home();
         Home_.ShowDialog();
         Clean();
         Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally
     {
         RetriveServicesUsers_ = null;
     }
 }
예제 #2
0
파일: Home.cs 프로젝트: AikoArgel/Template
 private void SetDataGridView()
 {
     ListUsers_ = null;
     Dgv_Users.Rows.Clear();
     try
     {
         Dgv_Users.ColumnCount     = 6;
         Dgv_Users.Columns[0].Name = "User ID";
         Dgv_Users.Columns[1].Name = "UserName";
         Dgv_Users.Columns[2].Name = "Password";
         Dgv_Users.Columns[3].Name = "Email";
         Dgv_Users.Columns[4].Name = "LastUpdated";
         Dgv_Users.Columns[5].Name = "Available";
         RetriveServicesUsers_     = new RetriveServicesUsers();
         ListUsers_ = RetriveServicesUsers_.GetAllUsers();
         foreach (var list in ListUsers_)
         {
             Dgv_Users.Rows.Add(list.UserID, list.UserName, list.Password, list.Email, list.LastUpdated, list.Available);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally
     {
         RetriveServicesUsers_ = null;
         ListUsers_            = null;
     }
 }
예제 #3
0
 private void Forgot_Login()
 {
     try
     {
         Users_ = new Users();
         RetriveServicesUsers_ = new RetriveServicesUsers();
         Users_ = RetriveServicesUsers_.GetUserByEmail(Txt_Email.Text);
         if (Users_ == null)
         {
             throw new Exception("This Email not exist");
         }
         GBox_NewPassword.Enabled = true;
         GBox_Email.Enabled       = false;
         MessageBox.Show("Save your new password");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally
     {
         RetriveServicesUsers_ = null;
         Txt_Email.Text        = "";
     }
 }
예제 #4
0
 private void SetDataGridView()
 {
     try
     {
         RetriveServicesUsers_ = new RetriveServicesUsers();
         ListUsers_            = RetriveServicesUsers_.GetAllUsers();
         foreach (var list in ListUsers_)
         {
             Dgv_Users.Rows.Add(list.UserID, list.UserName, list.Password, list.Email, list.LastUpdated, list.Available);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally
     {
         RetriveServicesUsers_ = null;
         ListUsers_            = null;
     }
 }