Ejemplo n.º 1
0
        public Models.SummaryMarketingSalesResultDo GetSummaryMarketingSales(Models.SummarySalesCriteriaDo criteria)
        {
            Models.SummaryMarketingSalesResultDo result = new Models.SummaryMarketingSalesResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandType = System.Data.CommandType.StoredProcedure;
                command.CommandText = "[dbo].[sp_Get_SummaryMarketingSales]";

                command.AddParameter(typeof(string), "BrandCode", criteria.BrandCode);
                command.AddParameter(typeof(int), "BranchID", criteria.BranchID);
                command.AddParameter(typeof(string), "Duration", criteria.Duration);
                command.AddParameter(typeof(DateTime), "RangeDateTimeFrom", criteria.RangeDateTimeFrom);
                command.AddParameter(typeof(DateTime), "RangeDateTimeTo", criteria.RangeDateTimeTo);
                command.AddParameter(typeof(DateTime), "RangeDateFrom", criteria.RangeDateFrom);
                command.AddParameter(typeof(DateTime), "RangeDateFromTime", criteria.RangeDateFromTime);
                command.AddParameter(typeof(DateTime), "RangeDateTo", criteria.RangeDateTo);
                command.AddParameter(typeof(DateTime), "RangeDateToTime", criteria.RangeDateToTime);
                command.AddParameter(typeof(DateTime), "RangeMonth", criteria.RangeMonth);
                command.AddParameter(typeof(DateTime), "RangeYear", criteria.RangeYear);

                Utils.SQL.ISQLDbParameter output = command.AddSearchParameter(criteria, false, false);

                result.Rows = command.ToList <Models.SummaryMarketingSalesDo>();
                result.TotalRecordParameter(output);
            }));

            return(result);
        }
Ejemplo n.º 2
0
        public Models.SummarySalesPromotionResultDo GetSummarySalesPromotion(Models.SummarySalesCriteriaDo criteria)
        {
            Models.SummarySalesPromotionResultDo result = new Models.SummarySalesPromotionResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandType = System.Data.CommandType.StoredProcedure;
                command.CommandText = "[dbo].[sp_Get_SummarySalesPromotion]";

                command.AddParameter(typeof(string), "BrandCode", criteria.BrandCode);
                command.AddParameter(typeof(int), "BranchID", criteria.BranchID);
                command.AddParameter(typeof(DateTime), "RangeDateTimeFrom", criteria.RangeDateTimeFrom);
                command.AddParameter(typeof(DateTime), "RangeDateTimeTo", criteria.RangeDateTimeTo);
                command.AddParameter(typeof(DateTime), "RangeDateFrom", criteria.RangeDateFrom);
                command.AddParameter(typeof(DateTime), "RangeDateFromTime", criteria.RangeDateFromTime);
                command.AddParameter(typeof(DateTime), "RangeDateTo", criteria.RangeDateTo);
                command.AddParameter(typeof(DateTime), "RangeDateToTime", criteria.RangeDateToTime);
                command.AddParameter(typeof(DateTime), "RangeMonth", criteria.RangeMonth);
                command.AddParameter(typeof(DateTime), "RangeYear", criteria.RangeYear);

                command.AddParameter(typeof(bool), "FlagMember", criteria.FlagMember);
                command.AddParameter(typeof(int), "MemberTypeID", criteria.MemberTypeID);
                command.AddParameter(typeof(int), "MemberUseFrom", criteria.MemberUseFrom);
                command.AddParameter(typeof(int), "MemberUseTo", criteria.MemberUseTo);
                command.AddParameter(typeof(decimal), "MemberUseAmtFrom", criteria.MemberUseAmtFrom);
                command.AddParameter(typeof(decimal), "MemberUseAmtTo", criteria.MemberUseAmtTo);

                result.Rows         = command.ToList <Models.SummarySalesPromotionDo>();
                result.TotalRecords = result.Rows.Count;
            }));

            return(result);
        }