public ActionResult GroupTreeView()
        {
            try
            {
                GetPagePermissionResult objPermission = Functions.CheckPagePermission(PageMaster.Group);
                if (!objPermission.IsActive)
                {
                    return(this.RedirectToAction("Logout", "Home"));
                }

                if (!objPermission.View_Right)
                {
                    return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                }

                #region Menu Access
                Controllers.BaseController baseController = new Controllers.BaseController();
                this.ViewData = baseController.MenuAccessPermissions(objPermission);
                #endregion

                this.ViewData["blAddRights"]    = objPermission.Add_Right;
                this.ViewData["blEditRights"]   = objPermission.Edit_Right;
                this.ViewData["blDeleteRights"] = objPermission.Delete_Right;
                this.ViewData["blExportRights"] = objPermission.Export_Right;
                this.ViewData["UserRoleID"]     = mySession.Current.RoleId; //Functions.GetRoleNameByRoleId(mySession.Current.RoleId);

                return(this.View());
            }
            catch (Exception ex)
            {
                Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.Group, mySession.Current.UserId);
                return(this.View());
            }
        }
示例#2
0
        public ActionResult Compose()
        {
            try
            {
                GetPagePermissionResult objPermission = Functions.CheckPagePermission(PageMaster.Compose);
                if (!objPermission.IsActive)
                {
                    return(this.RedirectToAction("Logout", "Home"));
                }

                if (!objPermission.View_Right)
                {
                    return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                }

                #region Menu Access
                Controllers.BaseController baseController = new Controllers.BaseController();
                this.ViewData = baseController.MenuAccessPermissions(objPermission);
                #endregion Menu Access

                return(this.View());
            }
            catch (Exception ex)
            {
                Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.Compose, mySession.Current.UserId);
                return(this.View());
            }
        }
        public ActionResult Group()
        {
            try
            {
                GetPagePermissionResult objPermission = Functions.CheckPagePermission(PageMaster.Group);
                if (!objPermission.IsActive)
                {
                    return(this.RedirectToAction("Logout", "Home"));
                }

                ClsGroup objClsGroup = this.objiClsGroup as ClsGroup;
                long     lgUserId    = 0;
                if (this.Request.QueryString.Count > 0)
                {
                    if (this.Request.QueryString["iFrame"] != null)
                    {
                        if (!objPermission.Add_Right)
                        {
                            return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                        }

                        objClsGroup.hdniFrame = true;
                    }
                    else
                    {
                        if (!objPermission.Edit_Right || string.IsNullOrEmpty(this.Request.QueryString.ToString()))
                        {
                            return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                        }

                        lgUserId    = this.Request.QueryString.ToString().longSafe();
                        objClsGroup = this.objiClsGroup.GetGroupByGroupId(lgUserId);
                    }
                }
                else
                {
                    if (!objPermission.Add_Right)
                    {
                        return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                    }
                }

                #region Menu Access
                Controllers.BaseController baseController = new Controllers.BaseController();
                this.ViewData = baseController.MenuAccessPermissions(objPermission);
                #endregion Menu Access

                this.ViewData["UserRoleID"] = mySession.Current.RoleId;

                this.BindDropDownListForGroup(objClsGroup, true, objClsGroup.lgCompanyId, objClsGroup.lgParentGroupId);
                return(this.View(objClsGroup));
            }
            catch (Exception ex)
            {
                Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.Group, mySession.Current.UserId);
                return(this.View());
            }
        }
        public ActionResult Role()
        {
            try
            {
                GetPagePermissionResult objPermission = Functions.CheckPagePermission(PageMaster.Role);
                if (!objPermission.IsActive)
                {
                    return(this.RedirectToAction("Logout", "Home"));
                }

                ClsRole objClsRole = this.objiClsRole as ClsRole;
                long    lgRoleId   = 0;
                if (this.Request.QueryString.Count > 0)
                {
                    if (this.Request.QueryString["iFrame"] != null)
                    {
                        if (!objPermission.Add_Right)
                        {
                            return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                        }

                        objClsRole.hdniFrame = true;
                    }
                    else
                    {
                        if (!objPermission.Edit_Right || string.IsNullOrEmpty(this.Request.QueryString.ToString().Decode()))
                        {
                            return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                        }

                        lgRoleId   = this.Request.QueryString.ToString().Decode().longSafe();
                        objClsRole = this.objiClsRole.GetRoleByRoleId(lgRoleId);
                    }
                }
                else
                {
                    if (!objPermission.Add_Right)
                    {
                        return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                    }
                }

                #region Menu Access
                Controllers.BaseController baseController = new Controllers.BaseController();
                this.ViewData = baseController.MenuAccessPermissions(objPermission);
                #endregion Menu Access


                this.BindCompanyDropDownListForRole(objClsRole, true, objClsRole.lgCompanyID);
                return(this.View(objClsRole));
            }
            catch (Exception ex)
            {
                Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.Role);
                return(this.View());
            }
        }
示例#5
0
        public ActionResult OrderCategory()
        {
            try
            {
                GetPagePermissionResult objPermission = Functions.CheckPagePermission(PageMaster.OrderCategory);
                if (!objPermission.IsActive)
                {
                    return(this.RedirectToAction("Logout", "Home"));
                }

                ClsOrderCategory objClsOrderCategory = this.objiClsOrderCategory as ClsOrderCategory;
                long             lgId = 0;
                if (this.Request.QueryString.Count > 0)
                {
                    if (this.Request.QueryString["iFrame"] != null)
                    {
                        if (!objPermission.Add_Right)
                        {
                            return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                        }

                        objClsOrderCategory.hdniFrame = true;
                        this.ViewData["iFrame"]       = "iFrame";
                    }
                    else
                    {
                        if (!objPermission.Edit_Right || string.IsNullOrEmpty(this.Request.QueryString.ToString().Decode()))
                        {
                            return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                        }

                        lgId = this.Request.QueryString.ToString().Decode().longSafe();
                        objClsOrderCategory = this.objiClsOrderCategory.GetOrderCategoryById(lgId);
                    }
                }
                else
                {
                    if (!objPermission.Add_Right)
                    {
                        return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                    }
                    objClsOrderCategory.blIsActive = true;
                }

                #region Menu Access
                Controllers.BaseController baseController = new Controllers.BaseController();
                this.ViewData = baseController.MenuAccessPermissions(objPermission);
                #endregion Menu Access

                return(this.View(objClsOrderCategory));
            }
            catch (Exception ex)
            {
                Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.OrderCategory, mySession.Current.UserId);
                return(this.View());
            }
        }
        public ActionResult Index()
        {
            GetPagePermissionResult objPermission = Functions.CheckPagePermission(PageMaster.User);

            #region Menu Access
            Controllers.BaseController baseController = new Controllers.BaseController();
            this.ViewData = baseController.MenuAccessPermissions(objPermission);
            #endregion Menu Access

            return(this.View());
        }
        public new ActionResult User(string CompanyId = "")
        {
            try
            {
                GetPagePermissionResult objPermission = Functions.CheckPagePermission(PageMaster.User);
                if (!objPermission.IsActive)
                {
                    return(this.RedirectToAction("Logout", "Home"));
                }

                ClsUser objClsUser = this.objiClsUser as ClsUser;
                long    lgUserId   = 0;

                if (string.IsNullOrEmpty(CompanyId))
                {
                    if (this.Request.QueryString.Count > 0)
                    {
                        if (this.Request.QueryString["iFrame"] != null)
                        {
                            if (!objPermission.Add_Right)
                            {
                                return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                            }

                            objClsUser.hdniFrame = true;
                        }
                        else
                        {
                            if (!objPermission.Edit_Right || string.IsNullOrEmpty(this.Request.QueryString.ToString().Decode()))
                            {
                                return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                            }

                            lgUserId   = this.Request.QueryString.ToString().Decode().longSafe();
                            objClsUser = this.objiClsUser.GetUserByUserId(lgUserId);
                        }
                    }
                    else
                    {
                        if (!objPermission.Add_Right)
                        {
                            return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                        }
                    }
                    objClsUser.lgCompanyID = 0;
                }
                else
                {
                    objClsUser.lgCompanyID = Convert.ToInt64(CompanyId.Decode());
                }


                #region Menu Access
                Controllers.BaseController baseController = new Controllers.BaseController();
                this.ViewData = baseController.MenuAccessPermissions(objPermission);
                #endregion Menu Access

                this.BindDropDownListForUser(objClsUser, true, objClsUser.lgCompanyID, objClsUser.lgRoleId);
                return(this.View(objClsUser));
            }
            catch (Exception ex)
            {
                Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.User, mySession.Current.UserId);
                return(this.View());
            }
        }