public EditUser(DAL.spUser _user, string Conn) { InitializeComponent(); if (string.IsNullOrEmpty(Conn)) throw new ArgumentNullException("connection"); connection = Conn; de = new DataEntry(connection); db = new SBPayrollDBEntities(connection); rep = new Repository(connection); user = _user; }
private void btnEdit_Click(object sender, EventArgs e) { if (dataGridViewUsers.SelectedRows.Count != 0) { try { DAL.spUser user = (DAL.spUser)bindingSourceUsers.Current; Forms.EditUser f = new Forms.EditUser(user, connection) { Owner = this }; f.Text = user.UserName.ToString().Trim().ToUpper(); f.ShowDialog(); } catch (Exception ex) { Utils.ShowError(ex); } } }
public void UpdateUser(DAL.spUser user, string password, int roleid, bool locked) { rep.UpdateUser(user, password, roleid, locked); }