Exemplo n.º 1
0
        public virtual void Insert(OrgChartShape shape, ModelStateDictionary modelState)
        {
            db.OrgChartShapes.Add(shape);
            db.SaveChanges();

            shape.Id = shape.Id;
        }
Exemplo n.º 2
0
        public virtual void Delete(OrgChartShape shape, ModelStateDictionary modelState)
        {
            db.OrgChartShapes.Attach(shape);

            Delete(shape);

            db.OrgChartShapes.Remove(shape);
            db.SaveChanges();
        }
Exemplo n.º 3
0
        private void Delete(OrgChartShape shape)
        {
            var result = db.OrgChartShapes.Where(t => t.Id == shape.Id).First();

            db.OrgChartShapes.Remove(result);
        }
Exemplo n.º 4
0
 public virtual void Update(OrgChartShape shape, ModelStateDictionary modelState)
 {
     db.OrgChartShapes.Attach(shape);
     db.Entry(shape).State = EntityState.Modified;
     db.SaveChanges();
 }