Beispiel #1
0
        private void InitControl(int role)
        {
            List <ModulesEntity> listAll     = userApp.GetRoleModules(0);
            List <ModulesEntity> listCurrent = userApp.GetRoleModules(role);

            ltlModules.Text   = GetTree(listAll, 1);
            ltlModules2.Text  = GetTree(listAll, 1);
            hidSelected.Value = GetSelectedModules(listCurrent);
        }
Beispiel #2
0
        private void InitControl()
        {
            List <ModulesEntity> list    = userApp.GetRoleModules(UserInfo.RoleID, true);
            List <ModulesEntity> listTop = list.FindAll(m => m.ParentID == ParentID && m.ShowInMenu);

            listTop = listTop.FindAll(x => x.ModuleTitle.IndexOf("Companies", StringComparison.CurrentCultureIgnoreCase) < 0 &&
                                      x.ModuleTitle.IndexOf("Projects", StringComparison.CurrentCultureIgnoreCase) < 0
                                      );
            rptTop.DataSource = listTop;
            rptTop.DataBind();
        }
Beispiel #3
0
        private void InitControl()
        {
            List <ModulesEntity> list    = userApp.GetRoleModules(RoleID, true);
            List <ModulesEntity> listTop = list.FindAll(m => m.ParentID == ParentID && m.ShowInMenu);

            if (UserInfo.Role == RolesEnum.CLIENT) // if current role is client then change Clients modules' module name to Tickets
            {
                ModulesEntity modulesEntity = listTop.Find(r => r.ModuleTitle.Trim().ToLower() == "clients");
                if (modulesEntity != null)
                {
                    modulesEntity.ModuleTitle = "Tickets";
                }
            }
            rptTop.DataSource = listTop;
            rptTop.DataBind();
        }
Beispiel #4
0
        public string GetClientTopMenu(int userId)
        {
            UsersEntity          userInfo = new UserApplication().GetUser(userId);
            UserApplication      userApp  = new UserApplication();
            List <ModulesEntity> list     = userApp.GetRoleModules(userInfo.RoleID, true);
            List <ModulesEntity> listTop  = list.FindAll(m => m.ParentID == 1 && m.ShowInMenu);

            if (userInfo.Role == RolesEnum.CLIENT) // if current role is client then change Clients modules' module name to Tickets
            {
                ModulesEntity modulesEntity = listTop.Find(r => r.ModuleTitle.Trim().ToLower() == "clients");
                if (modulesEntity != null)
                {
                    modulesEntity.ModuleTitle = "Tickets";
                }
            }
            return(Newtonsoft.Json.JsonConvert.SerializeObject(listTop));
        }
Beispiel #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     userApp = new UserApplication();
     _tsApp  = new TimeSheetApplication();
     if (!IsPostBack)
     {
         list = userApp.GetRoleModules(UserInfo.RoleID, true);
         InitSearchControls();
         if (QS("project") != "")
         {
             ddlProject.SelectedValue = QS("project");
         }
         if (QS("user") != "")
         {
             ddlUsers.SelectedValue = QS("user");
         }
         InitControls();
     }
 }
Beispiel #6
0
        private void InitControl(int role)
        {
            List <ModulesEntity> listCurrent = userApp.GetRoleModules(role);

            ltlLeft.Text = GetTree(listCurrent, ParentID);
        }