public ActionResult DeleteSalesLot(string ID) { int id = 0; if (ID != "0") { id = Convert.ToInt32(Helpers.CommonMethods.Decrypt(HttpUtility.UrlDecode(ID))); } Lots lot = new Lots(); lot.iLotID = id; try { if (ModelState.IsValid) { SaleServiceClient saleServiceClient = new SaleServiceClient(); lot = saleServiceClient.GetLots(id); } } catch (Exception e) { ModelState.AddModelError("error", "something went wrong"); lot = null; throw e; } return(View("DeleteSalesLot", lot)); }