예제 #1
0
        private void btn_back_Click(object sender, EventArgs e)
        {
            try
            {
                var receiptModel = InitializeReceipt();

                _main.panel_body.Controls.Clear();

                uc_add_item_details _item_details;

                switch (_serial_list == null)
                {
                case true:

                    _item_details = new uc_add_item_details(_main, _item_model, receiptModel);
                    _main.panel_body.Controls.Add(_item_details);
                    _item_details.Show();
                    break;

                case false:
                    Console.WriteLine("has val");
                    _item_details = new uc_add_item_details(_main, _item_model, receiptModel, _serial_list);
                    _main.panel_body.Controls.Add(_item_details);
                    _item_details.Show();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            uc_add_item_details _add_item = new uc_add_item_details(_main_form);

            _main_form.panel_body.Controls.Clear();
            _main_form.panel_body.Controls.Add(_add_item);
            _main_form.lbl_current_tab.Text = "Add New Item";
        }
예제 #3
0
        private void Save()
        {
            var myItem    = item();
            var myReceipt = initializeReceipt();

            try
            {
                ItemCreator itemCreator = new ItemCreator(myItem, myReceipt);
                itemCreator.CreateItem();
                MessageBox.Show("Saved!");
                _main.panel_body.Controls.Clear();
                uc_add_item_details _item_details = new uc_add_item_details(_main);
                _main.panel_body.Controls.Add(_item_details);
                _item_details.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }