Пример #1
0
        private void btnAddCustomer_Click(object sender, RoutedEventArgs e)
        {

            if (txtCustomerFullName.Text != string.Empty && txtCustomerAddress.Text != string.Empty && cmbCustomerTaluk.Text != string.Empty && cmbCustomerVillage.Text != string.Empty)
            {
                CUSTOMER customer = new CUSTOMER();
                customer.CUSTOMER_NAME = txtCustomerFullName.Text;
                customer.CONTACT_NO_1 = Convert.ToInt64(txtCustomerContactNo1.Text);
                customer.CUSTOMER_ADDRESS = txtCustomerAddress.Text;
                customer.VILLAGE_ID = Convert.ToInt32(cmbCustomerVillage.SelectedValue);
                customer.STATUS_ID = Convert.ToInt32(cmbCustomerStatus.SelectedValue);
                data.Insert<CUSTOMER>(customer);
                MessageBox.Show("Customer Added Sucessfully");

                Common.ClearAllControls<TextBox>(addCustomer, 1);
                Common.ClearAllControls<ComboBox>(addCustomer);

                BindCustomers();
            }
            else
            {
                MessageBox.Show("Please enter the mandatory fields");
            }

        }
		private void detach_CUSTOMERs(CUSTOMER entity)
		{
			this.SendPropertyChanging();
			entity.VILLAGE = null;
		}
		private void attach_CUSTOMERs(CUSTOMER entity)
		{
			this.SendPropertyChanging();
			entity.VILLAGE = this;
		}
 partial void DeleteCUSTOMER(CUSTOMER instance);
 partial void UpdateCUSTOMER(CUSTOMER instance);
 partial void InsertCUSTOMER(CUSTOMER instance);