public Client GetClient(string id) { var client = new Client(); if (id != null) { using (var context = new impiloEntities()) { var found = context.Client.FirstOrDefault(x => x.IDNo == id); if (found != null) return found; } } return client; }
public Client GetClient(string id) { var client = new Client(); if (id != null) { using (var context = new impiloEntities()) { var found = context.Client.FirstOrDefault(x => x.IDNo == id); if (found != null) { return(found); } } } return(client); }
public int SaveScreening(Screening screening) { using (var context = new impiloEntities()) { if (screening.ScreeningID != String.Empty) { context.Screening.Attach(screening); context.Entry(screening).State = EntityState.Modified; context.SaveChanges(); } else { context.Screening.Add(screening); context.SaveChanges(); } } return(0); }
public int SaveScreening(Screening screening) { using (var context = new impiloEntities()) { if (screening.ScreeningID != String.Empty) { context.Screening.Attach(screening); context.Entry(screening).State = EntityState.Modified; context.SaveChanges(); } else { context.Screening.Add(screening); context.SaveChanges(); } } return 0; }