示例#1
0
        public void Create(TypeOfCaseViewModel db)
        {
            var entity = new TypeOfCase_Table();

            entity.TypeOfCase = db.TypeOfCase;
            entities.TypeOfCase_Table.Add(entity);
            entities.SaveChanges();

            db.TypeOfCaseID = entity.TypeOfCaseID;
        }
示例#2
0
        public void Destroy(TypeOfCaseViewModel db)
        {
            var entity = new TypeOfCase_Table();

            entity.TypeOfCaseID = db.TypeOfCaseID;

            entities.TypeOfCase_Table.Attach(entity);

            entities.TypeOfCase_Table.Remove(entity);

            entities.SaveChanges();
        }
示例#3
0
        public void Update(TypeOfCaseViewModel db)
        {
            var entity = new TypeOfCase_Table();

            entity.TypeOfCaseID = db.TypeOfCaseID;
            entity.TypeOfCase   = db.TypeOfCase;



            entities.TypeOfCase_Table.Attach(entity);
            entities.Entry(entity).State = EntityState.Modified;
            entities.SaveChanges();
        }