示例#1
0
        private void btnsubmit_Click(object sender, EventArgs e)
        {
            PersonV2 temp = new PersonV2();

            temp.Firstname    = txtfirstname.Text;
            temp.Middlename   = txtmiddlename.Text;
            temp.Lastname     = txtlastname.Text;
            temp.Street1      = txtstreet1.Text;
            temp.Street2      = txtstreet2.Text;
            temp.City         = txtcity.Text;
            temp.State        = txtstate.Text;
            temp.Zip          = txtzip.Text;
            temp.Phone        = txtphone.Text;
            temp.Email        = txtemail.Text;
            temp.CellPhone    = txtcellphone.Text;
            temp.InstagramURL = txtinstagramurl.Text;

            if (temp.Feedback.Contains("ERROR:"))
            {
                lblFeedback.Text = temp.Feedback;
            }
            else
            {
                lblFeedback.Text = "Person added: \n" + temp.Firstname + " " + temp.Lastname + "\n" + temp.Street1 + "\n" + temp.City + " " + temp.State + "\n" + temp.Zip + "\n" + temp.CellPhone + " " + temp.Phone + "\n" + temp.Email + "\n" + temp.InstagramURL;


                lblbye.Text = BasicToolsMidterm1.pause();
            }
        }
示例#2
0
        private void btnsubmit_Click(object sender, EventArgs e)
        {
            Customer temp = new Customer();

            temp.Firstname      = txtfirstname.Text;
            temp.Middlename     = txtmiddlename.Text;
            temp.Lastname       = txtlastname.Text;
            temp.Street1        = txtstreet1.Text;
            temp.Street2        = txtstreet2.Text;
            temp.City           = txtcity.Text;
            temp.State          = txtstate.Text;
            temp.Zip            = txtzip.Text;
            temp.Phone          = txtphone.Text;
            temp.Email          = txtemail.Text;
            temp.CellPhone      = txtcellphone.Text;
            temp.InstagramURL   = txtinstagramurl.Text;
            temp.CustomerSince  = dtpcustomersince.Value;
            temp.DiscountMember = cboxdiscountmember.Checked;
            temp.RewardsEarned  = Int32.Parse(txtrewardsearned.Text);

            double dblprice;

            if (Double.TryParse(txttotalpurchases.Text, out dblprice) == true)
            {
                temp.TotalPurchases = dblprice;
            }
            else
            {
                temp.TotalPurchases = 0;
                temp.Feedback       = "ERORR: Invalid Price. Ex: 5.99";
            }
            bool DiscountMember = cboxdiscountmember.Checked;


            if (temp.Feedback.Contains("ERROR:"))
            {
                lblFeedback.Text = temp.Feedback;
            }
            else
            {
                lblFeedback.Text = temp.AddARecord();


                lblbye.Text = BasicToolsMidterm1.pause();
            }
        }