//Cập nhật lại quyền public bool UpdateRole(string pIdGroupUs, string pIdScreen, string pRole) { try { dc = new DbSpaDataContext(); GrandRight gr = dc.GrandRights.Where(t => t.IDGROUPUSER == Convert.ToInt32(pIdGroupUs) && t.IDSCREEN == pIdScreen).FirstOrDefault(); gr.ROLE = Convert.ToInt32(pRole); dc.SubmitChanges(); return(true); } catch { return(false); } }
//Thêm quyen public bool InsertRole(string pIdGroupUs, string pIdScreen, string pRole) { try { dc = new DbSpaDataContext(); GrandRight gr = new GrandRight(); gr.IDGROUPUSER = Convert.ToInt32(pIdGroupUs); gr.IDSCREEN = pIdScreen; gr.ROLE = Convert.ToInt32(pRole); dc.GrandRights.InsertOnSubmit(gr); dc.SubmitChanges(); return(true); } catch { return(false); } }