예제 #1
0
        public bool Delete(CustomPropertyViewModel dt, int id)
        {
            CustomProperty dr = db.CustomProperties.Where(i => i.cpID == id).FirstOrDefault();

            db.CustomProperties.Remove(dr);
            var Result = db.SaveChanges();

            return(Result == 1);
        }
예제 #2
0
        public bool Update(CustomPropertyViewModel dt, int id)
        {
            CustomProperty dr = db.CustomProperties.Where(i => i.cpID == id).FirstOrDefault();

            dr.cpID        = dt.ID;
            dr.cpTableID   = dt.TableID;
            dr.cpTableName = dt.TableName;
            dr.cpName      = dt.PropertyName;
            dr.cpValue     = dt.PropertyValue;
            var Result = db.SaveChanges();

            return(Result == 1);
        }
예제 #3
0
        public int Insert(CustomPropertyViewModel dt)
        {
            CustomProperty dr = new CustomProperty();

            dr.cpTableID   = dt.TableID;
            dr.cpTableName = dt.TableName;
            dr.cpName      = dt.PropertyName;
            dr.cpValue     = dt.PropertyValue;
            db.CustomProperties.Add(dr);
            var Result = db.SaveChanges();

            return(dr.cpID);
        }