/// <summary> /// To fetch ProjectRoutes and bind to list /// </summary> private void GetProjectRoutes() { ProjectRouteBLL ProjectRouteLogic = new ProjectRouteBLL(); ProjectRouteList ProjectRoutes = ProjectRouteLogic.GetProjectRoutebyId(Convert.ToInt32(projectID)); lstRoutes.DataSource = ProjectRoutes; lstRoutes.DataBind(); pnlRoutes.Visible = true; }
/// <summary> /// To load routes /// </summary> public void LoadRoutes() { ProjectRouteBLL oProjectRouteBLL = new ProjectRouteBLL(); ProjectRouteList lstProjectRouteList = new ProjectRouteList(); try { int ProjectId = 0; if (Request.QueryString.Count == 0) { if (Session["PROJECT_ID"] != null) { ProjectId = Convert.ToInt32(Session["PROJECT_ID"].ToString()); RouteEnabled(true); } } else { ProjectId = Convert.ToInt32(Request.QueryString["ProjectID"].ToString()); RouteEnabled(false); } lstProjectRouteList = oProjectRouteBLL.GetProjectRoutebyId(ProjectId); rptRoute.DataSource = lstProjectRouteList; rptRoute.DataBind(); FindSum(); } catch (Exception ex) { throw ex; } for (int i = 0; i < rptRoute.Items.Count; i++) { Panel p = (Panel)rptRoute.Items[i].FindControl("pnlspace"); if (p != null) { if (i == 0) { p.Visible = true; } else { p.Visible = false; } } } }
/// <summary> /// To fetch details and assign to textbox /// </summary> /// <param name="ProjectID"></param> public void GetProjectRouteDetails(int ProjectID) { // int RouteCordinate = 0; ProjectRouteBLL objProjectRouteBLL = new ProjectRouteBLL(); ProjectRouteList objProjectRoute = objProjectRouteBLL.GetProjectRoutebyId(ProjectID); if (objProjectRoute.Count > 0) { pnlRouteSelCriteria.Visible = true; //ApproverButton.Visible = true; for (int i = 0; i < objProjectRoute.Count; i++) { if (i == 0) { txtRoute1.Text = objProjectRoute[i].Route_Name; txtRouteDetails1.Text = objProjectRoute[i].Route_Details; ViewState["ROUTE_ID1"] = objProjectRoute[i].Route_ID; lnkbtnone1.Visible = true; RouteCoordinatesOne(); } else if (i == 1) { txtRoute2.Text = objProjectRoute[i].Route_Name; txtRouteDetails2.Text = objProjectRoute[i].Route_Details; ViewState["ROUTE_ID2"] = objProjectRoute[i].Route_ID; lnkbtnTwo.Visible = true; RouteCoordinatesTwo(); } else if (i == 2) { txtRoute3.Text = objProjectRoute[i].Route_Name; txtRouteDetails3.Text = objProjectRoute[i].Route_Details; ViewState["ROUTE_ID3"] = objProjectRoute[i].Route_ID; lnkbtnthree.Visible = true; RouteCoordinatesThree(); } } ProjectRouteList lstProjectRouteList = objProjectRouteBLL.GetProjectRoutebyId(ProjectID); if (lstProjectRouteList.Count > 0) { //For Enabling/Disabling Approver Button if (lstProjectRouteList[0].TotalRouteScore > 0) { ApproverButton.Visible = true; } else { ApproverButton.Visible = false; } } //Enabling or Disabling Route Selection Panel based on Route Cordinate Value if (ViewState["ROUTE_ID1"] != null) { if (RouteCordinates(ViewState["ROUTE_ID1"].ToString()) > 0) { //Enabling Route Selection Link Button pnlRouteSelCriteria.Visible = true; } } else if (ViewState["ROUTE_ID2"] != null) { if (RouteCordinates(ViewState["ROUTE_ID2"].ToString()) > 0) { pnlRouteSelCriteria.Visible = true; } } else if (ViewState["ROUTE_ID3"] != null) { if (RouteCordinates(ViewState["ROUTE_ID3"].ToString()) > 0) { //Enabling Route Selection Link Button pnlRouteSelCriteria.Visible = true; } } else { //Disbling Route Selection Link Button pnlRouteSelCriteria.Visible = false; } } else { pnlRouteSelCriteria.Visible = false; ApproverButton.Visible = false; } }