private void Save() { var mgr = new TrainingProductManager(); if (Mode == "Add") { mgr.Insert(Entity); } else { mgr.Update(Entity); } ValidationErrors = mgr.ValidationErrors; if (ValidationErrors.Count > 0) { IsValid = false; } if (!IsValid) { if (Mode == "Add") { AddMode(); } EditMode(); } }
public void Edit() { var mgr = new TrainingProductManager(); Entity = mgr.Get(Convert.ToInt32(EventArgument)); EditMode(); }
private void Delete() { var mgr = new TrainingProductManager(); Entity = mgr.Get(Convert.ToInt32(EventArgument)); mgr.Delete(Entity); Get(); ListMode(); }
private void Get() { var mgr = new TrainingProductManager(); Products = mgr.Get(SearchEntity); }