Esempio n. 1
0
        public bool PostTPReport(string vstrUser,
                                 TopProgsReportCall vclsTPCall,
                                 ref BLTopProgsReport rlstEventRes,
                                 ref string rstrErr)
        {
            List <BLTopProgsReport> lstResult = null;
            bool blnOk = false;

            if (PostInfo(ENDPOINT_VAXI_RF_REP_TOPPROGS, vstrUser, vclsTPCall, ref lstResult, ref rstrErr))
            {
                if (lstResult != null && lstResult.Count > 0)
                {
                    rlstEventRes = lstResult[0];
                    blnOk        = true;
                }
            }

            return(blnOk);
        }
Esempio n. 2
0
        private bool CalcTPRep(string vstrUser,
                               string[] varrRegID,
                               string[] varrChanID,
                               string[] varrDate,
                               string[] varrTarg,
                               TPFilter vclsFilt,
                               ref BLTopProgsReport rclsTPRep,
                               ref string rstrErr)
        {
            TopProgsReportCall clsTPCall = null;
            APIHelper          apiHlp    = null;
            bool blnOk = false;

            try
            {
                clsTPCall = new TopProgsReportCall();

                foreach (string x in varrRegID)
                {
                    clsTPCall.RegionIDs.Add(Convert.ToInt32(x));
                }

                foreach (string x in varrChanID)
                {
                    clsTPCall.ChannelIDs.Add(Convert.ToInt32(x));
                }

                clsTPCall.EventTypeIDs.Add(2);

                clsTPCall.TimeFrom       = vclsFilt.StartTime;
                clsTPCall.TimeTo         = vclsFilt.EndTime;
                clsTPCall.InclusiveTimes = vclsFilt.TimeInclusive;

                clsTPCall.SearchTitle = vclsFilt.SearchTitle;

                foreach (string x in vclsFilt.DaysOfWk)
                {
                    clsTPCall.DaysOfWeek.Add(x);
                }

                clsTPCall.Dates.Add(DateTime.FromBinary(Convert.ToInt64(varrDate.First())));
                clsTPCall.Dates.Add(DateTime.FromBinary(Convert.ToInt64(varrDate.Last())));

                foreach (string x in varrTarg)
                {
                    clsTPCall.TargetIDs.Add(Convert.ToInt32(x));
                }

                clsTPCall.Metrics.Add(BLMETRICTYPE.GRP);
                clsTPCall.Metrics.Add(BLMETRICTYPE.Thousands);

                apiHlp = new APIHelper();
                if (apiHlp.PostTPReport(vstrUser, clsTPCall, ref rclsTPRep, ref rstrErr))
                {
                    if (rclsTPRep != null && rclsTPRep.EventResults != null && rclsTPRep.EventResults.Count > 0)
                    {
                        blnOk = true;
                    }
                    else
                    {
                        rstrErr = "No events found. Please change your selections.";
                    }
                }
            }
            catch (Exception exc)
            {
                rstrErr = "Unexpected error:" + exc.Message;
            }

            return(blnOk);
        }