private void refresh() { BLL.tb_user u = new BLL.tb_user(); List <BLL.tb_user> l = u.LoadAllUsers(); dgUserList.DataSource = l; }
private void frmUserPanel_Load(object sender, EventArgs e) { BLL.tb_user u = new BLL.tb_user(); List <BLL.tb_user> l = u.LoadAllUsers(); dgUserList.DataSource = l; }
public void ActivateUser(int id) { try { tb_user u = dc.tb_users.Single(us => us.user_id == id); u.isActive = true; dc.SubmitChanges(); } catch (Exception ex) { throw ex; } }
private void btnRemoveUser_Click(object sender, EventArgs e) { int id = Convert.ToInt32(dgUserList.SelectedRows[0].Cells[0].Value); BLL.tb_user u = new BLL.tb_user(); try{ u.DisableUser(id); }catch (Exception ex) { MessageBox.Show(ex.Message); } MessageBox.Show("Updated"); refresh(); }
public bool SaveUser(tb_user user) { bool saved = false; try { dc.tb_users.InsertOnSubmit(user); dc.SubmitChanges(); } catch (Exception en) { throw en; } return(saved); }
public int isAuthorised(string number) { BLL.tb_user u = new BLL.tb_user(); List <BLL.tb_user> l = u.LoadActiveUserByMobileNumber(number); if (l.Count > 0) { return(l[0].user_id); } else { return(0); } }
private void btnAddUser_Click(object sender, EventArgs e) { try{ BLL.tb_user u = new BLL.tb_user(); u.name = txtUsername.Text.Trim(); u.section = txtSection.Text; u.mobile_number = txtMobileNumber.Text; u.isActive = cbIsActive.Checked; u.SaveUser(u); SendMessagetoUser(welcomemsg, txtMobileNumber.Text); MessageBox.Show("User created.."); }catch (Exception ex) { MessageBox.Show(ex.Message); } }
partial void Deletetb_user(tb_user instance);
partial void Updatetb_user(tb_user instance);
partial void Inserttb_user(tb_user instance);