Пример #1
0
 public void Delete(modelPerson person, bool reload = true)
 {
     db.Delete("tblPerson", "ID", person);
     if (reload)
     {
         LoadPersons();
     }
 }
Пример #2
0
 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();
     }
 }
Пример #3
0
 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();
     }
 }