private void Edit() { TrainingProductManager mgr = new TrainingProductManager(); Entity = mgr.Get(Convert.ToInt32(EventArgument)); EditMode(); }
private void Save() { List <TrainingProduct> lstproduct = new List <TrainingProduct>(); TrainingProductManager mgr = new TrainingProductManager(); if (Mode == "Add") { mgr.Insert(Entity, out lstproduct); Products = lstproduct; } else { mgr.Update(Entity, out lstproduct); Products = lstproduct; } ValidationErrors = mgr.ValidationErrors; if (ValidationErrors.Count > 0) { IsValid = false; } if (!IsValid) { if (Mode == "Add") { AddMode(); } else { EditMode(); } } }
private void Delete() { TrainingProductManager mgr = new TrainingProductManager(); List <TrainingProduct> lstproduct = new List <TrainingProduct>(); Entity = new TrainingProduct(); Entity.ProductID = Convert.ToInt32(EventArgument); mgr.Delete(Entity, out lstproduct); Products = lstproduct; Get("Delete"); ListMode(); }
private void Get(string mode = "") { TrainingProductManager mgr = new TrainingProductManager(); Products = mgr.Get(SearchEntity, Products, mode); }