public ActionResult List(FormCollection collection, int jtStartIndex = 0, int jtPageSize = 0, string jtSorting = null)
        {
            //查詢參數
            var qm    = new CrRegistrationQryModel();
            var isOK  = this.TryUpdateModel(qm);
            var token = collection["__RequestVerificationToken"];

            var classId = qm.Q_ClassId;
            CR_RegistrationDataTable dt = null;

            if (!classId.isNullOrEmpty())
            {
                dt = CrDataService.Instance.CrRegistration_getListByClassId(classId);
            }
            else
            {
                dt = CrDataService.Instance.CrRegistration_getList(qm);
            }

            //排序
            var dtSorted = dt.sort(jtSorting);

            if (Request.IsAjaxRequest())
            {
                return(converToJTableSource(dtSorted, jtStartIndex, jtPageSize));
            }
            else
            {
                return(View(dt));
            }
        }
        public ActionResult UserList(FormCollection collection, int jtStartIndex = 0, int jtPageSize = 0, string jtSorting = null)
        {
            //查詢參數
            var qm    = new CrRegistrationQryModel();
            var isOK  = this.TryUpdateModel(qm);
            var token = collection["__RequestVerificationToken"];

            var theDate = DateTime.Today.toTwFormat("D");
            var classId = qm.Q_ClassId;
            var dt      = NsDmHelper.CR_Registration
                          .selectAll(t => t.AllExt)
                          .where (t =>
                                  t.CRR_RegisterStartDate_XX <= theDate.toConstReq1()
                                  & t.CRR_RegisterEndDate_XX >= theDate.toConstReq1()
                                  & t.CRR_CreatorCode_XX == qm.Q_CreatorCode_XX.toConstReq1()
                                  & t.CRR_Name == qm.Q_Name.toConstReq1()
                                  )
                          .query();

            //排序
            var dtSorted = dt.sort(jtSorting);

            if (Request.IsAjaxRequest())
            {
                return(converToJTableSource(dtSorted, jtStartIndex, jtPageSize));
            }
            else
            {
                return(View(dt));
            }
        }
        public ActionResult Index()
        {
            var qm = new CrRegistrationQryModel();

            qm.Q_CourseEnable = "Y";
            return(View(qm));
        }
Exemplo n.º 4
0
        public ActionResult List(FormCollection collection, int jtStartIndex = 0, int jtPageSize = 0, string jtSorting = null)
        {
            //查詢參數
            var qm    = new CrRegistrationQryModel();
            var isOK  = this.TryUpdateModel(qm);
            var token = collection["__RequestVerificationToken"];

            var dt = CrDataService.Instance.CrCourse_getList(qm);

            //排序
            var dtSorted = dt.sort(jtSorting);

            if (Request.IsAjaxRequest())
            {
                //var data = jtPageSize > 0 ? dtSorted.Skip(jtStartIndex).Take(jtPageSize).ToList() : dtSorted.ToList();
                //var list = data.toDictionaryList();
                //var jsonData = new
                //{
                //    Result = jTable_SUCCESS_CODE,
                //    Records = list,
                //    TotalRecordCount = dtSorted.Count()
                //};
                //return Json(jsonData);
                return(converToJTableSource(dtSorted, jtStartIndex, jtPageSize));
            }
            else
            {
                return(View(dt));
            }
        }
Exemplo n.º 5
0
        //[HttpPost]
        //[ValidateAntiForgeryToken]
        public ActionResult CRR020(FormCollection collection)
        {
            //查詢參數
            var token = collection["__RequestVerificationToken"];

            //塞入查詢參數
            var qm   = new CrRegistrationQryModel();
            var isOK = this.TryUpdateModel(qm);

            qm.ReportId         = "CRR020";
            qm.ExportName       = "CRR020_教育訓練簽到表.xlsx";
            qm.ReportSourceType = 0;
            qm.ReportType       = FtbReportTypes.Xlsx;

            //直接列印
            string contentType = qm.ReportType.ToString();

            //取得報表資訊
            var rawData = CrReportService.Instance.CRR020(qm, ref contentType);

            if (rawData == null)
            {
                return(View("NoData"));
            }
            return(File(rawData, contentType, qm.ExportName));
        }
        public ActionResult CodeQuery(FormCollection collection)
        {
            var qm  = new CrRegistrationQryModel();
            var bln = this.TryUpdateModel(qm);

            ViewBag.RequestKey = qm.RequestKey;
            return(View(qm));
        }
        //學員本人的報名清單
        public ActionResult UserList(FormCollection collection)
        {
            var qm  = new CrRegistrationQryModel();
            var bln = this.TryUpdateModel(qm);

            qm.Q_CreatorCode_XX = AppUserSession.User.LoginAccount;
            ViewBag.RequestKey  = qm.RequestKey;
            return(View(qm));
        }
Exemplo n.º 8
0
        //簽到表
        public byte[] CRR020(CrRegistrationQryModel qm, ref string contenttype)
        {
            var dt = NsDmHelper.CR_Registration
                     .selectAll(t => t.AllExt)
                     .where (t =>
                             t.CRR_CourseId_XX == qm.Q_CourseId.toConstReq1()
                             & t.CRR_ClassId == qm.Q_ClassId.toConstOpt1()
                             )
                     .orderby(t => new[] {
                t.CRR_ClassDate_XX.Asc,
                t.CRR_ClassTime_XX.Asc,
                t.CRR_CreateDate.Asc
            })
                     .query();

            //無資料
            if (dt == null)
            {
                dt = new CR_RegistrationDataTable();
            }

            ReportViewer reportViewer1 = new ReportViewer();

            reportViewer1.LocalReport.DataSources.Clear();

            //取得報表檔組件
            var assembly = getReportAssembly();
            //取得報表定義檔
            var reportFile = string.Empty;

            reportFile = "CRR020Rpt.rdlc";
            Stream fileStream = assembly.GetManifestResourceStream("ftd.report." + reportFile);

            reportViewer1.LocalReport.LoadReportDefinition(fileStream);

            dt.TableName = "CR_Registration";
            reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource(dt.TableName, dt as DataTable));

            #region 報表參數設定
            var companyName  = FtdConfigService.Instance.getAppSettingValue("CompanyName", "");
            var pCompanyName = new ReportParameter("P_CompanyName", companyName);
            reportViewer1.LocalReport.SetParameters(new ReportParameter[] { pCompanyName });
            #endregion

            Microsoft.Reporting.WebForms.Warning[] tWarnings;
            string[] tStreamids;
            string   tMimeType;
            string   tEncoding;
            string   tExtension;
            string   fileFormat = getPrintType(contenttype.ToLower());

            byte[] tBytes = reportViewer1.LocalReport.Render(fileFormat, "<DeviceInfo><AutoFit>Never</AutoFit></DeviceInfo>", out tMimeType, out tEncoding, out tExtension, out tStreamids, out tWarnings);
            contenttype = tMimeType;
            return(tBytes);
        }
Exemplo n.º 9
0
        public CR_CourseDataTable CrCourse_getList(CrRegistrationQryModel qm)
        {
            var dt = NsDmHelper.CR_Course
                     .selectAll(t => t.AllExt)
                     .where (t =>
                             t.CRC_Code == qm.Q_CourseCode.toConstOpt1()
                             & t.CRC_Name.contains(qm.Q_CourseName.toConstOpt1())
                             )
                     .query();

            return(dt);
        }
Exemplo n.º 10
0
        public CR_RegistrationDataTable CrRegistration_getList(CrRegistrationQryModel qm)
        {
            var dt = NsDmHelper.CR_Registration
                     .selectAll(t => t.AllExt)
                     .where (t =>
                             t.CRR_CourseCode_XX == qm.Q_CourseCode.toConstOpt1()
                             & t.CRR_ClassCode_XX == qm.Q_ClassCode.toConstOpt1()
                             & t.CRR_ClassDate_XX == qm.Q_ClassDate.toConstOpt1()
                             & t.CRR_CitizenId == qm.Q_CitizenId.toConstOpt1()
                             & t.CRR_Email == qm.Q_Email.toConstOpt1()
                             & t.CRR_FoodKind == qm.Q_FoodKind.toConstOpt1()
                             & t.CRR_CourseName_XX.contains(qm.Q_CourseName.toConstOpt1())
                             )
                     .query();

            return(dt);
        }
Exemplo n.º 11
0
 public byte[] CRR030(CrRegistrationQryModel qm, ref string contenttype)
 {
     return(null);
 }
Exemplo n.º 12
0
        public ActionResult CRM010()
        {
            var qm = new CrRegistrationQryModel();

            return(View(qm));
        }