private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            string dates   = datePicker2.SelectedDate.Value.ToString("d");
            string amounts = textBox3.Text;
            string mat     = comboBox4.SelectedItem.ToString();
            string dest    = comboBox5.SelectedItem.ToString();
            string fashion = comboBox6.SelectedItem.ToString();
            string type    = comboBox7.SelectedItem.ToString();

            try
            {
                if (EditAdapter.AddOrder(dates, amounts, mat, dest, fashion, type) == true)
                {
                    MessageBox.Show("Заявка успішно подана");
                }
                else
                {
                    MessageBox.Show("Заявку відхилено, на складі не вистачає матеріалів даного типу");
                }

                this.Close();
            }
            catch (InputException ex)
            {
                MessageBox.Show(ex.Message);
            }
            catch (UnknownMaterialException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#2
0
 public bool UpdateObject(N2.Edit.Workflow.CommandContext value)
 {
     try
     {
         BinderContext = value;
         EnsureChildControls();
         if (ZoneName != null && ZoneName != value.Content.ZoneName)
         {
             value.Content.ZoneName = ZoneName;
         }
         foreach (string key in AddedEditors.Keys)
         {
             BinderContext.GetDefinedDetails().Add(key);
         }
         var modifiedDetails = EditAdapter.UpdateItem(value.Definition, value.Content, AddedEditors, Page.User);
         if (modifiedDetails.Length == 0)
         {
             return(false);
         }
         foreach (string detailName in modifiedDetails)
         {
             BinderContext.GetUpdatedDetails().Add(detailName);
         }
         BinderContext.RegisterItemToSave(value.Content);
         return(true);
     }
     finally
     {
         BinderContext = null;
     }
 }
示例#3
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			var extra = Intent.GetStringExtra ("JsonItem");
			Debug.WriteLine ("extra;" + extra);
			data = (JsonObject)JsonValue.Parse (extra);

			ListAdapter = new EditAdapter (this, data);
		}
示例#4
0
 public ContentItem Save(ContentItem item, ItemEditorVersioningMode mode)
 {
     EnsureChildControls();
     BinderContext = CreateCommandContext();
     item          = EditAdapter.SaveItem(item, AddedEditors, mode, Page.User);
     if (Saved != null)
     {
         Saved.Invoke(this, new ItemEventArgs(item));
     }
     return(item);
 }
示例#5
0
 /// <summary>Saves <see cref="CurrentItem"/> with the values entered in the form.</summary>
 public ContentItem Save(ContentItem item, ItemEditorVersioningMode mode)
 {
     EnsureChildControls();
     BinderContext = new CommandContext(GetDefinition(), item, "Unknown", Page.User, this, new N2.Edit.Web.PageValidator <CommandContext>(Page));
     item          = EditAdapter.SaveItem(item, AddedEditors, mode, Page.User);
     if (Saved != null)
     {
         Saved.Invoke(this, new ItemEventArgs(item));
     }
     return(item);
 }
示例#6
0
        protected override void CreateChildControls()
        {
            var definition = GetDefinition();

            if (definition != null)
            {
                AddedEditors = EditAdapter.AddDefinedEditors(definition, CurrentItem, this, Page.User, ContainerTypeFilter, EditableNameFilter);
                if (!Page.IsPostBack)
                {
                    EditAdapter.LoadAddedEditors(definition, CurrentItem, AddedEditors, Page.User);
                }
            }

            base.CreateChildControls();
        }
示例#7
0
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            string ids  = textBox1.Text;
            string type = textBox2.Text;

            try
            {
                EditAdapter.UpdateDestination(oldId, ids, type);
                this.Close();
            }
            catch (InputException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#8
0
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            string ids        = textBox1.Text;
            string name       = textBox2.Text;
            string definition = textBox3.Text;

            try
            {
                EditAdapter.UpdateFashion(oldId, ids, name, definition);
                this.Close();
            }
            catch (InputException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            string ids     = textBox1.Text;
            string dates   = datePicker2.SelectedDate.Value.ToString("d");
            string amounts = textBox3.Text;
            string mat     = comboBox4.SelectedItem.ToString();

            try
            {
                EditAdapter.UpdateReceivedView(oldId, ids, dates, amounts, mat);
                this.Close();
            }
            catch (InputException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#10
0
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            string ids       = textBox1.Text;
            string name      = textBox2.Text;
            string country   = textBox3.Text;
            string city      = textBox4.Text;
            string telephone = textBox5.Text;

            try
            {
                EditAdapter.UpdateManufacturer(oldId, ids, name, country, city, telephone);
                this.Close();
            }
            catch (InputException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#11
0
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            string ids  = textBox1.Text;
            string name = textBox2.Text;

            string date = datePicker3.SelectedDate.Value.ToString("d");

            string idManufacturer = comboBox4.SelectedItem.ToString();
            string idMatType      = comboBox5.SelectedItem.ToString();
            string idFashion      = comboBox6.SelectedItem.ToString();

            try
            {
                EditAdapter.UpdateMaterial(oldId, ids, name, date, idManufacturer, idMatType, idFashion);
                this.Close();
            }
            catch (InputException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }