private void RemoveServiceButton_Click(object sender, EventArgs e) { if (currentBill.Id == 0) { FormUtilities.NotifyFailure(); return; } if (LazyWorker <BillDetail> .Delete(FilledDataToBillDetail())) { LoadBillsServices(); FormUtilities.NotifySuccess(); } else { FormUtilities.NotifyFailure(); } }
private void AddServiceButton_Click(object sender, EventArgs e) { if (currentBill.Id == 0 || ServiceComboBox.SelectedIndex == 0) { FormUtilities.NotifyFailure(); return; } if (LazyWorker <BillDetail> .Insert(FilledDataToBillDetail()) > 0) { LoadBillsServices(); FormUtilities.NotifySuccess(); } else { FormUtilities.NotifyFailure(); } }
private void DeleteBillButton_Click(object sender, EventArgs e) { if (LazyWorker <BillModel> .Delete ( new BillModel() { Id = currentBill.Id } )) { SetCurrentBill(new BillDisplay()); FormUtilities.NotifySuccess(); } else { FormUtilities.NotifyFailure(); } }
private void SaveBillButton_Click(object sender, EventArgs e) { if (LazyWorker <BillModel> .Update ( new BillModel() { Id = currentBill.Id, CustomerId = (CustomerComboBox.SelectedIndex == 0 ? null : (int?)CustomerComboBox.SelectedIndex), EmployeeId = (EmployeeComboBox.SelectedIndex == 0 ? null : (int?)EmployeeComboBox.SelectedIndex), CreatingDay = currentBill.CreatingDay } )) { FormUtilities.NotifySuccess(); } else { FormUtilities.NotifyFailure(); } }