Exemplo n.º 1
0
 public int EditOrUpdate(ClientData clientData)
 {
     try
     {
         using (var db = new ClientServiceContext())
         {
             db.Entry(clientData).State = System.Data.Entity.EntityState.Modified;
             db.SaveChanges();
             return(1);
         }
     }
     catch (Exception)
     {
         return(0);
     }
 }
Exemplo n.º 2
0
 public bool RemoveClient(int clientId)
 {
     try
     {
         using (var db = new ClientServiceContext())
         {
             var clientData = db.Clients.Find(clientId);
             db.Entry(clientData).State = System.Data.Entity.EntityState.Deleted;
             db.SaveChanges();
             return(true);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }