// public string ClientName; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { 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; 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(); } 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); //ClientName = electronicAppDB.uspGetBrokerByID(myClient.OwnerID).Single<uspGetBrokerByIDResult>(). } catch (Exception ex) { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("Default.aspx", false); } } else if (Session["BrokerID"] != null) { Response.Redirect("~/BrokerAdmin/Welcome.aspx", true); } else { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("Default.aspx", false); } } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { ElectronicAppDBDataContext ElectronicAppDB = new ElectronicAppDBDataContext(); ElectronicAppSecurityDBDataContext ElectronicAppSecurityDB = new ElectronicAppSecurityDBDataContext(); List<uspLoginWebuserResult> Loginresult = null; Loginresult = ElectronicAppSecurityDB.uspLoginWebuser(txtUserName.Text, txtPassword.Text).ToList<uspLoginWebuserResult>(); if (Loginresult.Count <= 0) { List<uspLoginBrokeruserResult> brokerresult = null; brokerresult = ElectronicAppSecurityDB.uspLoginBrokeruser(txtUserName.Text, txtPassword.Text).ToList<uspLoginBrokeruserResult>(); if (brokerresult.Count > 0) { Guid brokerID = brokerresult[0].associatedWith; Session.Add("BrokerID", brokerID); FormsAuthentication.RedirectFromLoginPage("txtUserName.Text", false); } else { Response.Redirect("~/Default.aspx?InvalidLogin=1", true); } } else { try { Guid myClientID = Loginresult[0].AssociatedWith; uspGetClientByIDResult myClient = ElectronicAppDB.uspGetClientByID(myClientID).Single<uspGetClientByIDResult>(); uspGetClientCoverageOptionsResult myCoverageOptions = ElectronicAppDB.uspGetClientCoverageOptions(myClientID).Single<uspGetClientCoverageOptionsResult>(); List<uspGetClientPlanOptionsResult> myPlanOptions = ElectronicAppDB.uspGetClientPlanOptions(myClientID).ToList<uspGetClientPlanOptionsResult>(); string[] myPlans = new string[myPlanOptions.Count]; int i = 0; foreach (uspGetClientPlanOptionsResult po in myPlanOptions) { myPlans[i] = po.PlanName; i = i+1; } coverageOffered myCoverageOffered = new coverageOffered(myPlans, myCoverageOptions.Medical, myCoverageOptions.Dental, myCoverageOptions.Vision, myCoverageOptions.Life, myCoverageOptions.Disability); Session.Add("CoverageOffered", myCoverageOffered); Session.Add("UserID", Guid.NewGuid()); Session.Add("ClientID", myClientID); //Response.Redirect("~/Welcome.aspx", false); FormsAuthentication.RedirectFromLoginPage("txtUserName.Text", false); } catch( Exception ex ) { Console.WriteLine(ex.Message); Console.WriteLine(ex.InnerException); Response.Redirect("~/Default.aspx?Exception=1", true); } } }
protected void Page_Init(object sender, EventArgs e) { ElectronicAppDBDataContext eappdb = new ElectronicAppDBDataContext(); foreach (uspGetCarrierOptionsResult carrier in eappdb.uspGetCarrierOptions()) { lstAvail.Items.Add(new ListItem(carrier.Name)); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["BrokerID"] != null) { Guid myBrokerID = (Guid)Session["BrokerID"]; try { ElectronicAppDBDataContext electronicAppDB = new ElectronicAppDBDataContext(); uspGetBrokerByIDResult myBroker = electronicAppDB.uspGetBrokerByID(myBrokerID).Single <uspGetBrokerByIDResult>(); uspGetBrokerContactResult myBrokerInfo = electronicAppDB.uspGetBrokerContact(myBroker.BrokerID).Single <uspGetBrokerContactResult>(); //string ClientName = myClient.EmployerName; BrokerFirstName.Text = myBroker.FirstName; BrokerLastName.Text = myBroker.LastName; BrokerEmail.Text = myBrokerInfo.Email; BrokerPhone.Text = myBrokerInfo.PhoneNumber; BrokerFax.Text = myBrokerInfo.Fax; BrokerAddress.Text = myBrokerInfo.Address; BrokerCity.Text = myBrokerInfo.City; BrokerState.Text = myBrokerInfo.State; BrokerZip.Text = myBrokerInfo.Zip; ElectronicAppStorageDBDataContext electronicAppStorageDB = new ElectronicAppStorageDBDataContext(); uspGetBrokerByIDResult broker = electronicAppDB.uspGetBrokerByID(myBroker.BrokerID).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(); } //Session.Add("Client", myClient); //ClientName = electronicAppDB.uspGetBrokerByID(myClient.OwnerID).Single<uspGetBrokerByIDResult>(). } catch (Exception ex) { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("Default.aspx", false); } } else { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("Default.aspx", false); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["BrokerID"] != null) { Guid myBrokerID = (Guid)Session["BrokerID"]; try { ElectronicAppDBDataContext electronicAppDB = new ElectronicAppDBDataContext(); uspGetBrokerByIDResult myBroker = electronicAppDB.uspGetBrokerByID(myBrokerID).Single<uspGetBrokerByIDResult>(); uspGetBrokerContactResult myBrokerInfo = electronicAppDB.uspGetBrokerContact(myBroker.BrokerID).Single<uspGetBrokerContactResult>(); //string ClientName = myClient.EmployerName; BrokerFirstName.Text = myBroker.FirstName; BrokerLastName.Text = myBroker.LastName; BrokerEmail.Text = myBrokerInfo.Email; BrokerPhone.Text = myBrokerInfo.PhoneNumber; BrokerFax.Text = myBrokerInfo.Fax; BrokerAddress.Text = myBrokerInfo.Address; BrokerCity.Text = myBrokerInfo.City; BrokerState.Text = myBrokerInfo.State; BrokerZip.Text = myBrokerInfo.Zip; ElectronicAppStorageDBDataContext electronicAppStorageDB = new ElectronicAppStorageDBDataContext(); uspGetBrokerByIDResult broker = electronicAppDB.uspGetBrokerByID(myBroker.BrokerID).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(); } //Session.Add("Client", myClient); //ClientName = electronicAppDB.uspGetBrokerByID(myClient.OwnerID).Single<uspGetBrokerByIDResult>(). } catch (Exception ex) { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("Default.aspx", false); } } else { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("Default.aspx", false); } } }
public void EncryptPDF(Byte[] myPDF) { myRijndael.GenerateIV(); myRijndael.GenerateKey(); byte[] encPDF = encryptStringToBytes_AES(Convert.ToBase64String(myPDF), myRijndael.Key, myRijndael.IV); EncryptAndStoreKey(myRijndael.Key, myRijndael.IV); ElectronicAppDBDataContext eappdb = new ElectronicAppDBDataContext(); eappdb.uspInsertSubmission(SubmissionID, OwnerID, ObjectID.ToString(), "pdf", addedBY); ElectronicAppStorageDBDataContext storagedb = new ElectronicAppStorageDBDataContext(); storagedb.uspInsertSubmission(ObjectID, SubmissionID, encPDF, ObjectID.ToString(), "pdf", addedBY); }
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 btnNext_Click(object sender, EventArgs e) { try { if (Session["ClientID"] == null && Session["UserID"] == null) { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("~/Default.aspx?timeout=1"); } else { Guid ClientID = (Guid)Session["ClientID"]; Guid UserID = (Guid)Session["UserID"]; ElectronicAppDBDataContext eappdata = new ElectronicAppDBDataContext(); //eappdata.uspDoesEnrolleeExist(ClientID, txtFirstName, txtLastName, txtBirthDate); List <uspDoesEnrolleeExistResult> myResult = eappdata.uspDoesEnrolleeExist(ClientID, txtFirstName.Text, txtLastName.Text, txtMonth.Text + "/" + txtDay.Text + "/" + txtYear.Text).ToList <uspDoesEnrolleeExistResult>(); if (myResult.Count > 0) { Session["UserID"] = myResult[0].EnrolleeID; } else { eappdata.uspInsertEnrollee(UserID, ClientID, txtFirstName.Text, txtLastName.Text, txtMonth.Text + "/" + txtDay.Text + "/" + txtYear.Text, false, Request.UserHostAddress.ToString()); } employeeData myData = new employeeData(); myData.EmployeeName = txtFirstName.Text + " " + txtLastName.Text; myData.DOB = txtMonth.Text + "/" + txtDay.Text + "/" + txtYear.Text; if (cmbWaive.Text.Equals("Yes", StringComparison.CurrentCultureIgnoreCase)) { myData.WaiveAll = true; Session.Add("EmployeeData", myData); Response.Redirect("CoverageSelection.aspx", false); } else { myData.WaiveAll = false; Session.Add("EmployeeData", myData); Response.Redirect("EmployeeData.aspx", false); } } } catch (Exception ex) { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("Default.aspx", false); } }
protected void btnNext_Click(object sender, EventArgs e) { try { if (Session["ClientID"] == null && Session["UserID"] == null) { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("~/Default.aspx?timeout=1"); } else { Guid ClientID = (Guid) Session["ClientID"]; Guid UserID = (Guid) Session["UserID"]; ElectronicAppDBDataContext eappdata = new ElectronicAppDBDataContext(); //eappdata.uspDoesEnrolleeExist(ClientID, txtFirstName, txtLastName, txtBirthDate); List<uspDoesEnrolleeExistResult> myResult = eappdata.uspDoesEnrolleeExist(ClientID, txtFirstName.Text, txtLastName.Text, txtMonth.Text + "/" + txtDay.Text + "/" + txtYear.Text).ToList<uspDoesEnrolleeExistResult>(); if (myResult.Count> 0) { Session["UserID"] = myResult[0].EnrolleeID; } else { eappdata.uspInsertEnrollee(UserID, ClientID, txtFirstName.Text, txtLastName.Text, txtMonth.Text + "/" + txtDay.Text + "/" + txtYear.Text, false, Request.UserHostAddress.ToString()); } employeeData myData = new employeeData(); myData.EmployeeName = txtFirstName.Text + " " + txtLastName.Text; myData.DOB = txtMonth.Text + "/" + txtDay.Text + "/" + txtYear.Text; if (cmbWaive.Text.Equals("Yes", StringComparison.CurrentCultureIgnoreCase)) { myData.WaiveAll = true; Session.Add("EmployeeData", myData); Response.Redirect("CoverageSelection.aspx", false); } else { myData.WaiveAll = false; Session.Add("EmployeeData", myData); Response.Redirect("EmployeeData.aspx", false); } } } catch (Exception ex) { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("Default.aspx", false); } }
protected void Button1_Click(object sender, EventArgs e) { bool redir = true; if (FileUpload1.PostedFile.ContentLength <= 5 * 1024 * 1024 && FileUpload1.PostedFile.ContentLength > 0) { //System.Drawing.Image newbrokerimage = System.Drawing.Image.FromStream(FileUpload1.PostedFile.InputStream); //newbrokerimage.Save( Server.MapPath("~/BrokerImages/") + Session["BrokerID"] + ".png", System.Drawing.Imaging.ImageFormat.Png); byte[] bytes = FileUpload1.FileBytes; bytes = imageResize.ResizeFromByteArray(150, bytes, "test"); System.Data.Linq.Binary image = new System.Data.Linq.Binary(bytes); ElectronicAppStorageDBDataContext eappstor = new ElectronicAppStorageDBDataContext(); eappstor.uspDeleteBrokerImageByOwnerID((Guid)(Session["BrokerID"])); String filename = FileUpload1.FileName; String ext = filename.Substring(filename.LastIndexOf('.') + 1); filename = filename.Substring(0, filename.LastIndexOf('.')); eappstor.uspInsertBrokerImage(System.Guid.NewGuid(), (Guid)(Session["BrokerID"]), image, filename, ext); } else if (FileUpload1.PostedFile.ContentLength > 0) { redir = false; lblMessage.Text = "File must be less than 5MB in size."; lblMessage.Visible = true; } ElectronicAppDBDataContext ElectronicAppDB = new ElectronicAppDBDataContext(); ElectronicAppDB.uspAlterBrokerInfo((Guid)Session["BrokerID"], BrokerFirstName.Text, BrokerLastName.Text, BrokerEmail.Text, BrokerPhone.Text, BrokerFax.Text, BrokerAddress.Text, BrokerCity.Text, BrokerState.Text, BrokerZip.Text); if (redir) { Response.Redirect("Welcome.aspx", false); } }
protected void Button1_Click(object sender, EventArgs e) { bool redir = true; if (FileUpload1.PostedFile.ContentLength <= 5 * 1024 * 1024 && FileUpload1.PostedFile.ContentLength > 0) { //System.Drawing.Image newbrokerimage = System.Drawing.Image.FromStream(FileUpload1.PostedFile.InputStream); //newbrokerimage.Save( Server.MapPath("~/BrokerImages/") + Session["BrokerID"] + ".png", System.Drawing.Imaging.ImageFormat.Png); byte[] bytes = FileUpload1.FileBytes; bytes = imageResize.ResizeFromByteArray( 150, bytes, "test"); System.Data.Linq.Binary image = new System.Data.Linq.Binary(bytes); ElectronicAppStorageDBDataContext eappstor = new ElectronicAppStorageDBDataContext(); eappstor.uspDeleteBrokerImageByOwnerID((Guid)(Session["BrokerID"])); String filename = FileUpload1.FileName; String ext = filename.Substring( filename.LastIndexOf('.') + 1 ); filename = filename.Substring( 0, filename.LastIndexOf('.')); eappstor.uspInsertBrokerImage(System.Guid.NewGuid(), (Guid)(Session["BrokerID"]), image, filename, ext); } else if (FileUpload1.PostedFile.ContentLength > 0) { redir = false; lblMessage.Text = "File must be less than 5MB in size."; lblMessage.Visible = true; } ElectronicAppDBDataContext ElectronicAppDB = new ElectronicAppDBDataContext(); ElectronicAppDB.uspAlterBrokerInfo( (Guid)Session["BrokerID"], BrokerFirstName.Text, BrokerLastName.Text, BrokerEmail.Text, BrokerPhone.Text, BrokerFax.Text, BrokerAddress.Text, BrokerCity.Text, BrokerState.Text, BrokerZip.Text); if (redir) { Response.Redirect("Welcome.aspx", false); } }
protected void btnAdd_Click(object sender, EventArgs e) { ElectronicAppDBDataContext eappdb = new ElectronicAppDBDataContext(); ElectronicAppSecurityDBDataContext eappsec = new ElectronicAppSecurityDBDataContext(); int countErrors = 0; //Check password length and equality. if (!txtPassword.Text.Equals(txtPassword2.Text) || txtPassword.Text.Length < 4 || txtLogin.Text.Equals("")) { lblErrorCredentials.Visible = true; lblErrorCredentials.Text = "Username or password is invalid, or passwords do not match."; countErrors++; } else { lblErrorCredentials.Visible = false; } if (eappsec.uspCheckUsername(txtLogin.Text).ToList <uspCheckUsernameResult>().Count > 0) { lblErrorTaken.Visible = true; lblErrorTaken.Text = "Please choose a different username, the one you provided is in use."; countErrors++; } else { lblErrorTaken.Visible = false; } //Check calendar range. if (!(calBeginPeriod.SelectedDate.CompareTo(calEndPeriod.SelectedDate) < 0)) { lblErrorCals.Visible = true; lblErrorCals.Text = "The enrollment period must be a vaild date range."; countErrors++; } else { lblErrorCals.Visible = false; } //Check carrier list for null. if (lstSel.Items.Count <= 0) { lblErrorCarriers.Visible = true; lblErrorCarriers.Text = "Please select at least one, and as many as six carriers."; countErrors++; } else { lblErrorCarriers.Visible = false; } //Check coverage requirements. if (!chkDental.Checked && !chkDisability.Checked && !chkLife.Checked && !chkMedical.Checked && !chkVision.Checked) { lblErrorCoverages.Visible = true; lblErrorCoverages.Text = "Please select at least one type of coverage."; countErrors++; } else { lblErrorCoverages.Visible = false; } //Check Contact Details if (txtAddress.Text.Equals("") || txtCity.Equals("") || txtFax.Equals("") || txtGroupName.Equals("") || txtPhone.Equals("") || txtState.Equals("") || txtZip.Equals("")) { lblErrorContactInfo.Visible = true; lblErrorContactInfo.Text = "Please fill in the contact information."; countErrors++; } else { lblErrorContactInfo.Visible = false; } //Finally, submit if no fatal errors occured. if (countErrors == 0) { //Submit form, process. Guid myNewClient = System.Guid.NewGuid(); //Insert client record and contact. eappdb.uspInsertClient(myNewClient, (Guid)(Session["BrokerID"]), txtGroupName.Text, txtTaxID.Text); eappdb.uspInsertClientInfo(System.Guid.NewGuid(), myNewClient, txtPhone.Text, txtFax.Text, txtAddress.Text, txtCity.Text, txtState.Text, txtZip.Text); //Insert client coverage options eappdb.uspInsertClientOptions(System.Guid.NewGuid(), myNewClient, chkMedical.Checked, chkDental.Checked, chkLife.Checked, chkVision.Checked, chkDisability.Checked); //Insert client carriers foreach (ListItem li in lstSel.Items) { eappdb.uspInsertClientCarrier(System.Guid.NewGuid(), myNewClient, li.Text.ToUpper()); } //Add the web user eappsec.uspInsertWebUser(System.Guid.NewGuid(), myNewClient, txtLogin.Text, txtPassword.Text); //Redirect the user to the home page with query string. Response.Redirect("~/BrokerAdmin/Welcome.aspx", true); } }
protected void fillPdf() { ElectronicAppDBDataContext eappdb = new ElectronicAppDBDataContext(); if (Session["UserID"] == null) { Response.Redirect("~/Default.aspx?timeout=1", false); } FillPDF myPDF = new FillPDF(Server.MapPath("~/NebraskaApp/App/")); if (Session["EmployeeData"] != null) { employeeData myEmployeeData = (employeeData)Session["EmployeeData"]; myPDF.fillEmployeeData(myEmployeeData); } #region Fill Waiver Sections if (Session["UserID"] == null) { Response.Redirect("~/Default.aspx?timeout=1", false); } if (Session["Coverage"] != null && Session["CoverageOffered"] != null) { Coverage myCoverage = (Coverage)Session["Coverage"]; coverageOffered myOffered = (coverageOffered)Session["CoverageOffered"]; if (myOffered.IsMedical) { if (myCoverage.isWaiving("Medical")) { DeclineReason myReason = (DeclineReason)Session["ReasonForDeclineHealth"]; myPDF.FillOutReasons(myReason, myCoverage, "Medical"); } } if (myOffered.IsDental) { if (myCoverage.isWaiving("Dental")) { DeclineReason myReason = (DeclineReason)Session["ReasonForDeclineDental"]; myPDF.FillOutReasons(myReason, myCoverage, "Dental"); } } if (myOffered.IsLife) { if (myCoverage.isWaiving("Life")) { DeclineReason myReason = (DeclineReason)Session["ReasonForDeclineLife"]; myPDF.FillOutReasons(myReason, myCoverage, "Life"); } } if (myOffered.IsVision) { if (myCoverage.isWaiving("Vision")) { DeclineReason myReason = (DeclineReason)Session["ReasonForDeclineVision"]; myPDF.FillOutReasons(myReason, myCoverage, "Vision"); } } if (myOffered.IsDisability) { if (myCoverage.isWaiving("Disability")) { DeclineReason myReason = (DeclineReason)Session["ReasonForDeclineDisability"]; myPDF.FillOutReasons(myReason, myCoverage, "Disability"); } } } #endregion if (Session["UserID"] == null) { Response.Redirect("~/Default.aspx?timeout=1", false); } if (Session["Coverage"] != null) { Coverage myCoverage = (Coverage)Session["Coverage"]; myPDF.FillSelectedCoverage(myCoverage); } #region Fill Dependents if (Session["Dependents"] != null) { Dependents myDepenedents = (Dependents)Session["Dependents"]; myPDF.FillDependentData(myDepenedents); } #endregion #region Fill Other Coverage if (Session["UserID"] == null) { Response.Redirect("~/Default.aspx?timeout=1", false); } if (Session["MedicareCoverage"] != null) { MedicareCoverage myMedicare = (MedicareCoverage)Session["MedicareCoverage"]; myPDF.FillMedicare(myMedicare); } if (Session["ConcurrentCoverage"] != null) { ConcurrentCoverage myCC = (ConcurrentCoverage)Session["ConcurrentCoverage"]; myPDF.FillConcurrent(myCC); } else { myPDF.FillConcurrent(); } if (Session["PreviousCoverage"] != null) { PreviousCoverage myPrevious = (PreviousCoverage)Session["PreviousCoverage"]; myPDF.FillPrevious(myPrevious); } else { myPDF.FillPrevious(); } if (Session["LifeBeneficiaries"] != null) { LifeBeneficiaries myBeneficiaries = (LifeBeneficiaries)Session["LifeBeneficiaries"]; myPDF.FillBeneficiaries(myBeneficiaries); } #endregion #region Fill Health Information if (Session["UserID"] == null) { Response.Redirect("~/Default.aspx?timeout=1", false); } if (Session["HealthInformationAnswers"] != null) { HealthInformationAnswers myHealth = (HealthInformationAnswers)Session["HealthInformationAnswers"]; myPDF.FillHealthInformation(myHealth); } #endregion #region fill employer info ElectronicAppDBDataContext db = new ElectronicAppDBDataContext(); uspGetClientContactResult myEmployerInfo = db.uspGetClientContact((Guid)Session["ClientID"]).First<uspGetClientContactResult>(); myPDF.fillEmployerData(myEmployerInfo, (uspGetClientByIDResult)Session["Client"]); #endregion #region Fill Health Statements if (Session["UserID"] == null) { Response.Redirect("~/Default.aspx?timeout=1", false); } if (Session["HealthStatements"] != null) { HealthStatements myStatements = (HealthStatements)Session["HealthStatements"]; myPDF.FillHealthStatements(myStatements); } #endregion Guid clientID = (Guid)(Session["ClientID"]); System.Collections.Generic.List<String> lstCarriers = new System.Collections.Generic.List<String>(); foreach (uspGetClientCarriersResult carrier in eappdb.uspGetClientCarriers(clientID)) { lstCarriers.Add(carrier.carrierName); } myPDF.fillCarriers(lstCarriers); myPDF.close(); myPDF.addAdditionalPages(); ByteBuffer filledPDF = myPDF.GetFilledPDFFlattened(); Session.Add("Buffer", filledPDF); ByteBuffer unflattened = myPDF.GetFilledPDFUnflattened(); Session.Add("PDF", unflattened); }
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); } } }
protected void UserWizard1_NextButtonClick(object sender, EventArgs e) { //Handle saving data the old way. #region Basic Info if (UserWizard1.ActiveStepIndex == 0) { if (Session["ClientID"] == null && Session["UserID"] == null) { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("~/Default.aspx?timeout=1"); } else { Guid ClientID = (Guid)Session["ClientID"]; Guid UserID = (Guid)Session["UserID"]; ElectronicAppDBDataContext eappdata = new ElectronicAppDBDataContext(); //eappdata.uspDoesEnrolleeExist(ClientID, txtFirstName, txtLastName, txtBirthDate); List<uspDoesEnrolleeExistResult> myResult = eappdata.uspDoesEnrolleeExist(ClientID, txtFirstName.Text, txtLastName.Text, txtMonth.Text + "/" + txtDay.Text + "/" + txtYear.Text).ToList<uspDoesEnrolleeExistResult>(); if (myResult.Count > 0) { Session["UserID"] = myResult[0].EnrolleeID; } else { eappdata.uspInsertEnrollee(UserID, ClientID, txtFirstName.Text, txtLastName.Text, txtMonth.Text + "/" + txtDay.Text + "/" + txtYear.Text, false, Request.UserHostAddress.ToString()); } employeeData myData = new employeeData(); myData.EmployeeName = txtFirstName.Text + " " + txtLastName.Text; myData.DOB = txtMonth.Text + "/" + txtDay.Text + "/" + txtYear.Text; if (cmbWaive.Text.Equals("Yes", StringComparison.CurrentCultureIgnoreCase)) { myData.WaiveAll = true; Session.Add("EmployeeData", myData); UserWizard1.ActiveStepIndex = 2; } else { myData.WaiveAll = false; Session.Add("EmployeeData", myData); } } } #endregion #region Employee Data else if (UserWizard1.ActiveStepIndex == 1) { if (Session["UserID"] != null && Session["ClientID"] != null && Session["EmployeeData"] != null) { employeeData myData = (employeeData)Session["EmployeeData"]; myData.HomeAddress = txtAddress.Text; myData.City = txtCity.Text; myData.State = txtState.Text; myData.Zip = txtZip.Text; myData.HomePhone = txtHomePhone.Text + "-" + txtHomePhone0.Text + "-" + txtHomePhone1.Text; myData.WorkPhone = txtWorkPhone.Text + "-" + txtWorkPhone0.Text + "-" + txtWorkPhone1.Text; myData.Email = txtEmail.Text; // myData.DOB = txtDOB.Text; myData.Height = txtHeight.Text; myData.Weight = txtWeight.Text; myData.Soc = txtSoc.Text + "-" + txtSoc0.Text + "-" + txtSoc1.Text; myData.JobTitle = txtTitle.Text; myData.DOH = txtHireDate.Text; myData.AvgHours = txtHours.Text; myData.Salary = txtSalary.Text; myData.EmploymentStatus = cmbStatus.SelectedValue; myData.MaritalStatus = cmbMaritalStatus.SelectedValue; myData.NumChildren = int.Parse(cmbChildren.SelectedValue); myData.PrimaryPhysician = txtPhysician.Text; if (cmbMedicare.SelectedValue.ToUpper() == "YES") { myData.Medicare = true; } else { myData.Medicare = false; } if (cmbDisabled.SelectedValue.ToUpper() == "YES") { myData.Disabled = true; } else { myData.Disabled = false; } if (cmbGender.SelectedValue.ToUpper() == "MALE") { myData.Gender = "male"; } else { myData.Gender = "female"; } Session["EmployeeData"] = myData; } else { Response.Redirect("~/Default.aspx?timeout=1", false); } } #endregion #region Coverage Selection else if (UserWizard1.ActiveStepIndex == 2) { if (Session["UserID"] != null) { if (Session["EmployeeData"] != null && Session["CoverageOffered"] != null) { employeeData myEmployeeData = (employeeData)Session["EmployeeData"]; Coverage myCoverage = new Coverage(myEmployeeData.WaiveAll); coverageOffered myCoverageOffered = (coverageOffered)Session["CoverageOffered"]; if (myCoverageOffered.IsMedical) { myCoverage.addCoverageItem(new CoverageItem("Medical", cmbMedical.SelectedValue.ToLower(), myEmployeeData.IsSingle, myEmployeeData.IsChildren)); } if (myCoverageOffered.IsDental) { myCoverage.addCoverageItem(new CoverageItem("Dental", cmbDental.SelectedValue.ToLower(), myEmployeeData.IsSingle, myEmployeeData.IsChildren)); } if (myCoverageOffered.IsVision) { myCoverage.addCoverageItem(new CoverageItem("Vision", cmbVision.SelectedValue.ToLower(), myEmployeeData.IsSingle, myEmployeeData.IsChildren)); } if (myCoverageOffered.IsLife) { myCoverage.addCoverageItem(new CoverageItem("Life", cmbLife.SelectedValue.ToLower(), myEmployeeData.IsSingle, myEmployeeData.IsChildren)); } if (myCoverageOffered.IsDisability) { myCoverage.addCoverageItem(new CoverageItem("Disability", cmbDisability.SelectedValue.ToLower(), myEmployeeData.IsSingle, myEmployeeData.IsChildren)); } if ((!myCoverageOffered.IsMedical || cmbMedical.SelectedValue.ToLower() == "waive") && (!myCoverageOffered.IsDental || cmbDental.SelectedValue.ToLower() == "waive") && (!myCoverageOffered.IsDisability || cmbDisability.SelectedValue.ToLower() == "waive") && (!myCoverageOffered.IsVision || cmbVision.SelectedValue.ToLower() == "waive") && (!myCoverageOffered.IsLife || cmbLife.SelectedValue.ToLower() == "waive")) { //myEmployeeData.WaiveAll = true; myCoverage.IsWaiveAll = true; } if (Session["Coverage"] != null) { Session["Coverage"] = myCoverage; } else { Session.Add("Coverage", myCoverage); } if (myCoverage.isWaiving("Medical")) { UserWizard1.ActiveStepIndex = 4; } else if (myCoverage.isWaiving("Dental")) { UserWizard1.ActiveStepIndex = 5; } else if (myCoverage.isWaiving("Vision")) { UserWizard1.ActiveStepIndex = 6; } else if (myCoverage.isWaiving("Life")) { UserWizard1.ActiveStepIndex = 7; } else if (myCoverage.isWaiving("Disability")) { UserWizard1.ActiveStepIndex = 8; } else { bool isSpouseCovered = false; bool isChildrenCovered = false; if (!myEmployeeData.IsSingle) { isSpouseCovered = myCoverage.isSpouseCovered(); } if (myEmployeeData.IsChildren) { isChildrenCovered = myCoverage.isChildCovered(); } if (isSpouseCovered || isChildrenCovered) { //Do Nothing. Wizard will procede to Step 3 normally. } else { UserWizard1.ActiveStepIndex = 9; } } } else { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("~/Default.aspx?timeout=1"); } } else { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("~/Default.aspx?timeout=1"); } } #endregion #region Dependent Data else if (UserWizard1.ActiveStepIndex == 3) { if (Session["UserID"] != null) { Dependents myDependents = new Dependents(); if (isSpouse.Value.Equals("1")) { Dependent myDependent = new Dependent(); myDependent.IsSpouse = true; myDependent.Name = spName.Text; if (spGender.Text.ToLower().Equals("male")) { myDependent.Gender = 'M'; } else if (spGender.Text.ToLower().Equals("female")) { myDependent.Gender = 'F'; } myDependent.Height = spHeight.Text; myDependent.Weight = spWeight.Text; myDependent.DOB = spDOB.Text; myDependent.SSN = spSSN.Text; myDependent.PrimaryCarePhysician = spPhysician.Text; if (spStudent.Text.ToLower().Equals("yes")) { myDependent.Student = true; } else { myDependent.Student = false; } if (spMedicare.Text.ToLower().Equals("yes")) { myDependent.Medicare = true; } else { myDependent.Medicare = false; } if (spSS.Text.ToLower().Equals("yes")) { myDependent.SSEnrolled = true; } else { myDependent.SSEnrolled = false; } myDependents.addDependent(myDependent); } if (!numChildren.Value.Equals("0")) { getChildren(myDependents); } if (Session["Dependents"] != null) { Session["Dependents"] = myDependents; } else { Session.Add("Dependents", myDependents); } UserWizard1.ActiveStepIndex = 9; } } #endregion #region Medical Waive else if (UserWizard1.ActiveStepIndex == 4) { if (Session["UserID"] != null) { if ((Session["EmployeeData"] != null) && (Session["Coverage"] != null)) { bool isSpouseCovered = false; bool isChildrenCovered = false; Coverage myCoverage = (Coverage)Session["Coverage"]; employeeData myData = (employeeData)Session["EmployeeData"]; DeclineReason myReason = saveReasons(); if (Session["ReasonForDeclineHealth"] != null) { Session.Add("ReasonForDeclineHealth", myReason); } else { Session["ReasonForDeclineHealth"] = myReason; } if (!myData.IsSingle) { isSpouseCovered = myCoverage.isSpouseCovered(); } if (myData.IsChildren) { isChildrenCovered = myCoverage.isChildCovered(); } if (myCoverage.isWaiving("Dental")) { UserWizard1.ActiveStepIndex = 5; } else if (myCoverage.isWaiving("Vision")) { UserWizard1.ActiveStepIndex = 6; } else if (myCoverage.isWaiving("Life")) { UserWizard1.ActiveStepIndex = 7; } else if (myCoverage.isWaiving("Disability")) { UserWizard1.ActiveStepIndex = 8; } else if (isSpouseCovered || isChildrenCovered) { UserWizard1.ActiveStepIndex = 3; } else { if (myData.WaiveAll || myCoverage.IsWaiveAll) { UserWizard1.ActiveStepIndex = 12; } else { UserWizard1.ActiveStepIndex = 9; } } } } } #endregion #region Dental Waive else if (UserWizard1.ActiveStepIndex == 5) { if (Session["UserID"] != null) { if ((Session["EmployeeData"] != null) && (Session["Coverage"] != null)) { bool isSpouseCovered = false; bool isChildrenCovered = false; Coverage myCoverage = (Coverage)Session["Coverage"]; employeeData myData = (employeeData)Session["EmployeeData"]; DeclineReason myReason = saveReasons0(); if (Session["ReasonForDeclineDental"] != null) { Session.Add("ReasonForDeclineDental", myReason); } else { Session["ReasonForDeclineDental"] = myReason; } if (!myData.IsSingle) { isSpouseCovered = myCoverage.isSpouseCovered(); } if (myData.IsChildren) { isChildrenCovered = myCoverage.isChildCovered(); } if (myCoverage.isWaiving("Vision")) { UserWizard1.ActiveStepIndex = 6; } else if (myCoverage.isWaiving("Life")) { UserWizard1.ActiveStepIndex = 7; } else if (myCoverage.isWaiving("Disability")) { UserWizard1.ActiveStepIndex = 8; } else if (isSpouseCovered || isChildrenCovered) { UserWizard1.ActiveStepIndex = 3; } else if (isSpouseCovered || isChildrenCovered) { UserWizard1.ActiveStepIndex = 3; } else { if (myData.WaiveAll || myCoverage.IsWaiveAll) { UserWizard1.ActiveStepIndex = 12; } else { UserWizard1.ActiveStepIndex = 9; } } } } } #endregion #region Vison Waive else if (UserWizard1.ActiveStepIndex == 6) { if (Session["UserID"] != null) { if ((Session["EmployeeData"] != null) && (Session["Coverage"] != null)) { bool isSpouseCovered = false; bool isChildrenCovered = false; Coverage myCoverage = (Coverage)Session["Coverage"]; employeeData myData = (employeeData)Session["EmployeeData"]; DeclineReason myReason = saveReasons1(); if (Session["ReasonForDeclineVision"] != null) { Session.Add("ReasonForDeclineVision", myReason); } else { Session["ReasonForDeclineVision"] = myReason; } if (!myData.IsSingle) { isSpouseCovered = myCoverage.isSpouseCovered(); } if (myData.IsChildren) { isChildrenCovered = myCoverage.isChildCovered(); } if (myCoverage.isWaiving("Life")) { UserWizard1.ActiveStepIndex = 7; } else if (myCoverage.isWaiving("Disability")) { UserWizard1.ActiveStepIndex = 8; } else if (isSpouseCovered || isChildrenCovered) { UserWizard1.ActiveStepIndex = 3; } else if (isSpouseCovered || isChildrenCovered) { UserWizard1.ActiveStepIndex = 3; } else { if (myData.WaiveAll || myCoverage.IsWaiveAll) { UserWizard1.ActiveStepIndex = 12; } else { UserWizard1.ActiveStepIndex = 9; } } } } } #endregion #region Life Waive else if (UserWizard1.ActiveStepIndex == 7) { if (Session["UserID"] != null) { if ((Session["EmployeeData"] != null) && (Session["Coverage"] != null)) { bool isSpouseCovered = false; bool isChildrenCovered = false; Coverage myCoverage = (Coverage)Session["Coverage"]; employeeData myData = (employeeData)Session["EmployeeData"]; DeclineReason myReason = saveReasons2(); if (Session["ReasonForDeclineLife"] != null) { Session.Add("ReasonForDeclineLife", myReason); } else { Session["ReasonForDeclineLife"] = myReason; } if (!myData.IsSingle) { isSpouseCovered = myCoverage.isSpouseCovered(); } if (myData.IsChildren) { isChildrenCovered = myCoverage.isChildCovered(); } if (myCoverage.isWaiving("Disability")) { UserWizard1.ActiveStepIndex = 8; } else if (isSpouseCovered || isChildrenCovered) { UserWizard1.ActiveStepIndex = 3; } else { if (myData.WaiveAll || myCoverage.IsWaiveAll) { UserWizard1.ActiveStepIndex = 12; } else { UserWizard1.ActiveStepIndex = 9; } } } } } #endregion #region Disability Waive else if (UserWizard1.ActiveStepIndex == 8) { if (Session["UserID"] != null) { if ((Session["EmployeeData"] != null) && (Session["Coverage"] != null)) { bool isSpouseCovered = false; bool isChildrenCovered = false; Coverage myCoverage = (Coverage)Session["Coverage"]; employeeData myData = (employeeData)Session["EmployeeData"]; DeclineReason myReason = saveReasons3(); if (Session["ReasonForDeclineDisability"] != null) { Session.Add("ReasonForDeclineDisability", myReason); } else { Session["ReasonForDeclineDisability"] = myReason; } if (!myData.IsSingle) { isSpouseCovered = myCoverage.isSpouseCovered(); } if (myData.IsChildren) { isChildrenCovered = myCoverage.isChildCovered(); } if (isSpouseCovered || isChildrenCovered) { UserWizard1.ActiveStepIndex = 3; } else { if (myData.WaiveAll || myCoverage.IsWaiveAll) { UserWizard1.ActiveStepIndex = 12; } else { UserWizard1.ActiveStepIndex = 9; } } } } } #endregion #region Other Coverage else if (UserWizard1.ActiveStepIndex == 9) { if (Session["UserID"] != null) { if (cmbMedicare.SelectedValue.ToLower().Equals("yes")) { MedicareCoverage myMedicare = new MedicareCoverage(); myMedicare.Name = txtMedicareName.Text; myMedicare.ID = txtMedicareID.Text; myMedicare.EffDateA = txtMedicareA.Text; myMedicare.EffDateB = txtMedicareB.Text; myMedicare.EffDateC = txtMedicareC.Text; if (Session["MedicareCoverage"] == null) { Session.Add("MedicareCoverage", myMedicare); } else { Session["MedicareCoverage"] = myMedicare; } } else { if (Session["MedicareCoverage"] != null) { Session.Remove("MedicareCoverage"); } } if (cmbConcurrentCoverage.SelectedValue.ToLower().Equals("yes")) { ConcurrentCoverage myConcurrent = new ConcurrentCoverage(); myConcurrent.Name = txtConcurentName.Text; myConcurrent.Employer = txtConcurrentEmployer.Text; myConcurrent.InsuranceCompanyName = txtConcurrentProvider.Text; myConcurrent.PolicyNo = txtConcurrentPolicy.Text; myConcurrent.EffectiveDate = txtConcurrentEff.Text; myConcurrent.EndDate = txtConcurrentEnd.Text; myConcurrent.IsDental = ckDental.Checked; myConcurrent.IsDisability = ckDisability.Checked; myConcurrent.IsLife = ckLife.Checked; myConcurrent.IsMedical = ckMedical.Checked; myConcurrent.IsVision = ckVision.Checked; if (cmbConcurrentType.SelectedValue.Equals("employee", StringComparison.CurrentCultureIgnoreCase)) { myConcurrent.IsEmployee = true; } else if (cmbConcurrentType.SelectedValue.Equals("employee/child(ren)", StringComparison.CurrentCultureIgnoreCase)) { myConcurrent.IsEmployeeChild = true; } else if (cmbConcurrentType.SelectedValue.Equals("employee/spouse", StringComparison.CurrentCultureIgnoreCase)) { myConcurrent.IsEmployeeSpouse = true; } else if (cmbConcurrentType.SelectedValue.Equals("Employee/Spouse/Child(ren)", StringComparison.CurrentCultureIgnoreCase)) { myConcurrent.IsEmployeeSpouseChild = true; } if (Session["ConcurrentCoverage"] == null) { Session.Add("ConcurrentCoverage", myConcurrent); } else { Session["ConcurrentCoverage"] = myConcurrent; } } else { if (Session["ConcurrentCoverage"] != null) { Session.Remove("ConcurrentCoverage"); } } if (cmbPreviousCoverage.SelectedValue.ToLower().Equals("yes")) { PreviousCoverage myPrevious = new PreviousCoverage(); myPrevious.Names = txtPreviousName.Text; myPrevious.Employer = txtPreviousEmployer.Text; myPrevious.InsuranceCompanyName = txtPreviousProvider.Text; myPrevious.Policy = txtPolicy.Text; myPrevious.EffectiveDate = txtPreviousEff.Text; myPrevious.EndDate = txtPreviousEnd.Text; if (cmbPreviousType.SelectedValue.Equals("employee", StringComparison.CurrentCultureIgnoreCase)) { myPrevious.IsEmployee = true; } else if (cmbPreviousType.SelectedValue.Equals("employee/child(ren)", StringComparison.CurrentCultureIgnoreCase)) { myPrevious.IsEmployeeChild = true; } else if (cmbPreviousType.SelectedValue.Equals("employee/spouse", StringComparison.CurrentCultureIgnoreCase)) { myPrevious.IsEmployeeSpouse = true; } else if (cmbPreviousType.SelectedValue.Equals("Employee/Spouse/Child(ren)", StringComparison.CurrentCultureIgnoreCase)) { myPrevious.IsEmployeeSpouseChild = true; } if (Session["PreviousCoverage"] == null) { Session.Add("PreviousCoverage", myPrevious); } else { Session["PreviousCoverage"] = myPrevious; } } else { if (Session["PreviousCoverage"] != null) { Session.Remove("PreviousCoverage"); } } if (isLife.Value == "1") { LifeBeneficiaries myLife = new LifeBeneficiaries(); myLife.Primary1Name = txtPrimary1Name.Text + ", " + txtPrimary1Addr.Text; myLife.Primary1Percent = txtPrimary1Perc.Text; myLife.Primary1Relationship = txtPrimary1Relation.Text; myLife.Primary1SSN = txtPrimary1SSN.Text; myLife.Primary2Name = txtPrimary2Name.Text + ", " + txtPrimary2Addr.Text; myLife.Primary2Percent = txtPrimary2Perc.Text; myLife.Primary2Relationship = txtPrimary2Relation.Text; myLife.Primary2SSN = txtPrimary2SSN.Text; myLife.Secondary1Name = txtSecondary1Name.Text + ", " + txtSecondary1Addr.Text; myLife.Secondary1Percent = txtSecondary1Perc.Text; myLife.Secondary1Relationship = txtSecondary1Relation.Text; myLife.Secondary1SSN = txtSecondary1SSN.Text; myLife.Secondary2Name = txtSecondary2Name.Text + ", " + txtSecondary2Addr.Text; myLife.Secondary2Percent = txtSecondary2Perc.Text; myLife.Secondary2Relationship = txtSecondary2Relation.Text; myLife.Secondary2SSN = txtSecondary2SSN.Text; if (Session["LifeBeneficiaries"] == null) { Session.Add("LifeBeneficiaries", myLife); } else { Session["LifeBeneficiaries"] = myLife; } } else { if (Session["LifeBeneficiaries"] != null) { Session.Remove("LifeBeneficiaries"); } } } } #endregion #region Health Information else if (UserWizard1.ActiveStepIndex == 10) { bool hasCondition = false; HealthInformationAnswers myAnswers = new HealthInformationAnswers(); foreach (System.Web.UI.WebControls.ListItem li in CheckBoxList1.Items) { if (li.Selected) { myAnswers.addAnswer(li); hasCondition = true; } } foreach (System.Web.UI.WebControls.ListItem li in CheckBoxList3.Items) { if (li.Selected) { myAnswers.addAnswer(li); hasCondition = true; } } if (txtDueDate.Text != "") { myAnswers.DueData = txtDueDate.Text; } else { myAnswers.DueData = ""; } if (Q32.Text.ToLower().Equals("yes")) { System.Web.UI.WebControls.ListItem li = new System.Web.UI.WebControls.ListItem("32. Have you or any of your dependents recieved inpatiant or outpatient services in the last 3 years (excluding routine tests, physicals or inoculations)?", "Q32", true); li.Selected = true; myAnswers.addAnswer(li); myAnswers.Q32 = true; hasCondition = true; } if (Q33.Text.ToLower().Equals("yes")) { System.Web.UI.WebControls.ListItem li = new System.Web.UI.WebControls.ListItem("33. Do you or any person named in this application have tests, treatments, hospitalization or surgery planned or recommended in the future?", "Q33", true); li.Selected = true; myAnswers.addAnswer(li); myAnswers.Q33 = true; hasCondition = true; } if (Q34.Text.ToLower().Equals("yes")) { System.Web.UI.WebControls.ListItem li = new System.Web.UI.WebControls.ListItem("34. Do you or any person named in this application take any medicine, prescription drugs or require shots/injections?", "Q34", true); li.Selected = true; myAnswers.addAnswer(li); myAnswers.Q34 = true; hasCondition = true; } if (Q35.Text.ToLower().Equals("yes")) { System.Web.UI.WebControls.ListItem li = new System.Web.UI.WebControls.ListItem("35. Do you or any person named in this application have any other medical conditions which have not yet been previously mentioned?", "Q35", true); li.Selected = true; myAnswers.addAnswer(li); myAnswers.Q35 = true; hasCondition = true; } Session.Add("HealthInformationAnswers", myAnswers); if (!hasCondition) { if (Session["HealthStatements"] != null) { Session.Remove("HealthStatements"); } UserWizard1.ActiveStepIndex = 12; } else { //Response.Redirect("~/NebraskaApp/HealthExplanations.aspx", false); HealthStatements hs = new HealthStatements(); HealthStatement mystatem = new HealthStatement(); mystatem.Condition = "Text"; mystatem.DateDiagnosed = "Date"; mystatem.DateLastTreated = "Date"; mystatem.IsMedication = false; mystatem.Name = "Foo"; mystatem.Question = "Question?"; mystatem.QuestionNum = "1a"; mystatem.Recovery = "sdfshjdlkf"; mystatem.RowID = 1; mystatem.TreatmentType = "jdflskdj"; //hs.addStatement(mystatem); if (Session["HealthStatements"] == null) { Session.Add("HealthStatements", hs); } ObjectDataSource1.Select(); } } #endregion #region Health Explanations else if (UserWizard1.ActiveStepIndex == 11) { HealthStatements myStatements = new HealthStatements(); /*foreach (KeyValuePair<int, string> id in ControlIdList) { DynamicTableControl control = (DynamicTableControl)m_controls[id.Key]; foreach (int id2 in control.RowIdList) { RowControl r = (RowControl)control.MyRows[id2]; HealthStatement myStatement = r.getHealthStatement(); myStatement.QuestionNum = id.Value.Split('.')[0]; myStatement.Question = id.Value; myStatement.RowID = id2; myStatements.addStatement(myStatement); } }*/ if (Session["HealthStatements"] != null) { //Session.Add("HealthStatements", myStatements); } else { //Session["HealthStatements"] = myStatements; } } #endregion #region Processing else if (UserWizard1.ActiveStepIndex == 12) { fillPdf(); } #endregion #region Review And Sign else if (UserWizard1.ActiveStepIndex == 13) { //Simply pass control to next step. } #endregion }
protected void fillPdf() { ElectronicAppDBDataContext eappdb = new ElectronicAppDBDataContext(); if (Session["UserID"] == null) { Response.Redirect("~/Default.aspx?timeout=1", false); } FillPDF myPDF = new FillPDF(Server.MapPath("~/NebraskaApp/App/")); if (Session["EmployeeData"] != null) { employeeData myEmployeeData = (employeeData)Session["EmployeeData"]; myPDF.fillEmployeeData(myEmployeeData); } #region Fill Waiver Sections if (Session["UserID"] == null) { Response.Redirect("~/Default.aspx?timeout=1", false); } if (Session["Coverage"] != null && Session["CoverageOffered"] != null) { Coverage myCoverage = (Coverage)Session["Coverage"]; coverageOffered myOffered = (coverageOffered)Session["CoverageOffered"]; if (myOffered.IsMedical) { if (myCoverage.isWaiving("Medical")) { DeclineReason myReason = (DeclineReason)Session["ReasonForDeclineHealth"]; myPDF.FillOutReasons(myReason, myCoverage, "Medical"); } } if (myOffered.IsDental) { if (myCoverage.isWaiving("Dental")) { DeclineReason myReason = (DeclineReason)Session["ReasonForDeclineDental"]; myPDF.FillOutReasons(myReason, myCoverage, "Dental"); } } if (myOffered.IsLife) { if (myCoverage.isWaiving("Life")) { DeclineReason myReason = (DeclineReason)Session["ReasonForDeclineLife"]; myPDF.FillOutReasons(myReason, myCoverage, "Life"); } } if (myOffered.IsVision) { if (myCoverage.isWaiving("Vision")) { DeclineReason myReason = (DeclineReason)Session["ReasonForDeclineVision"]; myPDF.FillOutReasons(myReason, myCoverage, "Vision"); } } if (myOffered.IsDisability) { if (myCoverage.isWaiving("Disability")) { DeclineReason myReason = (DeclineReason)Session["ReasonForDeclineDisability"]; myPDF.FillOutReasons(myReason, myCoverage, "Disability"); } } } #endregion if (Session["UserID"] == null) { Response.Redirect("~/Default.aspx?timeout=1", false); } if (Session["Coverage"] != null) { Coverage myCoverage = (Coverage)Session["Coverage"]; myPDF.FillSelectedCoverage(myCoverage); } #region Fill Dependents if (Session["Dependents"] != null) { Dependents myDepenedents = (Dependents)Session["Dependents"]; myPDF.FillDependentData(myDepenedents); } #endregion #region Fill Other Coverage if (Session["UserID"] == null) { Response.Redirect("~/Default.aspx?timeout=1", false); } if (Session["MedicareCoverage"] != null) { MedicareCoverage myMedicare = (MedicareCoverage)Session["MedicareCoverage"]; myPDF.FillMedicare(myMedicare); } if (Session["ConcurrentCoverage"] != null) { ConcurrentCoverage myCC = (ConcurrentCoverage)Session["ConcurrentCoverage"]; myPDF.FillConcurrent(myCC); } else { myPDF.FillConcurrent(); } if (Session["PreviousCoverage"] != null) { PreviousCoverage myPrevious = (PreviousCoverage)Session["PreviousCoverage"]; myPDF.FillPrevious(myPrevious); } else { myPDF.FillPrevious(); } if (Session["LifeBeneficiaries"] != null) { LifeBeneficiaries myBeneficiaries = (LifeBeneficiaries)Session["LifeBeneficiaries"]; myPDF.FillBeneficiaries(myBeneficiaries); } #endregion #region Fill Health Information if (Session["UserID"] == null) { Response.Redirect("~/Default.aspx?timeout=1", false); } if (Session["HealthInformationAnswers"] != null) { HealthInformationAnswers myHealth = (HealthInformationAnswers)Session["HealthInformationAnswers"]; myPDF.FillHealthInformation(myHealth); } #endregion #region fill employer info ElectronicAppDBDataContext db = new ElectronicAppDBDataContext(); uspGetClientContactResult myEmployerInfo = db.uspGetClientContact((Guid)Session["ClientID"]).First <uspGetClientContactResult>(); myPDF.fillEmployerData(myEmployerInfo, (uspGetClientByIDResult)Session["Client"]); #endregion #region Fill Health Statements if (Session["UserID"] == null) { Response.Redirect("~/Default.aspx?timeout=1", false); } if (Session["HealthStatements"] != null) { HealthStatements myStatements = (HealthStatements)Session["HealthStatements"]; myPDF.FillHealthStatements(myStatements); } #endregion Guid clientID = (Guid)(Session["ClientID"]); System.Collections.Generic.List <String> lstCarriers = new System.Collections.Generic.List <String>(); foreach (uspGetClientCarriersResult carrier in eappdb.uspGetClientCarriers(clientID)) { lstCarriers.Add(carrier.carrierName); } myPDF.fillCarriers(lstCarriers); myPDF.close(); myPDF.addAdditionalPages(); ByteBuffer filledPDF = myPDF.GetFilledPDFFlattened(); Session.Add("Buffer", filledPDF); ByteBuffer unflattened = myPDF.GetFilledPDFUnflattened(); Session.Add("PDF", unflattened); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["BrokerID"] != null) { Guid myBrokerID = (Guid)Session["BrokerID"]; try { ElectronicAppDBDataContext electronicAppDB = new ElectronicAppDBDataContext(); uspGetBrokerByIDResult myBroker = electronicAppDB.uspGetBrokerByID(myBrokerID).Single<uspGetBrokerByIDResult>(); uspGetBrokerContactResult myBrokerInfo = electronicAppDB.uspGetBrokerContact(myBroker.BrokerID).Single<uspGetBrokerContactResult>(); //string ClientName = myClient.EmployerName; header.InnerHtml = "<span class=\"red\">Welcome, </span> " + myBroker.FirstName + " " + myBroker.LastName; BrokerName.InnerHtml = myBroker.FirstName + " " + myBroker.LastName; BrokerEmail.InnerHtml = myBrokerInfo.Email; BrokerPhone.InnerHtml = myBrokerInfo.PhoneNumber; BrokerFax.InnerHtml = myBrokerInfo.Fax; BrokerAddress.InnerHtml = myBrokerInfo.Address + "<br />" + myBrokerInfo.City + " " + myBrokerInfo.State + ", " + myBrokerInfo.Zip; ElectronicAppStorageDBDataContext eappstor = new ElectronicAppStorageDBDataContext(); System.Collections.Generic.List<uspGetBrokerImageByOwnerIDResult> searches = eappstor.uspGetBrokerImageByOwnerID(myBroker.BrokerID).ToList<uspGetBrokerImageByOwnerIDResult>(); bool hasImage = searches.Count > 0; if (hasImage) { Image1.ImageUrl = "/BrokerImages/Broker.ashx?id=" + myBrokerID.ToString(); } List<uspGetClientListByOwnerIDResult> myClients = electronicAppDB.uspGetClientListByOwnerID(myBrokerID).ToList<uspGetClientListByOwnerIDResult>(); ListItem s = new ListItem("(Select)","na"); DropDownList1.Items.Add(s); foreach (uspGetClientListByOwnerIDResult client in myClients) { ListItem newitem = new ListItem((String)client.EmployerName, client.ClientID.ToString()); DropDownList1.Items.Add(newitem); } //Session.Add("Client", myClient); //ClientName = electronicAppDB.uspGetBrokerByID(myClient.OwnerID).Single<uspGetBrokerByIDResult>(). } catch (Exception ex) { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("Default.aspx", false); } } else { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("~/Default.aspx", false); } } }
protected void btnAdd_Click(object sender, EventArgs e) { ElectronicAppDBDataContext eappdb = new ElectronicAppDBDataContext(); ElectronicAppSecurityDBDataContext eappsec = new ElectronicAppSecurityDBDataContext(); int countErrors = 0; //Check password length and equality. if (!txtPassword.Text.Equals(txtPassword2.Text) || txtPassword.Text.Length < 4 || txtLogin.Text.Equals("")) { lblErrorCredentials.Visible = true; lblErrorCredentials.Text = "Username or password is invalid, or passwords do not match."; countErrors++; } else { lblErrorCredentials.Visible = false; } if (eappsec.uspCheckUsername(txtLogin.Text).ToList<uspCheckUsernameResult>().Count > 0) { lblErrorTaken.Visible = true; lblErrorTaken.Text = "Please choose a different username, the one you provided is in use."; countErrors++; } else { lblErrorTaken.Visible = false; } //Check calendar range. if (!(calBeginPeriod.SelectedDate.CompareTo(calEndPeriod.SelectedDate) < 0)) { lblErrorCals.Visible = true; lblErrorCals.Text = "The enrollment period must be a vaild date range."; countErrors++; } else { lblErrorCals.Visible = false; } //Check carrier list for null. if (lstSel.Items.Count <= 0) { lblErrorCarriers.Visible = true; lblErrorCarriers.Text = "Please select at least one, and as many as six carriers."; countErrors++; } else { lblErrorCarriers.Visible = false; } //Check coverage requirements. if (!chkDental.Checked && !chkDisability.Checked && !chkLife.Checked && !chkMedical.Checked && !chkVision.Checked) { lblErrorCoverages.Visible = true; lblErrorCoverages.Text = "Please select at least one type of coverage."; countErrors++; } else { lblErrorCoverages.Visible = false; } //Check Contact Details if ( txtAddress.Text.Equals("") || txtCity.Equals("") || txtFax.Equals("") || txtGroupName.Equals("") || txtPhone.Equals("") || txtState.Equals("") || txtZip.Equals("") ) { lblErrorContactInfo.Visible = true; lblErrorContactInfo.Text = "Please fill in the contact information."; countErrors++; } else { lblErrorContactInfo.Visible = false; } //Finally, submit if no fatal errors occured. if (countErrors == 0) { //Submit form, process. Guid myNewClient = System.Guid.NewGuid(); //Insert client record and contact. eappdb.uspInsertClient( myNewClient, (Guid)(Session["BrokerID"]), txtGroupName.Text, txtTaxID.Text); eappdb.uspInsertClientInfo(System.Guid.NewGuid(), myNewClient, txtPhone.Text, txtFax.Text, txtAddress.Text, txtCity.Text, txtState.Text, txtZip.Text); //Insert client coverage options eappdb.uspInsertClientOptions( System.Guid.NewGuid(), myNewClient, chkMedical.Checked, chkDental.Checked, chkLife.Checked, chkVision.Checked,chkDisability.Checked); //Insert client carriers foreach ( ListItem li in lstSel.Items ) { eappdb.uspInsertClientCarrier( System.Guid.NewGuid(), myNewClient, li.Text.ToUpper() ); } //Add the web user eappsec.uspInsertWebUser(System.Guid.NewGuid(), myNewClient, txtLogin.Text, txtPassword.Text); //Redirect the user to the home page with query string. Response.Redirect("~/BrokerAdmin/Welcome.aspx", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["BrokerID"] != null) { Guid myBrokerID = (Guid)Session["BrokerID"]; try { ElectronicAppDBDataContext electronicAppDB = new ElectronicAppDBDataContext(); uspGetBrokerByIDResult myBroker = electronicAppDB.uspGetBrokerByID(myBrokerID).Single <uspGetBrokerByIDResult>(); uspGetBrokerContactResult myBrokerInfo = electronicAppDB.uspGetBrokerContact(myBroker.BrokerID).Single <uspGetBrokerContactResult>(); //string ClientName = myClient.EmployerName; header.InnerHtml = "<span class=\"red\">Welcome, </span> " + myBroker.FirstName + " " + myBroker.LastName; BrokerName.InnerHtml = myBroker.FirstName + " " + myBroker.LastName; BrokerEmail.InnerHtml = myBrokerInfo.Email; BrokerPhone.InnerHtml = myBrokerInfo.PhoneNumber; BrokerFax.InnerHtml = myBrokerInfo.Fax; BrokerAddress.InnerHtml = myBrokerInfo.Address + "<br />" + myBrokerInfo.City + " " + myBrokerInfo.State + ", " + myBrokerInfo.Zip; ElectronicAppStorageDBDataContext eappstor = new ElectronicAppStorageDBDataContext(); System.Collections.Generic.List <uspGetBrokerImageByOwnerIDResult> searches = eappstor.uspGetBrokerImageByOwnerID(myBroker.BrokerID).ToList <uspGetBrokerImageByOwnerIDResult>(); bool hasImage = searches.Count > 0; if (hasImage) { Image1.ImageUrl = "/BrokerImages/Broker.ashx?id=" + myBrokerID.ToString(); } List <uspGetClientListByOwnerIDResult> myClients = electronicAppDB.uspGetClientListByOwnerID(myBrokerID).ToList <uspGetClientListByOwnerIDResult>(); ListItem s = new ListItem("(Select)", "na"); DropDownList1.Items.Add(s); foreach (uspGetClientListByOwnerIDResult client in myClients) { ListItem newitem = new ListItem((String)client.EmployerName, client.ClientID.ToString()); DropDownList1.Items.Add(newitem); } //Session.Add("Client", myClient); //ClientName = electronicAppDB.uspGetBrokerByID(myClient.OwnerID).Single<uspGetBrokerByIDResult>(). } catch (Exception ex) { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("Default.aspx", false); } } else { Session.Abandon(); FormsAuthentication.SignOut(); Response.Redirect("~/Default.aspx", false); } } }
protected void Page_Init(object sender, EventArgs e) { ElectronicAppDBDataContext eappdb = new ElectronicAppDBDataContext(); foreach ( uspGetCarrierOptionsResult carrier in eappdb.uspGetCarrierOptions() ) { lstAvail.Items.Add(new ListItem(carrier.Name)); } }
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); } } }