Ejemplo n.º 1
0
        public List <DA_TRN> GetLimitOverwriteReport(SessionInfo sessionInfo, string strReportDate, string strCtpy)
        {
            try
            {
                DateTime     dteReport;
                Guid         guCtpyID      = Guid.Empty;
                DealBusiness _dealBusiness = new DealBusiness();
                if (String.IsNullOrEmpty(strReportDate))
                {
                    throw this.CreateException(new Exception(), "Please input date.");
                }
                else if (!DateTime.TryParseExact(strReportDate, "dd/MM/yyyy", null, DateTimeStyles.None, out dteReport))
                {
                    throw this.CreateException(new Exception(), "Invalid date.");
                }
                else
                {
                    dteReport = DateTime.ParseExact(strReportDate, "dd/MM/yyyy", null);
                }

                var trns = _dealBusiness.GetDealByProcessDate(dteReport).AsQueryable();
                trns = trns.Where(t => t.OVER_APPROVER != null && t.SOURCE == "INT" && t.MA_STATUS.LABEL != StatusCode.CANCELLED.ToString());
                if (Guid.TryParse(strCtpy, out guCtpyID))
                {
                    trns = trns.Where(a => a.CTPY_ID == guCtpyID);
                }
                return(trns.ToList());
            }
            catch (DataServicesException ex)
            {
                throw this.CreateException(ex, null);
            }
        }
Ejemplo n.º 2
0
        public void GetDealByProcessDateTest()
        {
            DealBusiness  target      = new DealBusiness(); // TODO: Initialize to an appropriate value
            DateTime      processdate = new DateTime();     // TODO: Initialize to an appropriate value
            List <DA_TRN> expected    = null;               // TODO: Initialize to an appropriate value
            List <DA_TRN> actual;

            actual = target.GetDealByProcessDate(processdate);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Ejemplo n.º 3
0
        public List <DA_TRN> GetPCEDetailReport(SessionInfo sessioninfo, string strReportDate, string strCtpy, string strProduct, string strSource)
        {
            try
            {
                DateTime     dteReport;
                DealBusiness _dealBusiness = new DealBusiness();
                Guid         guTemp;

                if (String.IsNullOrEmpty(strReportDate))
                {
                    throw this.CreateException(new Exception(), "Please input report date.");
                }
                else if (!DateTime.TryParseExact(strReportDate, "dd/MM/yyyy", null, DateTimeStyles.None, out dteReport))
                {
                    throw this.CreateException(new Exception(), "Invalid report date.");
                }
                else
                {
                    dteReport = DateTime.ParseExact(strReportDate, "dd/MM/yyyy", null);
                }

                if (_dealBusiness.CountByProcessDate(dteReport) == 0)
                {
                    throw this.CreateException(new Exception(), "No data for selected report date.");
                }

                var trns = _dealBusiness.GetDealByProcessDate(dteReport).Where(p => p.MA_STATUS.LABEL.ToString() != StatusCode.CANCELLED.ToString()).AsQueryable();

                if (!string.IsNullOrEmpty(strSource))
                {
                    trns = trns.Where(p => p.SOURCE == strSource);
                }

                if (Guid.TryParse(strCtpy, out guTemp))
                {
                    trns = trns.Where(t => t.CTPY_ID == Guid.Parse(strCtpy));
                }

                if (Guid.TryParse(strProduct, out guTemp))
                {
                    trns = trns.Where(s => s.PRODUCT_ID == Guid.Parse(strProduct));
                }

                return(trns.ToList());
            }

            catch (DataServicesException ex)
            {
                throw this.CreateException(ex, null);
            }
        }