private void btnSave_Click(object sender, EventArgs e)
        {
            BusinessClient bc = new BusinessClient();

            bc.CompanyName    = txtCompanyName.Text;
            bc.PointOfContact = txtPointOfContact.Text;
            bc.Address1       = txtAddressOne.Text;
            bc.Address2       = txtAddressTwo.Text;
            bc.City           = txtCity.Text;
            bc.State          = cbxState.Text;
            bc.Zip            = txtZip.Text;
            bc.Phone          = txtPhone.Text;
            bc.Email          = txtEmail.Text;

            BusinessClientMgr bcMgr = new BusinessClientMgr();

            bcMgr.StoreNewBusinessClient(bc);

            AssignmentForm assignForm = (AssignmentForm)Owner;

            assignForm.UpdateBusinessClientFromBusinessClientForm(txtCompanyName.Text, txtPointOfContact.Text, txtAddressOne.Text, txtAddressTwo.Text, txtCity.Text, cbxState.Text, txtZip.Text, txtPhone.Text, txtEmail.Text);

            AfterTheSave();

            Close();
        }
        private void RetrieveBusinessClient()
        {
            string   storageFile     = Path.Combine(Environment.CurrentDirectory, "BusinessClient.bin");
            FileInfo storageFileInfo = new FileInfo(storageFile);

            if (storageFileInfo.Exists == true)
            {
                BusinessClient    bc    = new BusinessClient();
                BusinessClientMgr bcMgr = new BusinessClientMgr();
                bc = bcMgr.RetrieveBusinessClient(bc);

                lblCompany.Text        = bc.CompanyName;
                lblPointOfContact.Text = bc.PointOfContact;
                lblAddressOne.Text     = bc.Address1;
                lblAddressTwo.Text     = bc.Address2;
                lblCity.Text           = bc.City;
                lblState.Text          = bc.State;
                lblZip.Text            = bc.Zip;
                lblPhone.Text          = bc.Phone;
                lblEmail.Text          = bc.Email;
            }
            else
            {
                lblCompany.Text = "File Not Found. Create A New File.";
            }
        }
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        BusinessClient bc = new BusinessClient();

        bc.Id = Convert.ToInt32(Session["id"]);

        BusinessClientMgr bcMgr = new BusinessClientMgr();

        bcMgr.DeleteBusinessClient(bc);

        Server.Transfer("BCProfileDeleted.aspx");
    }
        private void btnRetrieve_Click(object sender, EventArgs e)
        {
            BusinessClient    bc    = new BusinessClient();
            BusinessClientMgr bcMgr = new BusinessClientMgr();

            bc = bcMgr.RetrieveBusinessClient(bc);

            txtCompanyName.Text    = bc.CompanyName;
            txtPointOfContact.Text = bc.PointOfContact;
            txtAddressOne.Text     = bc.Address1;
            txtAddressTwo.Text     = bc.Address2;
            txtCity.Text           = bc.City;
            cbxState.Text          = bc.State;
            txtZip.Text            = bc.Zip;
            txtPhone.Text          = bc.Phone;
            txtEmail.Text          = bc.Email;
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        BusinessClient    bc    = new BusinessClient();
        BusinessClientMgr bcMgr = new BusinessClientMgr();

        bc = bcMgr.QueryBusinessClient(bc);

        Session.Add("id", bc.Id);
        lblCompanyName.Text = String.Format("{0}", bc.CompanyName);
        lblPOC.Text         = String.Format("{0}", bc.PointOfContact);
        lblADdressOne.Text  = String.Format("{0}", bc.Address1);
        lblAddressTwo.Text  = String.Format("{0}", bc.Address2);
        lblCity.Text        = String.Format("{0}", bc.City);
        lblState.Text       = String.Format("{0}", bc.State);
        lblZip.Text         = String.Format("{0}", bc.Zip);
        lblPhone.Text       = String.Format("{0}", bc.Phone);
        lblEmail.Text       = String.Format("{0}", bc.Email);
    }
Example #6
0
    protected void btnCreate_Click(object sender, EventArgs e)
    {
        BusinessClient bc = new BusinessClient();

        bc.CompanyName    = txtCompany.Text;
        bc.PointOfContact = txtPOC.Text;
        bc.Address1       = txtAddressOne.Text;
        bc.Address2       = txtAddressTwo.Text;
        bc.City           = txtCity.Text;
        bc.State          = ddlStateList.SelectedValue;
        bc.Zip            = txtZip.Text;
        bc.Email          = txtEmail.Text;
        bc.Phone          = txtPhone.Text;

        BusinessClientMgr bcMgr = new BusinessClientMgr();

        bcMgr.StoreNewBusinessClient(bc);

        Server.Transfer("BusinessClientProfile.aspx");
    }