Exemplo n.º 1
0
        public JsonResult UpdateClassify(int classifyId, string classifyName)
        {
            Tsql_Classify daClassify = new Tsql_Classify();

            daClassify.SelectByClassifyId(classifyId);
            daClassify.ClassifyName = classifyName;
            if (!daClassify.Update())
            {
                return(FailResult(daClassify.PromptInfo.Message));
            }
            return(SuccessResult());
        }
Exemplo n.º 2
0
        public bool DeleteClassify(int id)
        {
            Tsql_Classify daClassify = new Tsql_Classify();

            daClassify.SelectByClassifyId(id);
            daClassify.Status = 0;
            if (daClassify.Update())
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 3
0
        public JsonResult AddClassify(string ClassifyName)
        {
            Tsql_Classify daClassify = new Tsql_Classify()
            {
                ClassifyName = ClassifyName,
                ParentId     = 0,
                Status       = 1
            };

            if (daClassify.Verificationtitle(ClassifyName))
            {
                return(FailResult("该类名已存在"));
            }
            if (!daClassify.Insert())
            {
                return(FailResult(daClassify.PromptInfo.Message));
            }
            return(SuccessResult());
        }