public ActionResult Details(int id, string Status) { try { if (Status == "0") { dc.Order_Unchecked(id); } else { dc.Order_Checked(id); } return(RedirectToAction("NewOrders")); } catch { ViewBag.Message = "خطای سیستم"; var order = dc.Orders.Where(x => x.Id == id).FirstOrDefault(); if (Request.IsAjaxRequest()) { return(PartialView(order)); } return(View(order)); } }