Beispiel #1
0
 /// <summary>
 /// Opens NewItem form and get ready for update
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void UpdateBut_Click(object sender, EventArgs e)
 {
     if (ItemsGridView.SelectedRows.Count == 1) //If selected
     {
         var   item = ItemsGridView.SelectedRows[0].Cells;
         var   id   = item[0].Value.ToString();
         Items Item = this.UpdateCreateSalesReport.GetAllInfo().First(a => a.Id == id);
         //gets the info of selected item
         this.item        = Item;
         this.NewItemForm = new NewItemForm(Item); //opens the NewItemForm with loaded info
         NewItemForm.Hide();
         this.NewItemForm.ShowDialog();
         this.Close();
     }
 }
Beispiel #2
0
 /// <summary>
 /// Opens new form
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void AddItemBut_Click(object sender, EventArgs e)
 {
     //Creates new form
     this.NewItemForm = new NewItemForm();
     this.NewItemForm.ShowDialog();
 }
Beispiel #3
0
 private void RegisterBut_Click(object sender, EventArgs e)
 {
     this.NewItemForm = new NewItemForm();
     NewItemForm.Show();
 }
Beispiel #4
0
        /// <summary>
        /// Opens NewItem form
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CreateBut_Click(object sender, EventArgs e)
        {
            var form1 = new NewItemForm();

            form1.ShowDialog();
        }