/// <summary>
        /// 更新固定资产分类
        /// </summary>
        /// <param name="grp">固定资产分类对象</param>
        /// <returns></returns>
        public string UpdAssetsGroup(T_AssetsGroup grp)
        {
            string msg = string.Empty;

            grp.C_GUID = Session["CurrentCompany"].ToString();
            bool result = new FixedAssetsSvc().UpdAssetsGroup(grp);

            if (result)
            {
                msg = General.Resource.Common.Success;
            }
            else
            {
                msg = General.Resource.Common.Failed;
            }
            return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}"
                                 , result.ToString().ToLower(), msg));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 更新资产分类
        /// </summary>
        /// <param name="item">资产分类对象</param>
        /// <returns></returns>
        public bool UpdAssetsGroup(T_AssetsGroup item)
        {
            DBHelper dh = new DBHelper();

            dh.strCmd = "SP_UpdAssetsGroup";
            dh.AddPare("@GUID", SqlDbType.NVarChar, 50, item.AG_GUID);
            dh.AddPare("@NAME", SqlDbType.NVarChar, 50, item.Name);
            dh.AddPare("@method", SqlDbType.Int, 0, item.DepreciationMethod);
            dh.AddPare("@SalvageRate", SqlDbType.Decimal, 7, item.SalvageRate);
            dh.AddPare("@life", SqlDbType.Int, 0, item.Life);
            dh.AddPare("@C_GUID", SqlDbType.NVarChar, 50, item.C_GUID);
            try
            {
                dh.NonQuery();
                return(true);
            }
            catch (System.Exception ex)
            {
                return(false);
            }
        }