Exemple #1
0
 private void buttonLogin_Click(object sender, EventArgs e)
 {
     ((Button)sender).Enabled = false;
     ((Button)sender).Text = "בבדיקה...";
     if (_tries == 3)
         return;
     
     try
     {
         _user = (from c in Db.Table_Users
                 where (c.UserName == textBoxUserName.Text && c.Password == textBoxPassword.Text)
                 select c).Single();
         _role = (from c in Db.Table_LookupRoles
                  where _user.RoleId == c.RoleId
                  select c).Single();
         _currentUser = _user.FirstName + _user.LastName;
         _currentRoleId = _role.RoleId;
         ActivateAdminForm();
     }
     catch (Exception ex)
     {
         MessageBox.Show("שם משתמש ו/או סיסמה שגויים");
         ((Button)sender).Enabled = true;
         ((Button)sender).Text = "כניסה";
         _tries++;
     }
 }
 private void detach_Table_LookupRoles(Table_LookupRole entity)
 {
     this.SendPropertyChanging();
     entity.Table_User = null;
 }
 partial void UpdateTable_LookupRole(Table_LookupRole instance);
 partial void DeleteTable_LookupRole(Table_LookupRole instance);
 partial void InsertTable_LookupRole(Table_LookupRole instance);