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