Exemplo n.º 1
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            //fill company object
            //Globals.activeCompany.companyId = Globals.companies.Count + 1;

            temp.companyName = txtCompanyName.Text;
            temp.phoneNum    = txtPhoneNum.Text;
            temp.altPhoneNum = txtAltPhoneNum.Text;
            temp.faxNum      = txtFaxNum.Text;

            temp.addressLineA = txtAddressA.Text;
            temp.addressLineB = txtAddressB.Text;
            temp.city         = txtCity.Text;
            //province done by changing combo box
            temp.postalCode = txtPostalCode.Text;

            temp.description = txtDescription.Text;
            temp.notes       = txtNotes.Text;

            temp.dateEntered = DateTime.Now;
            //add to the global list of companies -> instead of DB for now
            //Globals.companies.Add(temp);

            Company.insertCompany(temp);

            //move to next screen
            //CompanyContactScreen cc = new CompanyContactScreen(Globals.activeCompany); // TODO: remove constructor parameters
            CustomerPortalScreen cps = new CustomerPortalScreen();

            cps.MdiParent = this.MdiParent;
            cps.Show();
            //this.Hide();
            this.Close();
        }
        private void btnFinish_Click(object sender, EventArgs e)
        {
            //fill CompanyContact Object
            temp.companyId = owningCompany.Id;

            temp.salutation = txtSalutation.Text;
            temp.firstName  = txtFirstName.Text;
            temp.lastName   = txtLastName.Text;

            temp.title     = txtTitle.Text;
            temp.branchId  = txtBranchId.Text;
            temp.extension = txtExt.Text;
            temp.title     = txtTitle.Text;
            temp.signature = txtSignature.Text;

            //add/update object to Global contacts list -> instead of DB for now
            if (editing == true)
            {
                //replace
                CompanyContact.updateCompanyContact(temp);
            }
            else
            {
                //add
                //Globals.contacts.Add(newContact);
                CompanyContact.insertCompanyContact(temp);
            }
            //return to Cx portal
            CustomerPortalScreen cp = new CustomerPortalScreen();

            cp.MdiParent = this.MdiParent;
            cp.Show();
            this.Close();
        }
Exemplo n.º 3
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            temp.companyName = txtCompanyName.Text;
            temp.phoneNum    = txtPhoneNum.Text;
            temp.altPhoneNum = txtAltPhoneNum.Text;
            temp.faxNum      = txtFaxNum.Text;

            temp.addressLineA = txtAddressA.Text;
            temp.addressLineB = txtAddressB.Text;
            temp.city         = txtCity.Text;
            //province done by changing combo box
            temp.postalCode = txtPostalCode.Text;

            temp.description = txtDescription.Text;
            temp.notes       = txtNotes.Text;

            Company.updateCompany(temp);
            MessageBox.Show("Updated Record");

            CustomerPortalScreen cp = new CustomerPortalScreen();

            cp.MdiParent = this.MdiParent;
            cp.Show();
            this.Close();
        }
Exemplo n.º 4
0
        private void customerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CustomerPortalScreen cp = new CustomerPortalScreen();

            cp.MdiParent = this;
            cp.Show();
        }
        private void btnBack_Click(object sender, EventArgs e)
        {
            CustomerPortalScreen cp = new CustomerPortalScreen();

            cp.MdiParent = this.MdiParent;
            cp.Show();
            this.Close();
        }
Exemplo n.º 6
0
        private void btnDeleteCustomer_Click(object sender, EventArgs e)
        {
            //Globals.companies.RemoveAt(companyId);
            Company.deleteCompany(companyId);
            MessageBox.Show("Company Deleted");

            CustomerPortalScreen cp = new CustomerPortalScreen();

            cp.MdiParent = this.MdiParent;
            cp.Show();
            this.Close();
        }