Exemplo n.º 1
0
 public bool Insert(ProductCategorySmall pcs)
 {
     try
     {
         db.ProductCategorySmalls.Add(pcs);
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Exemplo n.º 2
0
        //Thêm Brand
        public JsonResult AddBrand(string BrandName, int BrandSeq, int CateID)
        {
            string data = "";
            ProductCategorySmall    pcs  = new ProductCategorySmall();
            ProductCategorySmallDao pcsd = new ProductCategorySmallDao();

            try
            {
                pcs.Name              = BrandName.ToUpper();
                pcs.DisplayOrder      = BrandSeq;
                pcs.MetaTitle         = ConvertToUnSign(BrandName);
                pcs.ProductCategoryID = CateID;
                pcs.Status            = false;
                pcsd.Insert(pcs);
                data = "Thêm thành công";
            }
            catch
            {
                data = "Lỗi";
            }
            return(Json(data, JsonRequestBehavior.AllowGet));
        }