예제 #1
0
 public bool AddBill(DateTime date, float BillValue, float MoneyReceive, float MoneyChange, string customerID, ListView ListBookImport)
 {
     if (BillDAL.AddBill(date, BillValue, MoneyReceive, MoneyChange, customerID))
     {
         try
         {
             foreach (ListViewItem book in ListBookImport.Items)
             {
                 string id    = book.SubItems[1].Text;
                 int    count = Int32.Parse(book.SubItems[3].Text);
                 float  price = float.Parse(book.SubItems[4].Text);
                 float  total = float.Parse(book.SubItems[5].Text);
                 if (!BillDAL.AddBillInfo(id, count, price, total))
                 {
                     return(false);
                 }
             }
             return(true);
         }
         catch
         {
             return(false);
         }
     }
     return(false);
 }