Exemplo n.º 1
0
        // 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);
                }
            }
        }
Exemplo n.º 2
0
        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);
                }
            }
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        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;
            }
        }
Exemplo n.º 5
0
        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);
                }
            }
        }
Exemplo n.º 6
0
        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);
                }
            }
        }