Exemplo n.º 1
0
 public bool CreateClient(Client obj)
 {
     try
     {
         using (var ctx = new ZzaDbContext())
         {
             var q = ctx.Clients.Add(obj);
             ctx.SaveChanges();
         }
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
Exemplo n.º 2
0
 public bool UpdateClientInformation(Client obj)
 {
     try
     {
         using (var ctx = new ZzaDbContext())
         {
             var q = ctx.Clients.First(m => m.ID == obj.ID);
             if (q != null)
             {
                 q.HostName = obj.HostName;
                 q.IpAddress = obj.IpAddress;
                 q.Username = obj.Username;
                 q.Password = obj.Password;
                 ctx.SaveChanges();
             }
         }
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }