コード例 #1
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="detail">类别对象</param>
        /// <returns></returns>
        public bool UpdDetail(T_DetailedCategories detail)
        {
            DBHelper dh = new DBHelper();

            dh.strCmd = "SP_UpdDetail";
            dh.AddPare("@GUID", SqlDbType.NVarChar, 40, detail.GUID);
            dh.AddPare("@Name", SqlDbType.NVarChar, 40, detail.Name);
            dh.AddPare("@State", SqlDbType.NVarChar, 40, detail.State);
            try
            {
                dh.NonQuery();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
コード例 #2
0
        /// <summary>
        /// 新增类别
        /// </summary>
        /// <returns></returns>
        public string UpdDetail(string guid, string name)
        {
            T_DetailedCategories detail = new T_DetailedCategories();

            detail.GUID  = guid;
            detail.Name  = name;
            detail.State = "启用";
            bool   result = new DetailSvc().UpdDetail(detail);
            string msg    = string.Empty;

            if (result)
            {
                msg = General.Resource.Common.Success;
            }
            else
            {
                msg = General.Resource.Common.Failed;
            }
            return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}"
                                 , result.ToString().ToLower(), msg));
        }