private void GetPageByModulId(int ModuleId) { string Ocode = ((SessionUser)Session["SessionUser"]).OCode; string RoleId = ((SessionUser)Session["SessionUser"]).RoleId; string UserType = ((SessionUser)Session["SessionUser"]).User_Level; string usrerId = Convert.ToString(((SessionUser)Session["SessionUser"]).UserId); Guid use = Guid.Parse(usrerId); if (UserType == "Administrator") { List <Category> categorys = pageObj.GetCategoryByModulId(ModuleId, Ocode).ToList(); if (categorys.Count > 0) { reptManuList.DataSource = categorys; reptManuList.DataBind(); foreach (RepeaterItem repeaterItem in reptManuList.Items) { string cateGoryId = ((HiddenField)repeaterItem.FindControl("hiddenCategoryID")).Value; List <tbl_Page> pages = pageObj.getPagesByCategoryForSupperAdmin(cateGoryId, Ocode); ((Repeater)(repeaterItem.FindControl("reptPageList"))).DataSource = pages; ((Repeater)(repeaterItem.FindControl("reptPageList"))).DataBind(); } } } else { List <Category> categorys = pageObj.GetCategoryForUserByModulId(ModuleId, Ocode, use).ToList(); if (categorys.Count > 0) { reptManuList.DataSource = categorys; reptManuList.DataBind(); foreach (RepeaterItem repeaterItem in reptManuList.Items) { string cateGoryId = ((HiddenField)repeaterItem.FindControl("hiddenCategoryID")).Value; List <RPage> pages = pageObj.getPagesByCategoryForUser(cateGoryId, Ocode, use); ((Repeater)(repeaterItem.FindControl("reptPageList"))).DataSource = pages; ((Repeater)(repeaterItem.FindControl("reptPageList"))).DataBind(); } } } //string Ocode = ((SessionUser)Session["SessionUser"]).OCode; //List<tbl_Page> pages = pageObj.GetPageByModulId(ModuleId, Ocode); //if (pages.Count > 0) //{ // reptPageList.DataSource = pages; // reptPageList.DataBind(); //} }
private void GetPageByModulId(int ModuleId) { string Ocode = ((SessionUser)Session["SessionUser"]).OCode; string RoleId = ((SessionUser)Session["SessionUser"]).RoleId; string UserType = ((SessionUser)Session["SessionUser"]).User_Level; string usrerId = Convert.ToString(((SessionUser)Session["SessionUser"]).UserId); Guid use = Guid.Parse(usrerId); if (UserType == "Administrator" || UserType == "SuperAdmin") { List <Category> categorys = pageObj.GetCategoryByModulId(ModuleId, Ocode).ToList(); if (categorys.Count > 0) { reptManuList.DataSource = categorys; reptManuList.DataBind(); foreach (RepeaterItem repeaterItem in reptManuList.Items) { string cateGoryId = ((HiddenField)repeaterItem.FindControl("hiddenCategoryID")).Value; List <ERPSSL.Adminpanel.DAL.tbl_Page> pages = pageObj.getPagesByCategoryForSupperAdmin(cateGoryId, Ocode); ((Repeater)(repeaterItem.FindControl("reptPageList"))).DataSource = pages; ((Repeater)(repeaterItem.FindControl("reptPageList"))).DataBind(); Repeater innerRepeater = ((Repeater)(repeaterItem.FindControl("reptPageList"))); int hlog = 0; foreach (RepeaterItem innerItem in innerRepeater.Items) { if (cateGoryId == "129") { HyperLink hytext = ((HyperLink)innerItem.FindControl("ur")); string itempage = hytext.NavigateUrl; int numbers = SetPendingListThrough(); if (itempage == "/BuyingHouse/PendingApprovalList.aspx") { Label lblCount = ((Label)innerItem.FindControl("nlblCount")); if (numbers > 0) { hlog += numbers; lblCount.Text = numbers.ToString(); repeaterItem.FindControl("splogo").Visible = true; //innerItem.FindControl("nsplogo").Visible = true; } else { //lblCount.Text ="0"; repeaterItem.FindControl("splogo").Visible = false; innerItem.FindControl("nsplogo").Visible = false; repeaterItem.FindControl("splogo").Visible = false; } } else { innerItem.FindControl("nsplogo").Visible = false; } } else { innerItem.FindControl("nsplogo").Visible = false; repeaterItem.FindControl("splogo").Visible = false; } } } //foreach (RepeaterItem repeaterItem in reptManuList.Items) //{ // string cateGoryId = ((HiddenField)repeaterItem.FindControl("hiddenCategoryID")).Value; // List<tbl_Page> pages = pageObj.getPagesByCategoryForSupperAdmin(cateGoryId, Ocode); // ((Repeater)(repeaterItem.FindControl("reptPageList"))).DataSource = pages; // ((Repeater)(repeaterItem.FindControl("reptPageList"))).DataBind(); //} } } else { List <Category> categorys = pageObj.GetCategoryForUserByModulId(ModuleId, Ocode, use).ToList(); if (categorys.Count > 0) { reptManuList.DataSource = categorys; reptManuList.DataBind(); foreach (RepeaterItem repeaterItem in reptManuList.Items) { string cateGoryId = ((HiddenField)repeaterItem.FindControl("hiddenCategoryID")).Value; List <RPage> pages = pageObj.getPagesByCategoryForUser(cateGoryId, Ocode, use); ((Repeater)(repeaterItem.FindControl("reptPageList"))).DataSource = pages; ((Repeater)(repeaterItem.FindControl("reptPageList"))).DataBind(); } } } }