private void btnThoat_Click_1(object sender, EventArgs e) { this.Close(); QLNS fr = new QLNS(); fr.Show(); }
private void btnDangNhap_Click(object sender, EventArgs e) { if (username.Equals(txtTenDN.Text) && password.Equals(txtpassword.Text)) { MessageBox.Show("Thành công"); this.Hide(); QLNS fr = new QLNS(); fr.ShowDialog(); } else { MessageBox.Show("Vui lòng nhập lại"); txtpassword.Text = ""; txtTenDN.Text = ""; } }
public bool Add(QLNS.Data.TaiKhoan item) { try { MainDataContext context = new MainDataContext(ConnectionString); context.TaiKhoans.InsertOnSubmit(item); context.SubmitChanges(); context.Connection.Close(); return true; } catch (Exception) { return false; } }
public bool Delete(QLNS.Data.TaiKhoan item) { try { MainDataContext context = new MainDataContext(ConnectionString); var itemDelete = context.TaiKhoans.SingleOrDefault(p => p.ID == item.ID); if (itemDelete != null) { context.TaiKhoans.DeleteOnSubmit(itemDelete); } context.SubmitChanges(); context.Connection.Close(); return true; } catch (Exception) { return false; } }
public NhanVienController() { connect = new QLNS(); }
public NhanVienDAO() { db = new QLNS(); }
public PhongBanController() { connect = new QLNS(); }
public bool Update(QLNS.Data.TaiKhoan item) { try { MainDataContext context = new MainDataContext(ConnectionString); var itemUpdate = context.TaiKhoans.SingleOrDefault(p => p.ID == item.ID); if (itemUpdate != null) { itemUpdate.HoTen = item.HoTen; itemUpdate.MatKhau = item.MatKhau; itemUpdate.TrangThai = item.TrangThai; } context.SubmitChanges(); context.Connection.Close(); return true; } catch (Exception) { return false; } }
public ChucVuDAO() { db = new QLNS(); }
public BoPhanController() { connect = new QLNS(); }
public BoPhanDAO() { db = new QLNS(); }
public ChamCongDAO() { db = new QLNS(); }