コード例 #1
0
        public ResponseDto <ReportPersonSummaryDto> GetSummary(ReportPersonSummaryGetCriteriaDto criteriaDto)
        {
            ReportPersonSummaryGetCriteriaBo criteriaBo = new ReportPersonSummaryGetCriteriaBo()
            {
                IssueDateStart = criteriaDto.IssueDateStartNumber.ToDateTimeFromNumber(),
                IssueDateEnd   = criteriaDto.IssueDateEndNumber.ToDateTimeFromNumber(),

                CurrencyId = criteriaDto.CurrencyId,

                Session = Session
            };

            ResponseBo <ReportPersonSummaryBo> responseBo = reportPersonBusiness.GetSummary(criteriaBo);

            ResponseDto <ReportPersonSummaryDto> responseDto = responseBo.ToResponseDto <ReportPersonSummaryDto, ReportPersonSummaryBo>();

            if (responseBo.IsSuccess && responseBo.Bo != null)
            {
                responseDto.Dto = new ReportPersonSummaryDto();
                responseDto.Dto.SaleGrandTotal = responseBo.Bo.SaleGrandTotal;
                responseDto.Dto.SaleCostTotal  = responseBo.Bo.SaleCostTotal;

                responseDto.Dto.CreditTotal = responseBo.Bo.CreditTotal;
                responseDto.Dto.DebtTotal   = responseBo.Bo.DebtTotal;

                responseDto.Dto.RevenueCashTotal = responseBo.Bo.RevenueCashTotal;
                responseDto.Dto.RevenueBankTotal = responseBo.Bo.RevenueBankTotal;
                responseDto.Dto.ChargeSaleTotal  = responseBo.Bo.ChargeSaleTotal;

                responseDto.Dto.PersonAccountCashTotal       = responseBo.Bo.PersonAccountCashTotal;
                responseDto.Dto.PersonAccountBankTotal       = responseBo.Bo.PersonAccountBankTotal;
                responseDto.Dto.PersonAccountCreditCardTotal = responseBo.Bo.PersonAccountCreditCardTotal;
            }

            return(responseDto);
        }
コード例 #2
0
        public ResponseBo <ReportPersonSummaryBo> GetSummary(ReportPersonSummaryGetCriteriaBo criteriaBo)
        {
            ResponseBo <ReportPersonSummaryBo> responseBo = new ResponseBo <ReportPersonSummaryBo>();

            try
            {
                using (SqlConnection conn = DbAccess.Connection.GetConn())
                {
                    var p = new DynamicParameters();
                    p.Add("@Message", dbType: DbType.String, direction: ParameterDirection.Output, size: 255);
                    p.Add("@IsSuccess", dbType: DbType.Boolean, direction: ParameterDirection.Output);

                    p.Add("@SaleGrandTotal", dbType: DbType.Decimal, direction: ParameterDirection.Output, precision: 18, scale: 2);
                    p.Add("@SaleCostTotal", dbType: DbType.Decimal, direction: ParameterDirection.Output, precision: 18, scale: 2);

                    p.Add("@CreditTotal", dbType: DbType.Decimal, direction: ParameterDirection.Output, precision: 18, scale: 2);
                    p.Add("@DebtTotal", dbType: DbType.Decimal, direction: ParameterDirection.Output, precision: 18, scale: 2);

                    p.Add("@RevenueCashTotal", dbType: DbType.Decimal, direction: ParameterDirection.Output, precision: 18, scale: 2);
                    p.Add("@RevenueBankTotal", dbType: DbType.Decimal, direction: ParameterDirection.Output, precision: 18, scale: 2);
                    p.Add("@ChargeSaleTotal", dbType: DbType.Decimal, direction: ParameterDirection.Output, precision: 18, scale: 2);

                    p.Add("@PersonAccountCashTotal", dbType: DbType.Decimal, direction: ParameterDirection.Output, precision: 18, scale: 2);
                    p.Add("@PersonAccountBankTotal", dbType: DbType.Decimal, direction: ParameterDirection.Output, precision: 18, scale: 2);
                    p.Add("@PersonAccountCreditCardTotal", dbType: DbType.Decimal, direction: ParameterDirection.Output, precision: 18, scale: 2);

                    p.Add("@IssueDateStart", criteriaBo.IssueDateStart.Date, DbType.Date, ParameterDirection.Input);
                    p.Add("@IssueDateEnd", criteriaBo.IssueDateEnd.Date, DbType.Date, ParameterDirection.Input);
                    p.Add("@CurrencyId", criteriaBo.CurrencyId, DbType.Int32, ParameterDirection.Input);

                    p.Add("@MyPersonId", criteriaBo.Session.MyPerson.Id, DbType.Int64, ParameterDirection.Input);
                    p.Add("@OperatorRealId", criteriaBo.Session.RealPerson.Id, DbType.Int64, ParameterDirection.Input);
                    p.Add("@LanguageId", criteriaBo.Session.RealPerson.LanguageId, DbType.Int32, ParameterDirection.Input);

                    conn.Execute("spReportPersonSummary", p, commandType: CommandType.StoredProcedure);
                    responseBo.Message   = p.Get <string>("@Message");
                    responseBo.IsSuccess = p.Get <bool>("@IsSuccess");

                    responseBo.Bo = new ReportPersonSummaryBo();
                    responseBo.Bo.SaleGrandTotal = p.Get <decimal>("@SaleGrandTotal");
                    responseBo.Bo.SaleCostTotal  = p.Get <decimal>("@SaleCostTotal");

                    responseBo.Bo.CreditTotal = p.Get <decimal>("@CreditTotal");
                    responseBo.Bo.DebtTotal   = p.Get <decimal>("@DebtTotal");

                    responseBo.Bo.RevenueCashTotal = p.Get <decimal>("@RevenueCashTotal");
                    responseBo.Bo.RevenueBankTotal = p.Get <decimal>("@RevenueBankTotal");
                    responseBo.Bo.ChargeSaleTotal  = p.Get <decimal>("@ChargeSaleTotal");

                    responseBo.Bo.PersonAccountCashTotal       = p.Get <decimal>("@PersonAccountCashTotal");
                    responseBo.Bo.PersonAccountBankTotal       = p.Get <decimal>("@PersonAccountBankTotal");
                    responseBo.Bo.PersonAccountCreditCardTotal = p.Get <decimal>("@PersonAccountCreditCardTotal");
                }
            }
            catch (Exception ex)
            {
                responseBo = base.SaveExLog(ex, this.GetType(), MethodBase.GetCurrentMethod().Name, criteriaBo).ToResponse <ReportPersonSummaryBo>();
            }

            return(responseBo);
        }