//public static DataTable GetUserRegion(string UserString, string LoginName) //{ // DataTable UserDataTable = null; // try // { // UserDataTable = UserRightsDAL.GetUserRegion(UserString, LoginName); // return UserDataTable; // } // catch (Exception ex) // { // throw ex; // } // finally // { // if (UserDataTable != null) // { // UserDataTable.Dispose(); // } // } //} //public static DataTable GetUserRegionNotAdded(string UserString, string LoginName) //{ // DataTable UserDataTable = null; // try // { // UserDataTable = UserRightsDAL.GetUserRegionNotAdded(UserString, LoginName); // return UserDataTable; // } // catch (Exception ex) // { // throw ex; // } // finally // { // if (UserDataTable != null) // { // UserDataTable.Dispose(); // } // } //} public static Int32 AddUserMapRef(string UserIDString, string MapIDString, string CreatedByString) { Int32 UserRegionID = 0; UserRegionID = UserRightsDAL.AddUserMapRef(UserIDString, MapIDString, CreatedByString); return(UserRegionID); }
/// <summary> /// To Bind Desig DropDown /// </summary> private void BindUser() { UserRightsDAL objUserRightsDAL = new UserRightsDAL(); if (Convert.ToString(Session["Userclass"]) == "Admin") { var objDesignRights = objUserRightsDAL.SelectUser(); objUserRightsDAL = null; ddlUser.DataSource = objDesignRights; ddlUser.DataTextField = "Emp_Name"; ddlUser.DataValueField = "user_idno"; ddlUser.DataBind(); ddlUser.Items.Insert(0, new ListItem("< Choose >", "0")); } else { var objDesignRights = objUserRightsDAL.SelectByAdminId(Convert.ToInt32(Session["UserIdno"])); objUserRightsDAL = null; ddlUser.DataSource = objDesignRights; ddlUser.DataTextField = "Emp_Name"; ddlUser.DataValueField = "user_idno"; ddlUser.DataBind(); ddlUser.Items.Insert(0, new ListItem("< Choose >", "0")); //ddlUser.SelectedValue = Convert.ToString(base.UserIdno); } }
public static Int32 DeleteMenuByRoleId(string RoleKeyString, string PageIDString, string ModifiedBy) { Int32 MenuID = 0; MenuID = UserRightsDAL.DeleteMenuByRoleId(RoleKeyString, PageIDString, ModifiedBy); return(MenuID); }
public static Int32 InsertMenu(string RoleKeyString, string PageIDString, string CreatedByString) { Int32 MenuID = 0; MenuID = UserRightsDAL.InsertMenu(RoleKeyString, PageIDString, CreatedByString); return(MenuID); }
/// <summary> /// To Bind Grid /// </summary> private void BindGrid() { UserRightsDAL objUserRightsDAL = new UserRightsDAL(); if (ddlType.SelectedItem.Text == "Form") { var lstGridData = objUserRightsDAL.SelectForGridTypeForm(Convert.ToInt32(ddlUser.SelectedValue)); objUserRightsDAL = null; grdMain.DataSource = lstGridData; grdMain.DataBind(); } else if (ddlType.SelectedItem.Text == "Menu") { var lstGridData = objUserRightsDAL.SelectForGridTypeMenu(Convert.ToInt32(ddlUser.SelectedValue)); objUserRightsDAL = null; grdMain.DataSource = lstGridData; grdMain.DataBind(); } else if (ddlType.SelectedItem.Text == "Report") { var lstGridData = objUserRightsDAL.SelectForGridTypeRep(Convert.ToInt32(ddlUser.SelectedValue)); objUserRightsDAL = null; grdMain.DataSource = lstGridData; grdMain.DataBind(); } int count = grdMain.Rows.Count; int RowCount = 0; foreach (GridViewRow row in grdMain.Rows) { CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect.Checked) { RowCount++; } } if (RowCount == count) { chkSelectAllRows.Checked = true; imgBtnSelectAllRows.ImageUrl = "~/Images/SelectAll_Active.png"; } else { chkSelectAllRows.Checked = false; imgBtnSelectAllRows.ImageUrl = "~/Images/SelectAll_Inactive.png"; } if (count > 0) { selectall.Visible = true; } else { selectall.Visible = false; } }
public static string[] GetUserRights(long UserID) { string[] objList = null; dTable = UserRightsDAL.GetUserRights(UserID); if (dTable.Rows.Count > 0) { objList = dTable.AsEnumerable().Select(row => row.Field <string>("MENUID")).ToArray(); } return(objList); }
/// <summary> /// Method to Get UserRights Entity /// </summary> /// <param name="argEn">UserRights Entity is an Input.</param> /// <returns>Returns UserRights Entity</returns> public UserRightsEn GetItem(UserRightsEn argEn) { try { UserRightsDAL loDs = new UserRightsDAL(); return(loDs.GetItem(argEn)); } catch (Exception ex) { throw ex; } }
/// <summary> /// Method to Get List of All UserRights by UserGroupID /// </summary> /// <param name="argEn">UserGroupID as an Input.</param> /// <returns>Returns List of UserRights</returns> public List <UserRightsEn> GetList(UserRightsEn argEn) { try { UserRightsDAL loDs = new UserRightsDAL(); return(loDs.GetList(argEn)); } catch (Exception ex) { throw ex; } }
/// <summary> /// Method to Get List of UserRights by GroupID /// </summary> /// <param name="UserGroupID">UserGroupID as an Input.</param> /// <returns>Returns List of UserRights</returns> public List <UserRightsEn> GetUserMenu(int UserGroupID) { try { UserRightsDAL loDs = new UserRightsDAL(); return(loDs.GetUserMenu(UserGroupID)); } catch (Exception ex) { throw ex; } }
/// <summary> /// Method to Get List of Menus By UserGroups /// </summary> /// <param name="MenuName">MenuName as Input.</param> /// <param name="UserGroupID">UserGroupID as Input.</param> /// <returns>Returns List of Menus</returns> public List <MenuMasterEn> GetMenuByUserGroup(string MenuName, int UserGroupID, string optional_params = "") { try { UserRightsDAL loDs = new UserRightsDAL(); return(loDs.GetMenuByUserGroup(MenuName, UserGroupID, optional_params)); } catch (Exception ex) { throw ex; } }
/// <summary> /// Method to Get List of Menus for Workflow Group /// </summary> /// <param name="MenuName">MenuName as Input.</param> /// <param name="UserGroupID">UserGroupID as Input.</param> /// <returns>Returns List of Menus</returns> public List <MenuMasterEn> GetMenuByWorkflowGroup(string MenuName, int UserGroupID, int UserID) { try { UserRightsDAL loDs = new UserRightsDAL(); return(loDs.GetMenuByWorkflowGroup(MenuName, UserGroupID, UserID)); } catch (Exception ex) { throw ex; } }
/// <summary> /// Date Created: 27/Nov/2012 /// Created By: Josephine Gad /// (description) Get Menu of users using list /// </summary> /// <param name="UserName"></param> /// <returns></returns> public static List <UserMenus> GetMenuListByUser(string UserName) { HttpContext.Current.Session["UserMenuList"] = null; List <UserMenus> menu = new List <UserMenus>(); List <UserMenuList> list = UserRightsDAL.GetMenuListByUser(UserName); menu = list[0].UserMenu; HttpContext.Current.Session["UserMenuList"] = menu; HttpContext.Current.Session["UserSubMenuList"] = list[0].UserSubMenu; return(menu); }
/// <summary> /// Method to Insert List of UserRights /// </summary> /// <param name="argEn">List of UserRights Entity is an Input.</param> /// <returns>Returns Boolean</returns> public bool InsertUserRights(List <UserRightsEn> argEn) { bool flag; using (TransactionScope ts = new TransactionScope()) { try { UserRightsDAL loDs = new UserRightsDAL(); flag = loDs.InsertUserRights(argEn); ts.Complete(); } catch (Exception ex) { throw ex; } } return(flag); }
public static DataTable GetSubMenuAll(string ParentIdInt) { DataTable ModuleDataTable = null; try { ModuleDataTable = UserRightsDAL.GetSubMenuAll(ParentIdInt); return(ModuleDataTable); } catch (Exception ex) { throw ex; } finally { if (ModuleDataTable != null) { ModuleDataTable.Dispose(); } } }
public static DataTable GetMenuNotAdded(string RoleKeyString) { DataTable ModuleDataTable = null; try { ModuleDataTable = UserRightsDAL.GetMenuNotAdded(RoleKeyString); return(ModuleDataTable); } catch (Exception ex) { throw ex; } finally { if (ModuleDataTable != null) { ModuleDataTable.Dispose(); } } }
/// <summary> /// Date Created: 27/08/2011 /// Created By: Josephine Gad /// (description) Get user module menu by user name /// </summary> public static DataTable GetMenuByUser(string UserName) { DataTable ModuleDataTable = null; try { ModuleDataTable = UserRightsDAL.GetMenuByUser(UserName); return(ModuleDataTable); } catch (Exception ex) { throw ex; } finally { if (ModuleDataTable != null) { ModuleDataTable.Dispose(); } } }
public static DataTable GetMenu(string RoleKeyString, bool ViewInactiveBool) { DataTable ModuleDataTable = null; try { ModuleDataTable = UserRightsDAL.GetMenu(RoleKeyString, ViewInactiveBool); return(ModuleDataTable); } catch (Exception ex) { throw ex; } finally { if (ModuleDataTable != null) { ModuleDataTable.Dispose(); } } }
public static bool Save(UserRightsList objList) { bool flgSave; try { using (TransactionScope objTScope = new TransactionScope(TransactionScopeOption.RequiresNew)) { UserRightsDAL.Delete(objList[0].UserID); foreach (UserRights objRight in objList) { UserRightsDAL.Save(objRight); } flgSave = true; objTScope.Complete(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(flgSave); }
/// <summary> /// Date Created: 11/Jan/2013 /// Created By: Josephine Gad /// (description) Save User Region /// </summary> /// <param name="dt"></param> /// <param name="sCreatedBy"></param> public static void SaveUserRegion(DataTable dt, string sCreatedBy, string strLogDescription, String strFunction, String strPageName) { UserRightsDAL.SaveUserRegion(dt, sCreatedBy, strLogDescription, strFunction, strPageName); }
public static void ActivateMenu(string MenuID, string ModifiedByString) { UserRightsDAL.ActivateMenu(MenuID, ModifiedByString); }
public static bool IsMenuExists(string RoleKeyString, string PageIDString) { return(UserRightsDAL.IsMenuExists(RoleKeyString, PageIDString)); }
public UserRightsHandler() { userRightDal = new UserRightsDAL(); }
public static string GetUserRoleKey(string RoleString) { return(UserRightsDAL.GetUserRoleKey(RoleString)); }
public static void DeleteMenu(string MenuID, string ModifiedByString) { UserRightsDAL.DeleteMenu(MenuID, ModifiedByString); }
/// <summary> /// Date Created: 11/Jan/2013 /// Created By: Josephine Gad /// (description) Get user's region and regions to be added /// </summary> public static void GetUserRegion(string UserString, string LoginName) { UserRightsDAL.GetUserRegion(UserString, LoginName); }
protected void grdMain_RowCommand(object sender, GridViewCommandEventArgs e) { Int32 empIdno = Convert.ToInt32((Session["UserIdno"] == null) ? "0" : Session["UserIdno"].ToString()); string strMsg = string.Empty; int intUserRghtsIdno = 0; UserRightsDAL objUserRightsDAL = new UserRightsDAL(); HiddenField hiduserId = (HiddenField)grdMain.Rows[0].FindControl("hiduserId"); int intUserIdno = Convert.ToInt32(hiduserId.Value); if (e.CommandName == "cmdAdd") { bool bAdd = false; string[] strAdd = Convert.ToString(e.CommandArgument).Split(new char[] { '_' }); if (strAdd.Length > 1) { intUserRghtsIdno = Convert.ToInt32(strAdd[0]); if (Convert.ToBoolean(strAdd[1]) == true) { bAdd = false; } else { bAdd = true; } int value = objUserRightsDAL.UpdateAdd(intUserRghtsIdno, bAdd, empIdno); objUserRightsDAL = null; if (value > 0) { this.BindGrid(); strMsg = "Record updated successfully."; } } } if (e.CommandName == "cmdEdit") { bool bEdit = false; string[] strEdit = Convert.ToString(e.CommandArgument).Split(new char[] { '_' }); if (strEdit.Length > 1) { intUserRghtsIdno = Convert.ToInt32(strEdit[0]); if (Convert.ToBoolean(strEdit[1]) == true) { bEdit = false; } else { bEdit = true; } int value = objUserRightsDAL.UpdateEdit(intUserRghtsIdno, bEdit, empIdno); objUserRightsDAL = null; if (value > 0) { this.BindGrid(); strMsg = "Record updated successfully."; } } } if (e.CommandName == "cmdView") { bool bView = false; string[] strView = Convert.ToString(e.CommandArgument).Split(new char[] { '_' }); if (strView.Length > 1) { intUserRghtsIdno = Convert.ToInt32(strView[0]); if (Convert.ToBoolean(strView[1]) == true) { bView = false; } else { bView = true; } int value = objUserRightsDAL.UpdateView(intUserRghtsIdno, bView, empIdno); objUserRightsDAL = null; if (value > 0) { this.BindGrid(); strMsg = "Record updated successfully."; } } } if (e.CommandName == "cmdDelete") { bool bDelete = false; string[] strDelete = Convert.ToString(e.CommandArgument).Split(new char[] { '_' }); if (strDelete.Length > 1) { intUserRghtsIdno = Convert.ToInt32(strDelete[0]); if (Convert.ToBoolean(strDelete[1]) == true) { bDelete = false; } else { bDelete = true; } int value = objUserRightsDAL.UpdateDelete(intUserRghtsIdno, bDelete, empIdno); objUserRightsDAL = null; if (value > 0) { this.BindGrid(); strMsg = "Record updated successfully."; } } } if (e.CommandName == "cmdPrint") { bool bPrint = false; string[] strPrint = Convert.ToString(e.CommandArgument).Split(new char[] { '_' }); if (strPrint.Length > 1) { intUserRghtsIdno = Convert.ToInt32(strPrint[0]); if (Convert.ToBoolean(strPrint[1]) == true) { bPrint = false; } else { bPrint = true; } int value = objUserRightsDAL.UpdatePrint(intUserRghtsIdno, bPrint, empIdno); objUserRightsDAL = null; if (value > 0) { this.BindGrid(); strMsg = "Record updated successfully."; } } } if (e.CommandName == "cmdSelectAll") { bool bAdd = false; bool bEdit = false; bool bView = false; bool bDelete = false; bool bPrint = false; string[] strAll = Convert.ToString(e.CommandArgument).Split(new char[] { '_' }); if (strAll.Length > 1) { intUserRghtsIdno = Convert.ToInt32(strAll[0]); int value = 0; GridViewRow row = (GridViewRow)(((Control)e.CommandSource).NamingContainer); CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect.Checked == true) { bAdd = true; bEdit = true; bView = true; bDelete = true; bPrint = true; } else if (chkSelect.Checked == false) { bAdd = false; bEdit = false; bView = false; bDelete = false; bPrint = false; } value = objUserRightsDAL.UpdateAll(intUserRghtsIdno, bAdd, bEdit, bView, bDelete, bPrint, empIdno); objUserRightsDAL = null; if (value > 0) { this.BindGrid(); strMsg = "Record updated successfully."; } } } this.BindGrid(); ScriptManager.RegisterStartupScript(this, this.GetType(), "alertstrMsg", "PassMessage('" + strMsg + "')", true); }
protected void imgBtnSelectAllRows_Click(object sender, ImageClickEventArgs e) { Int32 empIdno = Convert.ToInt32((Session["UserIdno"] == null) ? "0" : Session["UserIdno"].ToString()); int value = 0; string strMsg = string.Empty; int intUserRghtsIdno = 0; UserRightsDAL objUserRightsDAL = new UserRightsDAL(); if (ddlType.SelectedItem.Text == "Form") { var lstGridData = objUserRightsDAL.SelectForGridTypeForm(Convert.ToInt32(ddlUser.SelectedValue)); int i = 0; foreach (GridViewRow row in grdMain.Rows) { bool bAdd = false; bool bEdit = false; bool bView = false; bool bDelete = false; bool bPrint = false; if (lstGridData.Count > 0) { intUserRghtsIdno = Convert.ToInt32(DataBinder.Eval(lstGridData[i], "UserRgt_Idno")); CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect.Checked == true) { bAdd = true; bEdit = true; bView = true; bDelete = true; bPrint = true; } else if (chkSelect.Checked == false) { bAdd = false; bEdit = false; bView = false; bDelete = false; bPrint = false; } value = objUserRightsDAL.UpdateAll(intUserRghtsIdno, bAdd, bEdit, bView, bDelete, bPrint, empIdno); } i++; } } else if (ddlType.SelectedItem.Text == "Menu") { var lstGridData = objUserRightsDAL.SelectForGridTypeMenu(Convert.ToInt32(ddlUser.SelectedValue)); int i = 0; foreach (GridViewRow row in grdMain.Rows) { bool bAdd = false; bool bEdit = false; bool bView = false; bool bDelete = false; bool bPrint = false; if (lstGridData.Count > 0) { intUserRghtsIdno = Convert.ToInt32(DataBinder.Eval(lstGridData[i], "UserRgt_Idno")); CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect.Checked == true) { bAdd = true; bEdit = true; bView = true; bDelete = true; bPrint = true; } else if (chkSelect.Checked == false) { bAdd = false; bEdit = false; bView = false; bDelete = false; bPrint = false; } value = objUserRightsDAL.UpdateAll(intUserRghtsIdno, bAdd, bEdit, bView, bDelete, bPrint, empIdno); } i++; } } else if (ddlType.SelectedItem.Text == "Report") { var lstGridData = objUserRightsDAL.SelectForGridTypeRep(Convert.ToInt32(ddlUser.SelectedValue)); int i = 0; foreach (GridViewRow row in grdMain.Rows) { bool bAdd = false; bool bEdit = false; bool bView = false; bool bDelete = false; bool bPrint = false; if (lstGridData.Count > 0) { intUserRghtsIdno = Convert.ToInt32(DataBinder.Eval(lstGridData[i], "UserRgt_Idno")); CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect.Checked == true) { bAdd = true; bEdit = true; bView = true; bDelete = true; bPrint = true; } else if (chkSelect.Checked == false) { bAdd = false; bEdit = false; bView = false; bDelete = false; bPrint = false; } value = objUserRightsDAL.UpdateAll(intUserRghtsIdno, bAdd, bEdit, bView, bDelete, bPrint, empIdno); } i++; } } objUserRightsDAL = null; if (value > 0) { this.BindGrid(); strMsg = "Record updated successfully."; } if (value <= 0) { strMsg = "Record not updated."; } ScriptManager.RegisterStartupScript(this, this.GetType(), "alertstrMsg", "PassMessage('" + strMsg + "')", true); }
public UserRightsBO() { userrightsDAL = new UserRightsDAL(); }
public static void DeleteUserMapRef(string UserMapIDInt, string ModifiedByString) { UserRightsDAL.DeleteUserMapRef(UserMapIDInt, ModifiedByString); }