private void NewSaleButton_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; try { customer = null; CustomerNameLabel.Text = ""; PhoneTextBox.Text = ""; AdressTextBox.Text = ""; EmailTextBox.Text = ""; TotalPriceLabel.Text = ""; MomsLabel.Text = ""; TotalInkMomsLabel.Text = ""; sale = SaleFactory.Instance().CreateSale(customer, DateTime.Now); ItemListDataGridView.DataSource = null; UnPaidPrescriptionsDataGridView.DataSource = null; UnPaidTreatmentDataGridView.DataSource = null; SearchItemTextBox.Text = ""; LoadAllItemsInListBox(); EndButton.Enabled = false; FakturaButton.Enabled = false; } catch (Exception) { MessageBox.Show("noget gik galt"); this.Cursor = Cursors.Default; } this.Cursor = Cursors.Default; }
private void FillItemList(Item item, Prescription prescription, Treatment treatment, int amount = -1) { SaleItemForm saleItemForm = new SaleItemForm(item, prescription, treatment, amount); if (saleItemForm.ShowDialog() == DialogResult.OK) { SaleLineItem saleLineItem = saleItemForm.saleLineItem; if (sale == null) { sale = SaleFactory.Instance().CreateSale(customer, DateTime.Now); } sale.AddSaleLineItem(saleLineItem); LoadeItemList(); EndButton.Enabled = true; } }
private void SaleForm_Load(object sender, EventArgs e) { ItemListDataGridView.AutoGenerateColumns = false; ItemDataGridView.AutoGenerateColumns = false; UnPaidPrescriptionsDataGridView.AutoGenerateColumns = false; UnPaidTreatmentDataGridView.AutoGenerateColumns = false; FakturaButton.Enabled = false; LoadAllItemsInListBox(); sale = SaleFactory.Instance().CreateSale(customer, DateTime.Now); try { LastUpdate = BossController.Instance().itemController.GetLastUpdate(); UpdateMedicineLabel.Text = "Dato for sidst opdateret medicinpriser: " + LastUpdate.ToString("dd-MM-yyyy"); } catch { UpdateMedicineLabel.Text = ""; } }