Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }