Esempio n. 1
0
 public bool update(Bill_Online bills, int id)
 {
     try
     {
         bills.updated_at = DateTime.Now;
         (from bill in db.Bill_Online
          where bill.id_bill_online == id
          select bill)
         .ToList()
         .ForEach((p) =>
         {
             p.name_customer = bills.name_customer;
             p.sdt           = bills.sdt;
             p.address       = bills.address;
             p.updated_at    = bills.updated_at;
             p.total_price   = bills.total_price;
         });
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Esempio n. 2
0
 public bool create(Bill_Online bill_Online)
 {
     try
     {
         bill_Online.created_at = DateTime.Now;
         bill_Online.updated_at = DateTime.Now;
         db.Bill_Online.Add(bill_Online);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }