Example #1
0
 public void Update(Notice model)
 {
     var target = Find(model.ID);
     db.Attach<Notice>(target);
     target.Name = model.Name;
     target.Content = model.Content;
     target.DepartmentID = model.DepartmentID;
     db.Commit();
 }
Example #2
0
 public Notice Create(ViewModels.NoticeViewModel model)
 {
     Notice entity = new Notice();
     entity.AddTime = DateTime.Now;
     entity.AddUser = CookieHelper.MemberID;
     entity.LastTime = DateTime.Now;
     entity.LastUser = CookieHelper.MemberID;
     entity.DepartmentID = model.DepartmentID;
     entity.Content = model.Content;
     entity.Name = model.Name;
     db.Add<Notice>(entity);
     db.Commit();
     return entity;
 }
Example #3
0
 public void Delete(Notice model)
 {
     var target = Find(model.ID);
     db.Remove<Notice>(target);
     db.Commit();
 }
Example #4
0
 public void Create(Notice model)
 {
     db.Add<Notice>(model);
     db.Commit();
 }