Ejemplo n.º 1
0
        /// <summary>
        /// 新增
        /// <summary>
        public bool Insert(b_category_Entity model)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            if (model.Parent_Category_ID != null && model.Parent_Category_ID.HasValue)
            {
                dic["Parent_Category_ID"] = model.Parent_Category_ID;
            }
            if (model.Category_Name_CH != null)
            {
                dic["Category_Name_CH"] = model.Category_Name_CH;
            }
            if (model.Category_Name_HK != null)
            {
                dic["Category_Name_HK"] = model.Category_Name_HK;
            }
            if (model.Category_Status != null && model.Category_Status.HasValue)
            {
                dic["Category_Status"] = model.Category_Status;
            }
            if (model.Category_Seq >= 0)
            {
                dic["Category_Seq"] = model.Category_Seq;
            }
            if (model.Create_UserId != null)
            {
                dic["Create_UserId"] = model.Create_UserId;
            }
            if (model.Create_User != null)
            {
                dic["Create_User"] = model.Create_User;
            }
            return(SQLHelperFactory.Instance.ExecuteNonQuery("Insert_b_category", dic) > 0);
        }
Ejemplo n.º 2
0
        public ActionResult <object> Update([FromBody] b_categoryVM model, int Category_ID)
        {
            b_category_Entity entity = model.ConvertToT <b_category_Entity>();

            this.SetUpdateUserInfo(entity);
            CacheFactory.CacheInstance.RemovePrefix(Constant.Cache_Category_Prefix);
            return(this._repository.Update(entity, Category_ID).ResponseSuccess());
        }
Ejemplo n.º 3
0
        public ActionResult <object> Delete(int Category_ID)
        {
            b_category_Entity entity = new b_category_Entity();

            this.SetUpdateUserInfo(entity);
            this._repository.Update(entity, Category_ID);
            CacheFactory.CacheInstance.RemovePrefix(Constant.Cache_Category_Prefix);
            return(this._repository.Delete(Category_ID).ResponseSuccess());
        }