示例#1
0
        /// <summary>
        /// 支付返佣金额,返回1成功,其它失败
        /// </summary>
        /// <param name="info">支付信息业务实体</param>
        /// <returns></returns>
        public int PayCommission(EyouSoft.Model.StatisticStructure.MPayCommissionInfo info)
        {
            DbCommand cmd = this._db.GetStoredProcCommand("proc_OtherCost_PayCommission");

            this._db.AddInParameter(cmd, "CostId", DbType.AnsiStringFixedLength, Guid.NewGuid().ToString());
            this._db.AddInParameter(cmd, "TourId", DbType.AnsiStringFixedLength, info.TourId);
            this._db.AddInParameter(cmd, "OrderId", DbType.AnsiStringFixedLength, info.OrderId);
            this._db.AddInParameter(cmd, "CompanyId", DbType.Int32, info.CompanyId);
            this._db.AddInParameter(cmd, "BuyerCompanyId", DbType.Int32, info.BuyerCompanyId);
            this._db.AddInParameter(cmd, "BuyerCompanyName", DbType.String, info.BuyerCompanyName);
            this._db.AddInParameter(cmd, "Amount", DbType.Decimal, info.Amount);
            this._db.AddInParameter(cmd, "PayerId", DbType.Int32, info.PayerId);
            this._db.AddInParameter(cmd, "PayTime", DbType.DateTime, info.PayTime);
            this._db.AddInParameter(cmd, "PayType", DbType.Byte, info.PayType);
            this._db.AddInParameter(cmd, "CostType", DbType.Byte, info.CostType);
            this._db.AddInParameter(cmd, "CostName", DbType.String, info.CostName);
            this._db.AddInParameter(cmd, "ItemType", DbType.String, info.ItemType);
            this._db.AddOutParameter(cmd, "Result", DbType.Int32, 4);

            int sqlExceptionCode = 0;

            try
            {
                DbHelper.RunProcedure(cmd, this._db);
            }
            catch (System.Data.SqlClient.SqlException e)
            {
                sqlExceptionCode = 0 - e.Number;
            }

            if (sqlExceptionCode < 0)
            {
                return(sqlExceptionCode);
            }

            return(Convert.ToInt32(this._db.GetParameterValue(cmd, "Result")));
        }
示例#2
0
        /// <summary>
        /// 支付返佣金额,返回1成功,其它失败
        /// </summary>
        /// <param name="info">支付信息业务实体</param>
        /// <returns></returns>
        /// <remarks>支出明细已完成</remarks>
        public int PayCommission(EyouSoft.Model.StatisticStructure.MPayCommissionInfo info)
        {
            if (info == null || info.BuyerCompanyId < 1 || info.CompanyId < 1 || string.IsNullOrEmpty(info.OrderId) ||
                string.IsNullOrEmpty(info.TourId) || info.PayerId < 1)
            {
                return(0);
            }

            if (info.PayTime == DateTime.MinValue)
            {
                info.PayTime = DateTime.Now;
            }

            int dalExceptionCode = _dal.PayCommission(info);

            if (dalExceptionCode != 1)
            {
                return(dalExceptionCode);
            }

            #region LGWR
            EyouSoft.Model.CompanyStructure.SysHandleLogs logInfo = new EyouSoft.Model.CompanyStructure.SysHandleLogs();
            logInfo.CompanyId    = 0;
            logInfo.DepatId      = 0;
            logInfo.EventCode    = EyouSoft.Model.CompanyStructure.SysHandleLogsNO.EventCode;
            logInfo.EventIp      = string.Empty;
            logInfo.EventMessage = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "{0}在" + EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.客户关系管理_返佣统计.ToString() + "支付返佣,支付金额为:" + info.Amount.ToString("C2") + ",订单编号为:" + info.OrderId;
            logInfo.EventTime    = DateTime.Now;
            logInfo.EventTitle   = "支付返佣";
            logInfo.ModuleId     = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.客户关系管理_返佣统计;
            logInfo.OperatorId   = 0;
            this.Logwr(logInfo);
            #endregion

            return(dalExceptionCode);
        }