Beispiel #1
0
 public int Insert(factura fact)
 {
     try
     {
         db.factura.Add(fact);
         db.SaveChanges();
         return(fact.idFactura);
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Beispiel #2
0
 public bool Delete(int id)
 {
     try
     {
         factura bill = db.factura.Find(id);
         db.factura.Remove(bill);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Beispiel #3
0
 public factura Search(int id)
 {
     try
     {
         factura srcBill = (from f in db.factura
                            where f.idFactura == id
                            select f).First();
         return(srcBill);
     }
     catch
     {
         return(null);
     }
 }