public bool Delete(int srmId) { var srm = SRMRepository.GetQueryable().FirstOrDefault(s => s.ID == srmId); if (srm != null) { SRMRepository.Delete(srm); SRMRepository.SaveChanges(); } else { return(false); } return(true); }
public bool Save(SRM srm) { var sr = SRMRepository.GetQueryable().FirstOrDefault(s => s.ID == srm.ID); sr.SRMName = srm.SRMName; sr.Description = srm.Description; sr.OPCServiceName = srm.OPCServiceName; sr.GetRequest = srm.GetRequest; sr.GetAllow = srm.GetAllow; sr.GetComplete = srm.GetComplete; sr.PutRequest = srm.PutRequest; sr.PutAllow = srm.PutAllow; sr.PutComplete = srm.PutComplete; sr.State = srm.State; SRMRepository.SaveChanges(); return(true); }
public bool Add(SRM srm) { var s = new SRM(); s.SRMName = srm.SRMName; s.Description = srm.Description; s.OPCServiceName = srm.OPCServiceName; s.GetRequest = srm.GetRequest; s.GetAllow = srm.GetAllow; s.GetComplete = srm.GetComplete; s.PutRequest = srm.PutRequest; s.PutAllow = srm.PutAllow; s.PutComplete = srm.PutComplete; s.State = srm.State; SRMRepository.Add(s); SRMRepository.SaveChanges(); return(true); }