public ActionResult DeleteConfirmed(long id) { ReceivingPost receiving = _receivingService.GetPost(id); receiving.UserName = User.Identity.Name; _receivingService.Delete(receiving); return(RedirectToAction("Index")); }
public ActionResult Delete(string id) { List <ReceivingDetailModel> receivingDetail = service.GetAllReceivingDetail(Convert.ToInt64(id)).Select(re => new ReceivingDetailModel(re, true)).ToList(); foreach (var item in receivingDetail) { service.DeleteReceivingDetail(item.Id); deleteSerials(item); deleteLot(item); } service.Delete(id, AuthenticationHelper.CompanyId.Value); return(RedirectToAction("Index")); }