public ActionResult AjaxForm() { var model = new OrderDetailItem(); if (DoAction == ActionType.Edit) { model = _api.GetOrderDetailItem(ArrId.FirstOrDefault()); } ViewBag.Action = DoAction; model.SetupProductionItems = _setupAPI.GetList(UserItem.AgencyID); ViewBag.AgencyID = UserItem.AgencyID; ViewBag.ActionText = ActionText; return(View(model)); }