protected override void Edit() { TrainingProductManager mgr = new TrainingProductManager(); Entity = mgr.Get(Convert.ToInt32(EventArgument)); base.Edit(); }
private void Save() { //TrainingProductManager mgr = new TrainingProductManager(); if (Mode == "Add") { TrainingProductManager.Insert(this.Entity); } if (Mode == "Edit") { TrainingProductManager.Update(this.Entity); } ValidationErrors = TrainingProductManager.ValidationErrors; if (ValidationErrors.Count > 0) { IsValid = false; } if (!IsValid) { if (Mode == "Add") { AddMode(); } if (Mode == "Edit") { EditMode(); } } }
protected override void Get() { TrainingProductManager mgr = new TrainingProductManager(); Products = mgr.Get(SearchEntity); base.Get(); }
protected override void Delete() { TrainingProductManager mgr = new TrainingProductManager(); Entity = new TrainingProduct(); Entity.ProductId = Convert.ToInt32(EventArgument); mgr.Delete(Entity); Get(); base.Delete(); }
private void Delete() { TrainingProduct entity = new TrainingProduct { ProductId = Convert.ToInt32(EventArgument) }; TrainingProductManager.Delete(entity); Get(); ListMode(); }
protected override void Save() { TrainingProductManager mgr = new TrainingProductManager(); if (Mode == "Add") { //Add data to database here mgr.Insert(Entity); } else { mgr.Update(Entity); } ValidationErrors = mgr.ValidationErrors; base.Save(); }
protected override void Delete() { TrainingProductManager mgr = new TrainingProductManager(); // Create new entity Entity = new TrainingProduct(); // Get primary key from EventArgument Entity.ProductId = Convert.ToInt32(EventArgument); // Call data layer to delete record mgr.Delete(Entity); // Reload the Data Get(); base.Delete(); }
protected override void Save() { TrainingProductManager mgr = new TrainingProductManager(); if (Mode == "Add") { mgr.Insert(Entity); } else { mgr.Update(Entity); } // Set any validation errors ValidationErrors = mgr.ValidationErrors; // Set mode based on validation errors base.Save(); }
private void Save() { TrainingProductManager mgr = new TrainingProductManager(); if (Mode == "Add") { mgr.Insert(Entity); } ValidationErrors = mgr.ValidationErrors; if (ValidationErrors.Count > 0) { IsValid = false; } if (!IsValid) { if (Mode == "Add") { AddMode(); } } }
private void Get() { //TrainingProductManager mgr = new TrainingProductManager(); Products = TrainingProductManager.Get(SearchEntity); }