コード例 #1
0
 public ActionResult ajaxAttribute(string id = "")
 {
     try
     {
         Product checkProduct = CatalogBLL.Product_Get(id);
         if (checkProduct == null)
         {
             return(RedirectToAction("Index"));
         }
         var model = new Models.AttributeResult
         {
             Data = CatalogBLL.Product_GetAttribute(id),
         };
         return(Json(new { model.Data }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception e)
     {
         return(RedirectToAction("Index"));
     }
 }
コード例 #2
0
 public ActionResult Attribute(string id = "")
 {
     try
     {
         Product checkProduct = CatalogBLL.Product_Get(id);
         if (checkProduct == null)
         {
             return(RedirectToAction("Index"));
         }
         var model = new Models.AttributeResult
         {
             Data      = CatalogBLL.Product_GetAttribute(id),
             ProductID = Convert.ToInt32(id)
         };
         return(View(model));
     }
     catch (Exception e)
     {
         return(RedirectToAction("Index"));
     }
 }
コード例 #3
0
        public ActionResult Attribute(string id = "")
        {
            try
            {
                Product checkProduct = CatalogBLL.Product_Get(id);

                List <ProductAttributes> data = new List <ProductAttributes>();
                data = CatalogBLL.Product_GetAttribute(id);
                if (data == null)
                {
                    ProductAttributes newAttribute = new ProductAttributes();
                    return(View(newAttribute));
                }
                var model = new Models.AttributeResult()
                {
                    Data = data,
                };
                return(View(model));
            }
            catch (Exception e)
            {
                return(RedirectToAction("Index"));
            }
        }