public void Update(FileShare model) { var target = Find(model.ID); db.Attach<FileShare>(target); target.Description = model.Description; target.FilePath = model.FilePath; target.FileCateID = model.FileCateID; target.DepartmentID = model.DepartmentID; target.Name = model.Name; db.Commit(); }
public FileShare Create(ViewModels.FileShareViewModel model) { FileShare entity = new FileShare(); entity.AddTime = DateTime.Now; entity.AddUser = CookieHelper.MemberID; entity.FilePath = model.FilePath; entity.FileCateID = model.FileCateID; entity.Name = model.Name; entity.Description = model.Description; entity.DepartmentID = model.DepartmentID; db.Add<FileShare>(entity); db.Commit(); return entity; }
public void Delete(FileShare model) { var target = Find(model.ID); db.Remove<FileShare>(target); db.Commit(); }
public void Create(FileShare model) { db.Add<FileShare>(model); db.Commit(); }