public bool kiemtraphanquyenmanhinh(int mamanhinh, int manhomnv) { PhanQuyen pq = ql.PhanQuyens.Where(t => t.MaNhomNV == manhomnv && t.MaManHinh == mamanhinh).FirstOrDefault(); bool phanquyen = (bool)pq.CoQuyen; if (phanquyen) { return(true); } return(false); }
public void themMaManHinhVaoPhanQuyen(string mamanhinh) { var nhomtaikhoan = from ntk in db.NhomTaiKhoans select ntk; foreach (NhomTaiKhoan ntk in nhomtaikhoan) { PhanQuyen pq = new PhanQuyen(); pq.MaManHinh = mamanhinh; pq.MaNhomTaiKhoan = ntk.MaNhomTaiKhoan; pq.CoQuyen = false; db.PhanQuyens.InsertOnSubmit(pq); } }
public bool suaPhanQuyen(string manhomtaikhoan, string mamanhinh, string coquyen) { PhanQuyen pq = db.PhanQuyens.Where(a => a.MaNhomTaiKhoan == manhomtaikhoan && a.MaManHinh == mamanhinh).FirstOrDefault(); if (pq != null) { pq.CoQuyen = bool.Parse(coquyen); db.SubmitChanges(); MessageBox.Show("Sửa thành công."); return(true); } MessageBox.Show("Sửa không thành công."); return(false); }
public void xoaManHinhVaXoaTrongPhanQuyen(string mamanhinh) { var nhomtaikhoan = from ntk in db.NhomTaiKhoans select ntk; foreach (NhomTaiKhoan ntk in nhomtaikhoan) { PhanQuyen pq = db.PhanQuyens.Where(a => a.MaManHinh == mamanhinh && a.MaNhomTaiKhoan == ntk.MaNhomTaiKhoan).FirstOrDefault(); if (pq != null) { db.PhanQuyens.DeleteOnSubmit(pq); } else { continue; } } }
partial void DeletePhanQuyen(PhanQuyen instance);
partial void UpdatePhanQuyen(PhanQuyen instance);
partial void InsertPhanQuyen(PhanQuyen instance);