protected void Page_Load(object sender, EventArgs e) { //If no TCPID was passed, then redirect back to the homepage string tcp_id = Request.QueryString["TCPID"]; if (!string.IsNullOrEmpty(tcp_id)) { TCPID = Convert.ToInt32(tcp_id); } else { Response.Redirect(Config.SIMSURL + "SIMSWSCHome.aspx"); } //Using the passed TCPID, setup the TCP data element, and reset the office and wsc to match that of the current site currTCP = db.TCPs.Where(p => p.TCPID == TCPID).FirstOrDefault(); SiteID = (int)currTCP.site_id; OfficeID = (int)currTCP.TCPSite.Site.office_id; WSCID = (int)db.Offices.Where(p => p.office_id == OfficeID).FirstOrDefault().wsc_id; //--BASIC PAGE SETUP-------------------------------------------------------------------- ph1.Title = currTCP.TCPPlanDetail.Number + " - TCP, " + currTCP.TCPPlanDetail.SubName; ph1.SubTitle = currTCP.TCPSite.Site.site_no + " " + db.vSITEFILEs.FirstOrDefault(s => s.site_no == currTCP.TCPSite.Site.site_no && s.agency_cd == currTCP.TCPSite.Site.agency_cd).station_nm; PopulateReport(); }
protected void Page_Load(object sender, EventArgs e) { string type = Request.QueryString["type"]; int TCPID = Convert.ToInt32(Request.QueryString["TCPID"]); tcp = db.TCPs.FirstOrDefault(p => p.TCPID == TCPID); ltlSiteNoName.Text = tcp.TCPSite.Site.site_no.Trim() + " " + db.vSITEFILEs.FirstOrDefault(s => s.site_no == tcp.TCPSite.Site.site_no && s.agency_cd == tcp.TCPSite.Site.agency_cd).station_nm; SetupTCPPanel(); if (type == "approve") { pnlApprove.Visible = true; pnlReview.Visible = false; SetupApprovePanel(); } else { pnlApprove.Visible = false; pnlReview.Visible = true; ltlApproved2.Text = String.Format("{0:MM/dd/yyyy} ({1})", tcp.ApprovedDt, tcp.ApprovedBy); } }