public void Delete(modelProjectTopic projectTopic, bool reload = true) { db.Delete("tblProjectTopic", "ID", projectTopic); if (reload) { LoadProjectTopics(); } }
public void Update(modelProjectTopic projectTopic, bool reload = true) { if (projectTopic.CreatedDate.Year < 2000) { projectTopic.CreatedDate = new DateTime(2000, 1, 1); } projectTopic.UpdatedDate = DateTime.Now; db.Update("tblProjectTopic", "ID", projectTopic); if (reload) { LoadProjectTopics(); } }
public void Insert(modelProjectTopic projectTopic, bool reload = true) { if (projectTopic.ID == 0) { projectTopic.ID = Program.GData.LongID(); projectTopic.CreatedDate = DateTime.Now; projectTopic.UpdatedDate = DateTime.Now; } db.Insert("tblProjectTopic", "ID", false, projectTopic); if (reload) { LoadProjectTopics(); } }