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