public ActionResult Imported(string key, string codeLogin) { try { if (key != Keyapi) { return(Json(0, JsonRequestBehavior.AllowGet)); } var storage = _da.GetById(ItemId); storage.Status = (int)StatusWarehouse.Imported; var lstInt = GetListImportedItem(codeLogin, DateTime.Now, Agencyid()); var lsttemp = _da.GetListProductValueListArr(lstInt); var temp = _da.GetListArrIdImport(lsttemp); foreach (var dnImportProduct in temp) { dnImportProduct.AgencyId = Agencyid(); } _da.Save(); return(Json(1, JsonRequestBehavior.AllowGet)); } catch (Exception) { return(Json(0, JsonRequestBehavior.AllowGet)); } }