Exemplo n.º 1
0
        private void Save_Click(object sender, EventArgs e)
        {
            if (address.Text.ToString().Trim() == string.Empty)
            {
                Toast.MakeText(ApplicationContext, "Enter Address", ToastLength.Long).Show();
            }
            else if (statespinner.SelectedItemPosition == 0)
            {
                Toast.MakeText(ApplicationContext, "Select state", ToastLength.Long).Show();
            }
            else if (pinCode.Text.ToString().Trim() == string.Empty)
            {
                Toast.MakeText(ApplicationContext, "Enter Pincode", ToastLength.Long).Show();
            }

            else if (city.Text.ToString().Trim() == string.Empty)
            {
                Toast.MakeText(ApplicationContext, "Enter City", ToastLength.Long).Show();
            }

            else if (name.Text.ToString().Trim() == string.Empty)
            {
                Toast.MakeText(ApplicationContext, "Enter your Name", ToastLength.Long).Show();
            }
            else if (mobNo.Text.ToString().Trim() == string.Empty)
            {
                Toast.MakeText(ApplicationContext, "Enter Mobile No.", ToastLength.Long).Show();
            }
            else if (!isOnline())
            {
                Toast.MakeText(ApplicationContext, "Check your Internet Connection!", ToastLength.Long).Show();
            }
            else
            {
                UserInfo user = new UserInfo();
                user.partyaddress = address.Text;
                user.country      = countryModel[countrySpiner.SelectedItemPosition].Id;
                user.state        = stateModel[statespinner.SelectedItemPosition].Id;
                user.city         = city.Text;
                user.pincode      = pinCode.Text;
                user.partyname    = name.Text;
                user.mobno        = mobNo.Text;
                user.mailid       = email.Text;
                user.countryvalue = countryModel[countrySpiner.SelectedItemPosition].Name;
                user.statevalue   = stateModel[statespinner.SelectedItemPosition].Name;
                session_management.AddAddress(user);

                session_management.AddSpecialNotes(remark.Text, specialRemark.Text);

                Intent i = new Intent(this, typeof(OrderSummary));
                StartActivity(i);
            }
        }