Beispiel #1
0
        private void newPurchase_btn_Click(object sender, EventArgs e)
        {
            this.Hide();
            New_Purchase np = new New_Purchase();

            np.Show();
        }
Beispiel #2
0
        private async void add_btn_Click(object sender, EventArgs e)
        {
            if (name_editText.Text != "" && name_editText.Text != null)
            {
                if (mobileNo_editText.Text.Count() == 11)
                {
                    try
                    {
                        vendor = new Vendor_class
                        {
                            name     = name_editText.Text,
                            mobileNo = mobileNo_editText.Text
                        };

                        PushResponse response = await client.PushTaskAsync("vendors", vendor);

                        Vendor_class result = response.ResultAs <Vendor_class>();
                        MessageBox.Show("Vendor Added Successfully!");


                        this.Hide();
                        New_Purchase np = new New_Purchase();
                        np.Show();
                    }
                    catch (Exception)
                    {
                        //inserted = false;
                        MessageBox.Show("Failed to add vendor. Check your internet connectivity.");
                    }
                }

                else
                {
                    MessageBox.Show("Mobile Number invalid!");
                }
            }

            else
            {
                MessageBox.Show("Name invalid!");
            }
        }