Ejemplo n.º 1
0
 public bool insertNewBill(DateTime daySales, double total, double guestMoney, double excessCash, int totalNum, int POS, string accountCode)
 {
     try
     {
         using (var db = new CMART2Entities1())
         {
             ObjectParameter idoutput = new ObjectParameter("ID", typeof(String));
             db.SP_BILL_ID_AUTO_Test(idoutput);
             var id_auto = idoutput.Value.ToString();
             var bill    = new Bill
             {
                 BallotNum   = id_auto,
                 Date        = daySales,
                 Total       = total,
                 GuestMoney  = guestMoney,
                 ExcessCash  = excessCash,
                 TotalNum    = totalNum,
                 POS         = POS,
                 AccountCode = accountCode
             };
             db.Bills.Add(bill);
             db.SaveChanges();
             id = Convert.ToString(id_auto);
             return(true);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }