protected void Page_Load(object sender, EventArgs e) { if (!Context.User.IsInRole("ServiceLine Manager")) { Response.Redirect("Access.aspx"); } Table table = new Table(); table.ID = "1"; PlaceHolder1.Controls.Add(table); string SlmUId = Context.User.Identity.GetUserId(); SLMServiceLine SLMService = new SLMServiceLine(); SLMService.getSLDetails(SlmUId); for (int count = 0; count < SLMService.servicelinelist.Count; count++) { TableRow row = new TableRow(); table.Rows.Add(row); TableCell cell = new TableCell(); row.Cells.Add(cell); Label label = new Label(); label.Text = SLMService.servicelinelist[count].Name; label.Width = 150; PlaceHolder1.Controls.Add(label); HyperLink edit = new HyperLink(); edit.Text = "Edit"; edit.NavigateUrl = "~/SLMServiceLinesEdit.aspx?ID=" + SLMService.servicelinelist[count].Id + "&&ServLineName=" + SLMService.servicelinelist[count].Name; edit.Width = 150; PlaceHolder1.Controls.Add(edit); PlaceHolder1.Controls.Add(new LiteralControl("<br/>")); } }
protected void Page_Load(object sender, EventArgs e) { if (!Context.User.IsInRole("ServiceLine Manager")) { Response.Redirect("Access.aspx"); } string ServiceName = Request.QueryString["ServLineName"]; ServLineName.Text = ServiceName; if (!IsPostBack) { string ServLineName = Request.QueryString["ServLineName"]; //OMCheckList.Text = ServLineName; string ServLineId = Request.QueryString["ID"]; int ServLineId1 = Convert.ToInt32(Request.QueryString["ID"]); ServiceLineRepository SLrepo = new ServiceLineRepository(); SLMServiceLine SlMRepo = new SLMServiceLine(); SlMRepo.getServLineOMDetails(ServLineId); SlMRepo.getAllOMDetails(); SlMRepo.getAllOMDetailsOfServiceLineManagers(ServLineId); SelectAllUsers selectAllUsers = new SelectAllUsers(); OMCheckList.DataSource = SlMRepo.ServLineOMTab; OMCheckList.DataTextField = "UserName"; OMCheckList.DataValueField = "Id"; OMCheckList.DataBind(); for (int i = 0; i < OMCheckList.Items.Count; i++) { OMCheckList.Items[i].Selected = true; string OmId = OMCheckList.Items[i].Value; SLrepo.EditServiceLineOMwhileload(ServLineId1, OmId); } //OMCheckList1.DataSource = SlMRepo.ServLineOMList; //OMCheckList1.DataTextField = "UserName"; //OMCheckList1.DataValueField = "Id"; //OMCheckList1.DataBind(); //CheckBoxList2.DataSource = SlMRepo.getAllOMDetailsOfServiceLineManagers(ServLineId); CheckBoxList2.DataSource = SlMRepo.ServLineOMList; CheckBoxList2.DataTextField = "UserName"; CheckBoxList2.DataValueField = "Id"; CheckBoxList2.DataBind(); } }