Пример #1
0
 private void AddItem_Shown(object sender, EventArgs e)
 {
     this.Size = new Size(329, 122);
     RenderCombo();
     Result = null;
     barcode.Text = "";
     nameBox.Text = "";
     descriptionBox.Text = "";
     taglistBox.Items.Clear();
     barcode.Focus();
 }
Пример #2
0
        private void barcode_Leave(object sender, EventArgs e)
        {
            var item = Db.Context.Items.FirstOrDefault(n => n.Id == barcode.Text);
                if (item != null) {
                Result = item;
                DialogResult = DialogResult.OK;
                    //select this item and exit dialog
                } else {
                // reveal add item ui
                this.Size = new Size(413, 425);

            }
        }
Пример #3
0
 private void button2_Click(object sender, EventArgs e)
 {
     DialogResult = DialogResult.OK;
     if (isContainer.Checked) {
         Result = new Model.Container() {
             Id = barcode.Text,
             Name = nameBox.Text,
             Description = descriptionBox.Text,
             Added = DateTime.Now,
             Tags = taglistBox.Items.Cast<Model.Tag>().ToList()
         };
     } else {
         Result = new Model.Item() {
             Id = barcode.Text,
             Name = nameBox.Text,
             Description = descriptionBox.Text,
             Added = DateTime.Now,
             Tags = taglistBox.Items.Cast<Model.Tag>().ToList()
         };
     }
 }