Esempio n. 1
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            ContactAddresses address = null;

            if (ContactInfoObject == null)
            {
                ContactInfoObject           = new ContactInfo();
                ContactInfoObject.Title     = (String)((ComboBoxItem)txtTitle.SelectedValue).Content;
                ContactInfoObject.FirstName = txtFirstName.Text;
                ContactInfoObject.LastName  = txtLastName.Text;
                ContactInfoObject.Telephone = txtPhone.Text;
                ContactInfoObject.Mobile    = String.Empty;
                ContactInfoObject.Email     = txtEmail.Text;
                address               = new ContactAddresses();
                address.Address       = txtAddress.Text;
                address.AddressTypeId = 3;
                address.City          = txtCity.Text;
                address.State         = txtState.Text;
                address.Zip           = txtZipCode.Text;
                address.Country       = "United States";
                ContactInfoObject.ContactAddressList = new List <ContactAddresses>();
                ContactInfoObject.ContactAddressList.Add(address);
                Int64 result1 = _contactInfoManager.AddContactInfo(ContactInfoObject, 3);
                if (result1 > 0)
                {
                    ContactInfoObject.ContactInfoId = result1;
                }
            }
            if (txtOnlinePayment.IsChecked.Value)
            {
                UserOrder.PaymentMethod = PaymentType.OnlinePayment;
            }
            else
            {
                UserOrder.PaymentMethod = PaymentType.CashPayment;
            }

            UserOrder.CustomerEmail     = ContactInfoObject.Email;
            UserOrder.CustomerTelephone = ContactInfoObject.Telephone;
            UserOrder.CustomerMobile    = ContactInfoObject.Mobile;
            if (address == null)
            {
                address = Utility.XmlToObject <ContactAddresses>(ContactInfoObject.ContactAddressXml);
            }
            ;
            UserOrder.DeliveryAddress = address.Address + " " + address.City + " " + address.Zip + " " + address.State;

            ((MainWindow)this.Owner).ContactInfoObject = this.ContactInfoObject;
            this.Close();
        }
Esempio n. 2
0
        public ActionResult Classes(ContactInfo forminfo)
        {
            ContactInfoManager mgr = new ContactInfoManager();

            mgr.AddContactInfo(forminfo);

            ViewBag.Message = "Your contact page.";

            forminfo.Email   = "";
            forminfo.Message = "";
            forminfo.Name    = "";
            forminfo.Subject = "";

            ModelState.Clear();
            return(View(forminfo));
        }