コード例 #1
0
ファイル: Workflows.aspx.cs プロジェクト: bad6955/workflow
        private void CreateAdminWorkflowList()
        {
            workflowNode            = "";
            workflowList.InnerHtml  = "";
            numberShowing.InnerHtml = "";
            List <WorkflowModel> workflows = WorkflowUtil.GetWorkflows();

            for (int i = 0; i < 10 && i < workflows.Count; i++)
            {
                MakeAdminText(workflows, workflowNode, i);
            }
            var showing = "Showing 1 - " + count + " of " + workflows.Count + " Results";

            numberShowing.InnerHtml += showing;
        }
コード例 #2
0
ファイル: Workflows.aspx.cs プロジェクト: bad6955/workflow
        protected void LoadMoreWorkflows(object sender, EventArgs e)
        {
            ViewState["workflowcount"] = Convert.ToInt32(ViewState["workflowcount"]) + 1;
            int loaded = Convert.ToInt32(ViewState["workflowcount"]);

            List <WorkflowModel> workflows = new List <WorkflowModel>();
            User user = (User)Session["User"];

            if (user.RoleId == 1)
            {
                workflows = WorkflowUtil.GetCompanyWorkflows(user.CompanyId);
            }
            else if (user.RoleId == 2)
            {
                workflows = WorkflowUtil.GetCoachWorkflows(user.UserId);
            }
            else if (user.RoleId == 4 || user.RoleId == 3)
            {
                workflows = WorkflowUtil.GetWorkflows();
            }
            if (loaded == 1)
            {
                ViewState["workflowcount"] = Convert.ToInt32(ViewState["workflowcount"]) + 1;
                loaded = Convert.ToInt32(ViewState["workflowcount"]);
            }
            for (int i = 10; i < loaded * 10 && i < workflows.Count; i++)
            {
                if (user.RoleId == 4)
                {
                    MakeAdminText(workflows, workflowNode, i);
                }
                else if (user.RoleId == 1)
                {
                    MakeClientText(workflows, workflowNode, i);
                }
                else
                {
                    MakeText(workflows, workflowNode, i);
                }
            }

            numberShowing.InnerHtml = "";
            var showing = "Showing 1 - " + count + " of " + workflows.Count + " Results";

            numberShowing.InnerHtml += showing;
        }