private void btnTypeSave_Click(object sender, EventArgs e) { currentPay = new PaymentType(); currentPay.Description = txtPayType.Text; PayType = _paymentTypeController.GetPaymentTypes(); foreach (PaymentType item in PayType) { if (txtPayType.Text == item.Description) { throw new PaymentTypeException(); } } try { bool result = _paymentTypeController.Add(currentPay); if (result) { MessageBox.Show("Ödeme tip ekleme başarılı"); FillList(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public static String[] Insert(String type) { String[] message = payment.Add(type); return(message); }