예제 #1
0
 private void controlEditItem(object sender, ReportEventArgs e)
 {
     OrderEditItemControl control = new OrderEditItemControl(e.number);
     control.Canceled += controlCanceled;
     this.contentControl.Content = control;
     this.Title = "Edit";
 }
 protected void onEditItem(ReportEventArgs e)
 {
     if (EditItem != null)
         EditItem(this, e);
 }
예제 #3
0
 private void editovat_Click(object sender, RoutedEventArgs e)
 {
     ReportEventArgs args = new ReportEventArgs();
     args.number = int.Parse(this.objednavky.SelectedValue.ToString());
     onEdit(args);
 }
        private void submit_Click(object sender, RoutedEventArgs e)
        {
			if (((customId.Text == string.Empty) || (firstName.Text == string.Empty) || (lastName.Text == string.Empty) ||
				(street.Text == string.Empty) || (city.Text == string.Empty) ||
				(zip.Text == string.Empty) || (email.Text == string.Empty) ||
			  (name.Text == string.Empty) || (country.SelectedValue == null) || !this.marked)
				|| (this.c != "FO" && (this.ico.Text == string.Empty || this.icDph.Text == string.Empty
					|| this.dic.Text == string.Empty || this.name.Text == string.Empty)))
            {
                System.Windows.MessageBox.Show("Musia byť vyplnené poviné údaje");
                return;
            }
            if ((customId.Text.Contains(";")) || (titlePrefix.Text.Contains(";")) ||
                         (firstName.Text.Contains(";")) || (lastName.Text.Contains(";")) ||
                         (titleSuffix.Text.Contains(";")) || (street.Text.Contains(";")) ||
                         (city.Text.Contains(";")) || (zip.Text.Contains(";")) || (email.Text.Contains(";")) ||
                       (name.Text.Contains(";")) || (mobile.Text.Contains(";")) || (ico.Text.Contains(";"))
              || (dic.Text.Contains(";")) || (icDph.Text.Contains(";")))
            {
                System.Windows.MessageBox.Show("Znak ; je vyhradeni, prosím zmente vstup tak aby neobsahoval znak ; ");
                return;
            }
            this._temp.company.custom_id = customId.Text.ToString();
            this._temp.company.person.titlePrefix = titlePrefix.Text.ToString();
            this._temp.company.person.firstName = firstName.Text.ToString();
            this._temp.company.person.lastName = lastName.Text.ToString();
            this._temp.company.person.titleSuffix = titleSuffix.Text.ToString();
            this._temp.company.address.street = street.Text.ToString();
            this._temp.company.address.city = city.Text.ToString();
            this._temp.company.address.zip = zip.Text.ToString();
            this._temp.company.address.country = country.Text.ToString() == "Vyberte krajinu" ? "SVK" : country.Text.ToString();
            this._temp.company.contact.email = email.Text.ToString();
            this._temp.company.contact.mobile = mobile.Text.ToString();

            

            switch (this.c.ToUpper())
            {
                case "PO":
                    { this._temp.company.corporatePerson = Interface.CorporatePerson.PO; break; }
                default:
                    { this._temp.company.corporatePerson = Interface.CorporatePerson.FO; break; }
            }
            if (this.c.ToUpper() != "FO")
            {
                this._temp.company.name = name.Text.ToString();
                this._temp.company.ico = ico.Text.ToString();
                this._temp.company.dic = dic.Text.ToString();
                this._temp.company.icDph = icDph.Text.ToString();
            }
            else
                this._temp.company.name = this._temp.company.person.getFullName();
            Settings.Config.saveOrders();
            ReportEventArgs args = new ReportEventArgs();
            args.number = this._temp.id;
            onEditItem(args);
            //company.id = 1;
            //if (Settings.Config.getCompanies().Count > 0)
            //	company.id = Settings.Config.getCompanies().LastOrDefault(x => x.id > 0).id + 1;

            //order.id = 1;
            //if (Settings.Config.getOrders().Count > 0)
            //	order.id = Settings.Config.getOrders().LastOrDefault(x => x.id > 0).id + 1;
            //Settings.Config.getCompanies().Add(company);
            //Settings.Config.getOrders().Add(order);
        }
예제 #5
0
 protected void onEdit(ReportEventArgs e)
 {
     if ( Edit != null)
         Edit(this, e);
 }