Exemple #1
0
        public Int32 Create(devices obj)
        {
            EDM edm = new EDM();

            edm.devices.Add(obj);
            try
            {
                edm.SaveChanges();
                return(obj.id);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #2
0
        public bool Delete(devices obj)
        {
            EDM edm = new EDM();

            edm.Entry(obj).State = System.Data.Entity.EntityState.Deleted;
            try
            {
                edm.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #3
0
        public bool Update(logs obj)
        {
            EDM edm = new EDM();

            edm.Entry(obj).State = System.Data.Entity.EntityState.Modified;
            try
            {
                edm.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }