protected void btnYes_Click(object sender, EventArgs e) { var Status = _genericClass.Delete(Key1, Key2, Key3, Action, QueryType, Type, UserContext.DataBaseInfo); var customMessageControl = (CustomMessageControl)Parent.FindControl("CustomMessageControl"); if (customMessageControl == null) { return; } if (Status != null) { customMessageControl.MessageBodyText = Status.Value; customMessageControl.MessageType = (Status.Key == "1" ? MessageTypes.Success : MessageTypes.Error); } else { customMessageControl.MessageBodyText = "Could not complete your request. Please try again."; customMessageControl.MessageType = MessageTypes.Error; } customMessageControl.ShowMessage(); if (YesClicked != null) { YesClicked(sender, e); } }
public ActionResult DeleteConfirmed(string id) { TypeOfService typeOfService = GM.FindBy(x => x.typeOfService == id).FirstOrDefault(); GM.Delete(typeOfService); GM.Save(); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(string id) { Post post = GM.FindBy(x => x.post == id).First(); GM.Delete(post); GM.Save(); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(string id) { LastMileType lastMileType = GM.FindBy(x => x.lastMileType == id).FirstOrDefault(); GM.Delete(lastMileType); GM.Save(); return(RedirectToAction("Index")); }
private void InitializeCommands() { SaveCommand = new RelayCommand((data) => { if (Mode == DetailMode.Creating) { var id = GenericManager.Create(Entity.LogicalName, Values); var newData = GenericManager.Retrieve(Entity.LogicalName, id); Id = id; Values = newData.Values; Mode = DetailMode.Updating; BusinessEventManager.RaiseOnCreatedEntity(Entity, newData.Values); } else if (Mode == DetailMode.Updating) { GenericManager.Update(Entity.LogicalName, Id, Values); BusinessEventManager.RaiseOnUpdatedEntity(Entity, Id, Values); } }, (data) => { return(IsCompleted); }); DeleteCommand = new RelayCommand((data) => { var dialog = new OkCancelMessageBox("Confirm the delete? This operation cannot be undone", "Delete operation"); dialog.ShowDialog(); if (dialog.Response == OkCancelMessageBox.InputTextBoxResponse.OK) { GenericManager.Delete(Entity.LogicalName, Id); BusinessEventManager.RaiseOnDeletedEntity(Entity, Id); } }, (data) => { return(Mode == DetailMode.Updating); }); RegisterCommand(SaveCommand); RegisterCommand(DeleteCommand); }
// DELETE: api/ApiPostOffice/5 public void Delete(string id) { repository.Delete(repository.FindBy(x => x.postOffice == id).FirstOrDefault()); }
// DELETE: api/ApiIncidents/5 public void Delete(int id) { repository.Delete(repository.FindBy(x => x.idIncident == id).FirstOrDefault()); }