protected override void Edit() { TrainingProductManager mgr = new TrainingProductManager(); // we're going to set the entity/member variable to hold the current product, this is the one we're going to bind to the input area, input form for the user. Entity = mgr.Get(Convert.ToInt32(EventArgument)); //EditMode(); base.EditMode(); }
protected override void Delete() { TrainingProductManager mgr = new TrainingProductManager(); Entity = new TrainingProduct(); Entity.ProductId = Convert.ToInt32(EventArgument); mgr.Delete(Entity); Get(); //ListMode(); base.Delete(); }
// with addition of the HandleRequest, this method no longer needed to be public protected override void Get() { TrainingProductManager mgr = new TrainingProductManager(); Products = mgr.Get(SearchEntity); base.Get(); }
protected override void Save() { TrainingProductManager mgr = new TrainingProductManager(); if (Mode == "Add") { // Add data to databas here mgr.Insert(Entity); } else { mgr.Update(Entity); } ValidationErrors = mgr.ValidationErrors; base.Save(); }