コード例 #1
0
        public ActionResult <RefProductCategories> editRefProductCategories([FromBody] RefProductCategories RPC, string id)
        {
            bool boolAdd = _resRefProductCategories.EditRefProductCategories(id, RPC);

            if (boolAdd)
            {
                return(Ok(boolAdd));
            }
            return(Ok(_errorEdit));
        }
コード例 #2
0
        public ActionResult <RefProductCategories> createRefProductCategories([FromBody] RefProductCategories RPC)
        {
            bool boolAdd = _resRefProductCategories.CreateRefProductCategories(RPC);

            if (boolAdd)
            {
                return(Ok(boolAdd));
            }
            return(Ok(_errorAdd));
        }
コード例 #3
0
 public bool CreateRefProductCategories(RefProductCategories RPC)
 {
     try
     {
         var addCustome = db.RefProductCategories.Add(RPC);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
コード例 #4
0
        public bool EditRefProductCategories(string id, RefProductCategories RPC)
        {
            var findIdRefProductCategories = db.RefProductCategories.Find(id);

            if (findIdRefProductCategories != null)
            {
                findIdRefProductCategories.ProductCategoryDescription = RPC.ProductCategoryDescription;
                db.SaveChanges();
                return(true);
            }
            else
            {
                return(false);
            }
        }