public ActionResult AddFavProduct(List <int> ProId) { var svFavProduct = new FavProductService(); b2bFavProduct model = new b2bFavProduct(); try { #region Set FavProduct Model foreach (var Pro in ProId) { var IsResult = svFavProduct.InsertFavProduct(Pro, LogonCompID); if (ProId.Count() == 1) { return(Json(IsResult)); } } #endregion } catch (Exception ex) { CreateLogFiles(ex); } return(Json(new { IsResult = svFavProduct.IsResult, MsgError = GenerateMsgError(svFavProduct.MsgError), ID = model.FavProductID })); }
public ActionResult addfav(int compid, int productid) { var svFav = new FavProductService(); var fav = new b2bFavProduct(); svFav.InsertFavProduct(productid, compid); return(Json(new { status = svFav.IsResult }, JsonRequestBehavior.AllowGet)); }