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);
            }
        }
Exemple #3
0
        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;
                }
            }
        }
Exemple #5
0
 partial void DeletePhanQuyen(PhanQuyen instance);
Exemple #6
0
 partial void UpdatePhanQuyen(PhanQuyen instance);
Exemple #7
0
 partial void InsertPhanQuyen(PhanQuyen instance);