Exemple #1
0
 public int Insert(factura fact)
 {
     try
     {
         db.factura.Add(fact);
         db.SaveChanges();
         return(fact.idFactura);
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Exemple #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);
     }
 }
Exemple #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);
     }
 }