예제 #1
0
        public TaxReportWrapper GetTaxAmtRpt(int languageId, DateTime?fromPeriodEnd)
        {
            TaxReportWrapper taxReportWrapper = new TaxReportWrapper {
                hasAnError = false
            };

            AccountingPeriodDal importLoggingDal = new AccountingPeriodDal();

            taxReportWrapper.AvailStartPeriod = importLoggingDal.GetAvailStartPeriods(fromPeriodEnd).ToList();
            taxReportWrapper.AvailEndPeriod   = importLoggingDal.GetAvailEndPeriods(fromPeriodEnd).ToList();
            DropDownsDal genericDal = new DropDownsDal();

            taxReportWrapper.AvailTaxTypes  = genericDal.GetAvailTaxTypes();
            taxReportWrapper.AvailVoucherId = genericDal.GetAvailVauchers();
            return(taxReportWrapper);
        }
        // Only as a sample code. Must be refactored for unit test
        // Also there will be many different type of data that will populate dropdowns
        public DropDownsWrapper GetGenericDropDown(string typeOfData, DateTime?fromPeriod)
        {
            DropDownsWrapper dropDownsWrapper = new DropDownsWrapper {
                hasAnError = false
            };

            switch (typeOfData)
            {
            case "AVAILPERIODS":
                AccountingPeriodDal accountingPeriodDal = new AccountingPeriodDal();
                dropDownsWrapper = new DropDownsWrapper {
                    hasAnError = false
                };
                dropDownsWrapper.AvailDropDownItems = accountingPeriodDal.GetAvailPeriods(fromPeriod).ToList();
                break;

            //case Constants.StartPeriods:
            //    genericWrapperDto = new GenericWrapperDto { HasAnError = false };
            //    genericWrapperDto.AvailDropDownItems = accountingPeriodDal.GetAvailStartPeriods(fromDate).ToList();
            //    break;
            //case Constants.EndPeriods:
            //    genericWrapperDto = new GenericWrapperDto { HasAnError = false };
            //    genericWrapperDto.AvailDropDownItems = accountingPeriodDal.GetAvailEndPeriods(fromDate).ToList();
            //    break;
            //case Constants.TaxType:
            //    var GenericDal1 = new GenericDal();
            //    genericWrapperDto = new GenericWrapperDto { HasAnError = false };
            //    genericWrapperDto.AvailDropDownItems = GenericDal1.GetAvailTaxTypes().ToList();
            //    break;
            //case Constants.Vaucher:
            //    var GenericDal2 = new GenericDal();
            //    genericWrapperDto = new GenericWrapperDto { HasAnError = false };
            //    genericWrapperDto.AvailDropDownItems = GenericDal2.GetAvailVauchers().ToList();
            //    break;
            default:
                dropDownsWrapper.AvailDropDownItems = new List <DropDownItem>();
                break;
            }

            return(dropDownsWrapper);
        }