public void AddNewAccInfo(AccInfo acc)//create new information of transfernce { try { if (Convert.ToInt32(acc.Amount) < 0) { throw new Exception("Unavailable Amount"); } } catch { throw new Exception("Unavailable Amount"); } try { if (Convert.ToDateTime(acc.Date) > DateTime.Now) { throw new Exception("Unavailable Date"); } } catch { throw new Exception("Unavailable Date"); } AccInfoC inter = new AccInfoC(); try { inter.AddAccInfo(acc); } catch (Exception e) { throw new Exception(e.Message); } }
public void AddButton(AccInfo acc) { try { Convert.ToDouble(acc.Amount); } catch { throw new Exception("The Amount Isn't Available"); } try { if (Convert.ToDateTime(acc.Date) > DateTime.Now) { throw new Exception(); } } catch { throw new Exception("The Date Isn't Available"); } //if (acc.InvoiceNum == "") // throw new Exception("The Invoice Isn't Available"); AccInfoC infoC = new AccInfoC(); infoC.AddAccInfo(acc); }