public void fillEmployerData(uspGetClientContactResult myEmployerInfo, uspGetClientByIDResult myEmployer) { pdfFormFields.SetField("employername", myEmployer.EmployerName); pdfFormFields.SetField("employeraddress", myEmployerInfo.Address); pdfFormFields.SetField("employercity", myEmployerInfo.City); pdfFormFields.SetField("employerstate", myEmployerInfo.state); pdfFormFields.SetField("employerzip", myEmployerInfo.zip); pdfFormFields.SetField("employerphone", myEmployerInfo.Phone); if (myEmployerInfo.Fax != null) { pdfFormFields.SetField("employerfax", myEmployerInfo.Fax); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["ClientID"] != null) { Guid myClientID = (Guid)Session["ClientID"]; try { ElectronicAppDBDataContext electronicAppDB = new ElectronicAppDBDataContext(); ElectronicAppStorageDBDataContext electronicAppStorageDB = new ElectronicAppStorageDBDataContext(); uspGetClientByIDResult myClient = electronicAppDB.uspGetClientByID(myClientID).Single <uspGetClientByIDResult>(); uspGetClientContactResult myClientContact = electronicAppDB.uspGetClientContact(myClient.ClientID).Single <uspGetClientContactResult>(); uspGetBrokerByIDResult myBroker = electronicAppDB.uspGetBrokerByID(myClient.OwnerID).Single <uspGetBrokerByIDResult>(); uspGetBrokerContactResult myBrokerInfo = electronicAppDB.uspGetBrokerContact(myBroker.BrokerID).Single <uspGetBrokerContactResult>(); string ClientName = myClient.EmployerName; //header.InnerHtml = "<span class=\"red\">Welcome</span> " + ClientName; BrokerName.InnerHtml = myBroker.FirstName + " " + myBroker.LastName; BrokerEmail.InnerHtml = myBrokerInfo.Email; BrokerPhone.InnerHtml = myBrokerInfo.PhoneNumber; BrokerFax.InnerHtml = myBrokerInfo.Fax; BrokerAddress.InnerHtml = myBrokerInfo.Address; BrokerAddress2.InnerHtml = myBrokerInfo.City + ", " + myBrokerInfo.State + " " + myBrokerInfo.Zip; Session.Add("Client", myClient); uspGetBrokerByIDResult broker = electronicAppDB.uspGetBrokerByID(myClient.OwnerID).Single <uspGetBrokerByIDResult>(); System.Collections.Generic.List <uspGetBrokerImageByOwnerIDResult> searches = electronicAppStorageDB.uspGetBrokerImageByOwnerID(broker.BrokerID).ToList <uspGetBrokerImageByOwnerIDResult>(); bool hasImage = searches.Count > 0; if (hasImage) { Image1.ImageUrl = "/BrokerImages/Broker.ashx?id=" + broker.BrokerID.ToString(); } //ClientName = electronicAppDB.uspGetBrokerByID(myClient.OwnerID).Single<uspGetBrokerByIDResult>(). } catch (Exception ex) { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("Default.aspx", false); } } else { BrokerInfo.Visible = false; } Session.Abandon(); FormsAuthentication.SignOut(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Guid myClientID = new Guid((String)(Session["clid"])); uspGetClientByIDResult myClient = eappdb.uspGetClientByID(myClientID).Single <uspGetClientByIDResult>(); uspGetClientContactResult myClientContact = eappdb.uspGetClientContact(myClientID).Single <uspGetClientContactResult>(); BrokerFirstName.Text = myClient.EmployerName; TaxID.Text = myClient.TaxID; BrokerPhone.Text = myClientContact.Phone; BrokerFax.Text = myClientContact.Fax; BrokerAddress.Text = myClientContact.Address; BrokerCity.Text = myClientContact.City; BrokerState.Text = myClientContact.state; BrokerZip.Text = myClientContact.zip; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["BrokerID"] != null) { Guid myBrokerID = (Guid)Session["BrokerID"]; try { if (Session["clid"] != null) { Guid myClientID = new Guid((String)Session["clid"]); ElectronicAppDBDataContext electronicAppDB = new ElectronicAppDBDataContext(); uspGetClientByIDResult myClient = electronicAppDB.uspGetClientByID(myClientID).Single <uspGetClientByIDResult>(); uspGetClientContactResult myClientContact = electronicAppDB.uspGetClientContact(myClientID).Single <uspGetClientContactResult>(); if (myClient.OwnerID != myBrokerID) { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("~/Default.aspx?security=1", false); } header.InnerHtml = "<span class=\"red\">Client Applications</span> " + myClient.EmployerName; BrokerName.InnerText = myClient.EmployerName; BrokerPhone.InnerText = myClientContact.Phone; BrokerAddress.InnerHtml = myClientContact.Address + "<br />" + myClientContact.City + ", " + myClientContact.state + " " + myClientContact.zip; BrokerFax.InnerText = myClientContact.Fax; List <uspGetSubmissionsByClientIDResult> mySubmissions = electronicAppDB.uspGetSubmissionsByClientID(myClient.ClientID).ToList <uspGetSubmissionsByClientIDResult>(); Boolean dark = false; if (mySubmissions.Count <= 0) { HtmlTableRow newrow = new HtmlTableRow(); HtmlTableCell newcell = new HtmlTableCell(); newcell.InnerHtml = "There are no submissions to display."; newrow.Cells.Add(newcell); clients.Rows.Add(newrow); } else { HtmlTableRow row = new HtmlTableRow(); HtmlTableCell cell1 = new HtmlTableCell(); cell1.InnerHtml = "Date Submitted"; cell1.Attributes["Style"] = "border-bottom: 2px solid;"; cell1.BgColor = (dark) ? "#CCCCCC" : "#FFFFFF"; cell1.Width = "100px"; HtmlTableCell cell2 = new HtmlTableCell(); cell2.InnerHtml = "Enrollee Name"; cell2.Attributes["Style"] = "border-bottom: 2px solid;"; cell2.BgColor = (dark) ? "#CCCCCC" : "#FFFFFF"; cell2.Width = "200px"; HtmlTableCell cell3 = new HtmlTableCell(); cell3.InnerHtml = "Birth Date"; cell3.Attributes["Style"] = "border-bottom: 2px solid;"; cell3.BgColor = (dark) ? "#CCCCCC" : "#FFFFFF"; cell3.Width = "100px"; row.Cells.Add(cell2); row.Cells.Add(cell3); row.Cells.Add(cell1); clients.Rows.Add(row); dark = !dark; foreach (uspGetSubmissionsByClientIDResult submission in mySubmissions) { HtmlTableRow newrow = new HtmlTableRow(); HtmlTableCell newcell1 = new HtmlTableCell(); newcell1.InnerHtml = submission.AddedDate.ToShortDateString(); newcell1.BgColor = (dark) ? "#CCCCCC" : "#FFFFFF"; HtmlTableCell newcell2 = new HtmlTableCell(); uspGetEnrolleeByIDResult myEnrollee = electronicAppDB.uspGetEnrolleeByID(submission.OwnerID).Single <uspGetEnrolleeByIDResult>(); newcell2.BgColor = (dark) ? "#CCCCCC" : "#FFFFFF"; newcell2.InnerHtml = myEnrollee.FirstName + " " + myEnrollee.LastName; HtmlTableCell newcell3 = new HtmlTableCell(); newcell3.BgColor = (dark) ? "#CCCCCC" : "#FFFFFF"; newcell3.InnerHtml = myEnrollee.BirthDate; newrow.Cells.Add(newcell2); newrow.Cells.Add(newcell3); newrow.Cells.Add(newcell1); clients.Rows.Add(newrow); dark = !dark; } } } else { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("~/Default.aspx", false); } } catch (Exception x) { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("~/Default.aspx", false); } } else { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("~/Default.aspx", false); } } }