public ActionResult Coppy(string key) { var msg = new JsonMessage(false, "Coppy dữ liệu thành công."); try { if (key == Keyapi) { var modelNew = new Shop_Product(); var model = _da.GetById(ItemId); modelNew.IsDelete = false; modelNew.IsShow = true; modelNew.ColorID = model.ColorID; modelNew.SizeID = model.SizeID; modelNew.Quantity = 0; modelNew.CodeSku = model.CodeSku + "Coppy"; modelNew.ProductDetailID = model.ProductDetailID; _da.Add(modelNew); _da.Save(); } } catch (Exception ex) { msg.Erros = true; msg.Message = "Dữ liệu chưa được Coppy."; Log2File.LogExceptionToFile(ex); } return(Json(msg, JsonRequestBehavior.AllowGet)); }
public ActionResult AjaxView() { var productModel = _productDa.GetById(ArrId.FirstOrDefault()); ViewData.Model = productModel; return(View()); }