/// <summary> /// 作者:Kylin /// 时间:2014.04.21 /// 描述:创建平台课堂 /// </summary> public static MeetingRoom CreateClassroom(MeetingRoom model) { using (var edb = new EmeMeetingEntities()) { var createModel = edb.Entry<MeetingRoom>(model).State = EntityState.Added; edb.SaveChanges(); return model; } }
/// <summary> /// 作者:Primo /// 时间:2015.09.30 /// 描述:删除课堂,重新建立 /// </summary> /// <param name="ArrangeCourseId"></param> /// <returns></returns> public static bool DeleteClassroom(int ArrangeCourseId) { try { using (var edb = new EmeMeetingEntities()) { var model = edb.MeetingRoom.FirstOrDefault(p => p.ArrangeCourseId == ArrangeCourseId); edb.Entry(model).State = EntityState.Deleted; var result = edb.SaveChanges() > 0; return result; } } catch (Exception ex) { throw ex; } }