Esempio n. 1
0
        /// <summary>
        /// 保存记账记录
        /// </summary>
        /// <param name="_entity"></param>
        /// <returns></returns>
        public bool SaveOutBill(OutBillEntity _entity)
        {
            int _result = 0;

            if (string.IsNullOrEmpty(_entity.SubID) &&
                !string.IsNullOrEmpty(_entity.SubContent))
            {
                _entity.SubID = LoadMaxSubId();
            }
            if (string.IsNullOrEmpty(_entity.SubID))
            {
                _entity.SubID = "null";
            }

            string _sql = string.Format(_insertSql, _entity.OpenId,
                                        _entity.ItemName, _entity.ItemMoney, _entity.ItemDate, _entity.SubID);

            _result = DataAccess.ExecNonQuery(_sql);
            if (_result <= 0)
            {
                return(_result > 0);
            }

            if (!string.IsNullOrEmpty(_entity.SubContent))
            {
                _sql    = string.Format(_subSql, _entity.SubID, _entity.SubContent);
                _result = DataAccess.ExecNonQuery(_sql);
            }

            return(_result > 0);
        }
Esempio n. 2
0
        /// <summary>
        /// 保存记账记录
        /// </summary>
        /// <param name="OpenId">用户标识</param>
        /// <param name="ItemName">项目名称</param>
        /// <param name="ItemMoney">项目金额</param>
        /// <param name="ItemDate">记录时间</param>
        /// <param name="SubID">备注ID</param>
        /// <param name="SubContent">备注内容</param>
        /// <returns></returns>
        public bool SaveOutBill(string OpenId, string ItemName, string ItemMoney, string ItemDate, string SubID, string SubContent = "")
        {
            OutBillEntity _entiry = new OutBillEntity();

            _entiry.OpenId     = OpenId;
            _entiry.ItemName   = ItemName;
            _entiry.ItemMoney  = ItemMoney;
            _entiry.ItemDate   = ItemDate;
            _entiry.SubID      = SubID;
            _entiry.SubContent = SubContent;
            return(SaveOutBill(_entiry));
        }