コード例 #1
0
        public ActionResult Index(string Reports, string ProgramType = null, string Quarter = null, string InvoicePeriod = null)
        {
            int ReportId = 0;

            if (!string.IsNullOrEmpty(Reports) || !string.IsNullOrEmpty(ProgramType))
            {
                string data = Core.Security.DecodeUrlandDecrypt(Reports);
                ReportId = Convert.ToInt32(data);
                string Program = "0";
                if (!string.IsNullOrEmpty(ProgramType))
                {
                    Program = Core.Security.DecodeUrlandDecrypt(ProgramType);
                }
                int ProgramTypeId = Convert.ToInt32(Program);
                if (ReportId > 0)
                {
                    ExportToExcel(ReportId, Quarter, InvoicePeriod, ProgramTypeId);
                }
            }

            IList <ProgramType> ProgramTypes = null;

            ProgramTypes            = _reportDao.GetProgramTypeList();
            ViewBag.ProgramTypeList = (ProgramTypes == null) ? new List <SelectListItem>() : ProgramTypes.Select(SG => new SelectListItem
            {
                Text  = SG.Name,
                Value = Security.Encrypt <string>(SG.Id.ToString())
            }).ToList();

            IList <Report> Report = null;

            Report = _reportDao.GetReportList();
            ViewBag.ReportsList = (Reports == null) ? new List <SelectListItem>() : Report.Select(SG => new SelectListItem
            {
                Text  = SG.Name,
                Value = Security.Encrypt <string>(SG.Id.ToString())
            }).ToList();

            IList <Claim> InvoicePeriods = null;

            InvoicePeriods            = _reportDao.GetInvoicePeriodList(ReportId == 7);
            ViewBag.InvoicePeriodList = (InvoicePeriods == null) ? new List <SelectListItem>() : InvoicePeriods.Select(SG => new SelectListItem
            {
                Text  = SG.InvoicePeriod,
                Value = SG.InvoicePeriod
            }).ToList();
            return(View());
        }