private void btnAddPaymentType_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(TBoxPType.Text)) { if (checkForSameness()) { MessageBox.Show("This payment type is already added!"); } else { pType = new cPaymentTypeOperations(); pType.paymentType = TBoxPType.Text; pType.sqlQuery = "insert into PAYMENTTYPE (explanation) values (@PType)"; pType.addNewPType(); MessageBox.Show("Payment type is added!"); TBoxPType.Clear(); } } else { MessageBox.Show("Please write a payment type!"); } }
void listAllPaymentTypes() { pType = new cPaymentTypeOperations(); pType.sqlQuery = "select explanation from PAYMENTTYPE"; pType.showPaymentTypes(); fillLView(); }
void fillCBoxPType() { pType = new cPaymentTypeOperations(); pType.sqlQuery = "select explanation as 'Payment Type' from PAYMENTTYPE"; pType.showPaymentTypes(); CBoxPType.DataSource = pType.dataTable; CBoxPType.DisplayMember = "Payment Type"; }
private bool checkForSameness() { pType = new cPaymentTypeOperations(); pType.paymentType = TBoxPType.Text; pType.sqlQuery = "select explanation from PAYMENTTYPE"; return(pType.checkIsPTypeAlive()); }