Exemple #1
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            ForceValidation();
            if (Validation.GetHasError(txtShowRName) || Validation.GetHasError(txtCNumber) ||
                Validation.GetHasError(txtCity))
            {
                MessageBox.Show("Error Some Data is Missing", "ERROR");
                return;
            }
            ShowRFactory obj   = new ShowRFactory();
            ShowRoom     SRobj = new ShowRoom();
            City         Cobj  = new City();

            SRobj.ShowRName       = txtShowRName.Text;
            SRobj.SRContectNumber = int.Parse(txtCNumber.Text.ToString());
            Cobj.CityName         = txtCity.Text;
            if (obj.insert(Cobj, SRobj))
            {
                MessageBox.Show("Car Showroom is Saved Successfully", "Saved");
            }
            else
            {
                MessageBox.Show("Car Showroom is Not Saved ", "Error!");
            }
            txtCity.Text      = null;
            txtCNumber.Text   = null;
            txtShowRName.Text = null;
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ShowRFactory          Facobj = new ShowRFactory();
            List <ShowRModelView> list   = Facobj.GetAll();

            SRGrid.ItemsSource = list;
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ShowRFactory          Fobj = new ShowRFactory();
            List <ShowRModelView> list = Fobj.GetAll();

            cbSR.ItemsSource       = list;
            cbSR.DisplayMemberPath = "ShowRName";
            cbSR.SelectedValuePath = "S_ID";
        }
        private void btnNext_Click(object sender, RoutedEventArgs e)
        {
            ShowRFactory fobj = new ShowRFactory();
            bool         rC, rS;

            rS = fobj.DeleteS(rid());
            rC = fobj.DeleteC(rid());
            if (rS && rC)
            {
                MessageBox.Show("Showroom is Deleted", "Deleted");
                this.Close();
            }
            else
            {
                MessageBox.Show("Showroom is not Deleted", "Error!");
            }
        }