예제 #1
1
 public FileContentResult ListExcel(IDbConnection connection, ListRequest request)
 {
     var data = List(connection, request).Entities;
     var report = new DynamicDataReport(data, request.IncludeColumns, typeof(Columns.ProductColumns));
     var bytes = new ReportRepository().Render(report);
     return ExcelContentResult.Create(bytes, "ProductList_" +
         DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".xlsx");
 }
예제 #2
0
        public FileContentResult ListExcel(IDbConnection connection, ListRequest request)
        {
            var data   = List(connection, request).Entities;
            var report = new Serenity.Reporting.DynamicDataReport(data, request.IncludeColumns, typeof(Columns.IcnColumns));
            var bytes  = new ReportRepository().Render(report);

            return(ExcelContentResult.Create(bytes, "ICNRecords_" +
                                             System.DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".xlsx"));
        }
        private async Task PerformExportBodyBinary(Guid idReport, Func <Task <IOrganizationServiceExtented> > getService, string fieldName, string fieldTitle)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            ToggleControls(false, Properties.OutputStrings.ExportingBodyBinaryForFieldFormat1, fieldName);

            var service = await getService();

            try
            {
                if (service != null)
                {
                    var repository = new ReportRepository(service);

                    Report reportWithBodyBinary = await repository.GetByIdAsync(idReport, ColumnSetInstances.AllColumns);

                    if (!string.IsNullOrEmpty(reportWithBodyBinary.BodyBinary))
                    {
                        string extension = Path.GetExtension(reportWithBodyBinary.FileName);

                        string fileName = EntityFileNameFormatter.GetReportFileName(service.ConnectionData.Name, reportWithBodyBinary.Name, reportWithBodyBinary.Id, fieldTitle, extension);
                        string filePath = Path.Combine(_commonConfig.FolderForExport, FileOperations.RemoveWrongSymbols(fileName));

                        var array = Convert.FromBase64String(reportWithBodyBinary.BodyBinary);

                        File.WriteAllBytes(filePath, array);

                        this._iWriteToOutput.WriteToOutput(service.ConnectionData, Properties.OutputStrings.InConnectionEntityFieldExportedToFormat5, service.ConnectionData.Name, Report.Schema.EntityLogicalName, reportWithBodyBinary.Name, fieldTitle, filePath);

                        if (File.Exists(filePath))
                        {
                            if (_commonConfig.DefaultFileAction != FileAction.None)
                            {
                                this._iWriteToOutput.SelectFileInFolder(service.ConnectionData, filePath);
                            }
                        }
                    }
                    else
                    {
                        this._iWriteToOutput.WriteToOutput(service.ConnectionData, Properties.OutputStrings.InConnectionEntityFieldIsEmptyFormat4, service.ConnectionData.Name, Report.Schema.EntityLogicalName, reportWithBodyBinary.Name, fieldTitle);
                        this._iWriteToOutput.WriteToOutput(null, Properties.OutputStrings.InConnectionEntityFieldIsEmptyFormat4, service.ConnectionData.Name, Report.Schema.EntityLogicalName, reportWithBodyBinary.Name, fieldTitle);
                        this._iWriteToOutput.ActivateOutputWindow(null);
                    }
                }

                ToggleControls(true, Properties.OutputStrings.ExportingBodyBinaryForFieldCompletedFormat1, fieldName);
            }
            catch (Exception ex)
            {
                _iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex);

                ToggleControls(true, Properties.OutputStrings.ExportingBodyBinaryForFieldFailedFormat1, fieldName);
            }
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            IReportRepository repository = new ReportRepository(ConfigurationManager.ConnectionStrings["ENetCare"].ConnectionString);

            _reportService = new ReportService(repository);

            grd.DataSource = _reportService.GetDistributionCentreStock();
            grd.DataBind();
        }
예제 #5
0
        public FileContentResult ListExcel(IDbConnection connection, OrderListRequest request)
        {
            var data   = List(connection, request).Entities;
            var report = new DynamicDataReport(data, request.IncludeColumns, typeof(Columns.OrderColumns));
            var bytes  = new ReportRepository().Render(report);

            return(ExcelContentResult.Create(bytes, "OrderList_" +
                                             DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".xlsx"));
        }
예제 #6
0
        public async Task Get_Report_For_Organization(bool submitted, string[] include)
        {
            using (var context = new TestHedwigContextProvider().Context)
            {
                // Set up test data
                var organization    = OrganizationHelper.CreateOrganization(context);
                var reportingPeriod = ReportingPeriodHelper.CreateReportingPeriod(context);
                var report          = ReportHelper.CreateCdcReport(context, organization: organization, reportingPeriod: reportingPeriod);
                var site            = SiteHelper.CreateSite(context, organization: organization);
                var enrollment      = EnrollmentHelper.CreateEnrollment(context, site: site, ageGroup: Age.Preschool);
                var funding         = FundingHelper.CreateFunding(context, enrollment: enrollment, firstReportingPeriod: reportingPeriod);

                if (submitted)
                {
                    Thread.Sleep(1000);

                    report.SubmittedAt = DateTime.Now;
                    context.SaveChanges();

                    Thread.Sleep(1000);
                }

                enrollment.AgeGroup = Age.SchoolAge;
                context.SaveChanges();

                // When the repository is queried
                var repo   = new ReportRepository(context);
                var result = await repo.GetReportForOrganizationAsync(report.Id, organization.Id, include) as CdcReport;

                // It returns the Report
                Assert.Equal(result.Id, report.Id);

                // It includes the Organization
                Assert.Equal(include.Contains("organizations"), result.Organization != null);

                // It includes the Sites
                Assert.Equal(include.Contains("sites"), result.Organization != null && result.Organization.Sites != null);

                // It includes the Enrollments (and Fundings too)
                Assert.Equal(
                    include.Contains("enrollments"),
                    result.Enrollments != null &&
                    result.Enrollments.FirstOrDefault().Fundings != null
                    );

                // When it includes enrollments
                if (include.Contains("enrollments"))
                {
                    var enrollmentResult = result.Enrollments.FirstOrDefault();
                    var fundingResult    = enrollmentResult.Fundings.FirstOrDefault();

                    // A submitted report should return the data as of when it was submitted
                    Assert.Equal(submitted ? Age.Preschool : Age.SchoolAge, enrollmentResult.AgeGroup);
                }
            }
        }
        private async Task PerformShowingDifferenceDescriptionAsync(LinkedEntities <Report> linked, bool showAllways)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            ToggleControls(false, Properties.WindowStatusStrings.ShowingDifferenceEntityDescription);

            try
            {
                var service1 = await GetService1();

                var service2 = await GetService2();

                if (service1 != null && service2 != null)
                {
                    var repository1 = new ReportRepository(service1);
                    var repository2 = new ReportRepository(service2);

                    var report1 = await repository1.GetByIdAsync(linked.Entity1.Id, new ColumnSet(true));

                    var report2 = await repository2.GetByIdAsync(linked.Entity2.Id, new ColumnSet(true));

                    var desc1 = await EntityDescriptionHandler.GetEntityDescriptionAsync(report1, EntityFileNameFormatter.ReportIgnoreFields);

                    var desc2 = await EntityDescriptionHandler.GetEntityDescriptionAsync(report2, EntityFileNameFormatter.ReportIgnoreFields);

                    if (showAllways || desc1 != desc2)
                    {
                        string filePath1 = await CreateDescriptionFileAsync(service1.ConnectionData, report1.Name, report1.Id, "Description", desc1);

                        string filePath2 = await CreateDescriptionFileAsync(service2.ConnectionData, report2.Name, report2.Id, "Description", desc2);

                        if (File.Exists(filePath1) && File.Exists(filePath2))
                        {
                            this._iWriteToOutput.ProcessStartProgramComparer(filePath1, filePath2, Path.GetFileName(filePath1), Path.GetFileName(filePath2));
                        }
                        else
                        {
                            this._iWriteToOutput.PerformAction(service1.ConnectionData, filePath1);

                            this._iWriteToOutput.PerformAction(service2.ConnectionData, filePath2);
                        }
                    }
                }

                ToggleControls(true, Properties.WindowStatusStrings.ShowingDifferenceEntityDescriptionCompleted);
            }
            catch (Exception ex)
            {
                _iWriteToOutput.WriteErrorToOutput(null, ex);

                ToggleControls(true, Properties.WindowStatusStrings.ShowingDifferenceEntityDescriptionFailed);
            }
        }
        private async Task PerformExportBodyBinary(string folder, Guid idReport, string name, string filename, string fieldName, string fieldTitle)
        {
            var service = await GetService();

            if (service == null)
            {
                return;
            }

            ToggleControls(service.ConnectionData, false, Properties.OutputStrings.ExportingBodyBinaryForFieldFormat1, fieldName);

            try
            {
                var repository = new ReportRepository(service);

                Report reportWithBodyBinary = await repository.GetByIdAsync(idReport, new ColumnSet(fieldName));

                string extension = Path.GetExtension(filename);

                string fileName = EntityFileNameFormatter.GetReportFileName(service.ConnectionData.Name, name, idReport, fieldTitle, extension);
                string filePath = Path.Combine(folder, FileOperations.RemoveWrongSymbols(fileName));

                var body = reportWithBodyBinary.GetAttributeValue<string>(fieldName);

                if (!string.IsNullOrEmpty(body))
                {
                    var array = Convert.FromBase64String(body);

                    File.WriteAllBytes(filePath, array);

                    this._iWriteToOutput.WriteToOutput(service.ConnectionData, Properties.OutputStrings.InConnectionEntityFieldExportedToFormat5, service.ConnectionData.Name, Report.Schema.EntityLogicalName, name, fieldTitle, filePath);

                    if (File.Exists(filePath))
                    {
                        if (_commonConfig.DefaultFileAction != FileAction.None)
                        {
                            this._iWriteToOutput.SelectFileInFolder(service.ConnectionData, filePath);
                        }
                    }
                }
                else
                {
                    this._iWriteToOutput.WriteToOutput(service.ConnectionData, Properties.OutputStrings.InConnectionEntityFieldIsEmptyFormat4, service.ConnectionData.Name, Report.Schema.EntityLogicalName, name, fieldTitle);
                    this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData);
                }

                ToggleControls(service.ConnectionData, true, Properties.OutputStrings.ExportingBodyBinaryForFieldCompletedFormat1, fieldName);

            }
            catch (Exception ex)
            {
                _iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex);

                ToggleControls(service.ConnectionData, true, Properties.OutputStrings.ExportingBodyBinaryForFieldFailedFormat1, fieldName);
            }
        }
예제 #9
0
        public FileContentResult ListExcel(IDbConnection connection, CustomerGrossSalesListRequest request)
        {
            var data   = List(connection, request).Entities;
            var report = new DynamicDataReport(data, request.IncludeColumns,
                                               typeof(Columns.CustomerGrossSalesColumns), HttpContext.RequestServices);
            var bytes = ReportRepository.Render(report);

            return(ExcelContentResult.Create(bytes, "CustomerGrossSales_" +
                                             DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".xlsx"));
        }
예제 #10
0
        public ReportUI(BillReceiptUI frmBillReceipt)
        {
            InitializeComponent();

            ds  = new BizCareDataSet();
            rpt = new ReportDocument();
            reportRepository = new ReportRepository();

            this.frmBillReceipt = frmBillReceipt;
        }
예제 #11
0
        public IActionResult GetReportData([FromBody] RequestModel model)
        {
            if (model == null)
            {
                model = new RequestModel();
            }
            Response <DashBoardModel> returnModel = new ReportRepository().GetReportData(model);

            return(Ok(returnModel));
        }
예제 #12
0
        public ReportUI(PayablePaymentUI frmPayablePayment)
        {
            InitializeComponent();

            ds  = new BizCareDataSet();
            rpt = new ReportDocument();
            reportRepository = new ReportRepository();

            this.frmPayablePayment = frmPayablePayment;
        }
예제 #13
0
        public ReportUI(PurchaseUI frmPurchase)
        {
            InitializeComponent();

            ds  = new BizCareDataSet();
            rpt = new ReportDocument();
            reportRepository = new ReportRepository();

            this.frmPurchase = frmPurchase;
        }
예제 #14
0
        public ReportUI(SalesUI frmSales)
        {
            InitializeComponent();

            ds  = new BizCareDataSet();
            rpt = new ReportDocument();
            reportRepository = new ReportRepository();

            this.frmSales = frmSales;
        }
예제 #15
0
        public FileContentResult ListExcel(IDbConnection connection, ListRequest request)
        {
            var data   = List(connection, request).Entities;
            var cols   = request.IncludeColumns.Where(p => p != MyRow.Fields.ReusedCount.Name);
            var report = new DynamicDataReport(data, cols, typeof(Columns.IdCardColumns));
            var bytes  = new ReportRepository().Render(report);

            return(ExcelContentResult.Create(bytes, "IdCard_" +
                                             DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".xlsx"));
        }
예제 #16
0
        public UnitOfWork()
        {
            FileTracer_DataBaseContext context = new FileTracer_DataBaseContext();

            ClientRepository  = new ClientRepository(context);
            ManagerRepository = new ManagerRepository(context);
            ProductRepository = new ProductRepository(context);
            ReportRepository  = new ReportRepository(context);
            SaleLogRepository = new SaleLogRepository(context);
        }
예제 #17
0
        public IActionResult GetTransictionList([FromBody] RequestModel model)
        {
            if (model == null)
            {
                model = new RequestModel();
            }
            Response <List <TransactionModel> > returnModel = new ReportRepository().GetTransictionList(model);

            return(Ok(returnModel));
        }
예제 #18
0
        public void Controller_Get_Should_Be_NoContentResult()
        {
            var fixture    = new DbContextFixture();
            var logger     = new Mock <ILogger <ReportsController> >().Object;
            var repository = new ReportRepository(fixture.context);
            var controller = new ReportsController(logger, repository);
            ActionResult <IQueryable <Report> > result = controller.Get();

            result.Result.Should().BeOfType <NoContentResult>();
        }
예제 #19
0
        public ReportUI(StockCorrectionUI frmStockCorrection)
        {
            InitializeComponent();

            ds  = new BizCareDataSet();
            rpt = new ReportDocument();
            reportRepository = new ReportRepository();

            this.frmStockCorrection = frmStockCorrection;
        }
예제 #20
0
        public ActionResult InvestmentByRegion(InvestmentByRegionViewModel model)
        {
            model.InvestmentByRegions = ReportRepository.GetInvestmentByRegion(model);
            model.Regions             = model.InvestmentByRegions.Select(s => s.Region).Distinct().OrderBy(r => r).ToList();
            model.Sectors             = StatusRepository.GetStatusByGroup("Sector");

            //model.FromDate = DateTime.Now;
            //model.ToDate = DateTime.Now;
            return(View(model));
        }
예제 #21
0
 public ReportController(
     ReportUsersMapsRepository reportsUsersRepository,
     IWorkplaceContext context,
     ReportRepository reportRepository
     )
 {
     this.reportsUsersRepository = reportsUsersRepository;
     this.context          = context;
     this.reportRepository = reportRepository;
 }         // constructor
예제 #22
0
        private void PrintDoc(int typex, bool filter)
        {
            if (cmb_days.SelectedValue == null)
            {
                MessageBox.Show("Please select a day to continue", Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            string      reporttitle = "";
            ReportViwer rpt         = new ReportViwer();

            rpt.MdiParent      = frm_main.ActiveForm;
            rpt.FormHeadertext = reporttitle;

            ParameterField         paramField         = new ParameterField();
            ParameterFields        paramFields        = new ParameterFields();
            ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

            paramFields = ReportRepository.AddCrystalParamsWithLoca(reporttitle, commonFunctions.Loginuser.ToUpper(), commonFunctions.GlobalLocation, "01", commonFunctions.GlobalCompany, commonFunctions.CompanyAddress);

            paramField.Name          = "status";
            paramDiscreteValue.Value = "Original".ToUpper();
            paramField.CurrentValues.Add(paramDiscreteValue);
            paramFields.Add(paramField);


            Rpt_SalesTypeWiseSale rptBank = new Rpt_SalesTypeWiseSale();

            switch (options)
            {
            case 1:
                reporttitle = "Daily Cash Sales".ToUpper();
                rptBank.SetDataSource(ReportRepository.GetSalesTypeWiseDetails(commonFunctions.ToInt(cmb_days.SelectedValue.ToString()), 0, 1));

                break;

            case 2:
                reporttitle = "Daily Card Sales".ToUpper();
                rptBank.SetDataSource(ReportRepository.GetSalesTypeWiseDetails(commonFunctions.ToInt(cmb_days.SelectedValue.ToString()), 0, 2));

                break;

            case 3:
                reporttitle = "Daily Voucher Sales".ToUpper();
                rptBank.SetDataSource(ReportRepository.GetSalesTypeWiseDetails(commonFunctions.ToInt(cmb_days.SelectedValue.ToString()), 0, 3));

                break;
            }


            rpt.RepViewer.ParameterFieldInfo = paramFields;
            rpt.RepViewer.ReportSource       = rptBank;
            rpt.RepViewer.Refresh();
            rpt.MdiParent = frm_main.ActiveForm;
            rpt.Show();
        }
예제 #23
0
        public ServerResponse <Report> GetByTeacher(int idTeacher)
        {
            ReportRepository repo = new ReportRepository();
            var reports           = repo.RetriveByTeacher(idTeacher);

            return(new ServerResponse <Report>()
            {
                Result = reports != null,
                Data = reports
            });
        }
        public async Task <JsonResult> Get(int id, int skip, int limit, string filter, string orderby)
        {
            await CheckPermission();

            var rr = new ReportRepository(_logger);

            var result = await rr.Get(id, skip, limit, filter, orderby);

            rr.Dispose();
            return(Json(result));
        }
예제 #25
0
        public void Controller_Delete_Should_Be_NotFound()
        {
            var fixture    = new DbContextFixture();
            var logger     = new Mock <ILogger <ReportsController> >().Object;
            var repository = new ReportRepository(fixture.context);
            var controller = new ReportsController(logger, repository);
            var eid        = ReportEntityTypeConfiguration.ReportSeed.ElementAt(1).Id;
            ActionResult <Report> result = controller.Delete(eid);

            result.Result.Should().BeOfType <NotFoundResult>();
        }
        public async Task <JsonResult> GetList()
        {
            await CheckPermission();

            var rr = new ReportRepository(_logger);

            var result = rr.GetList();

            rr.Dispose();
            return(Json(result));
        }
예제 #27
0
        public void Add_A_Report_When_Not_Populated_Should_Be_One()
        {
            var repository = new ReportRepository(fixture.context);
            var entity     = ReportEntityTypeConfiguration.ReportSeed.ElementAt(1);

            entity.Id = 3;
            repository.Add(entity);
            var count = repository.Get().Count();

            Assert.Equal(1, count);
        }
예제 #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            IReportRepository repository = new ReportRepository(ConfigurationManager.ConnectionStrings["ENetCare"].ConnectionString);

            _reportService = new ReportService(repository);

            EmployeeMembershipUser user = (EmployeeMembershipUser)System.Web.Security.Membership.GetUser();

            grd.DataSource = _reportService.GetStocktaking(user.DistributionCentreId);
            grd.DataBind();
        }
예제 #29
0
        // GET: api/Report/5
        public ServerResponse <Report> GetByChild(int idChild)
        {
            ReportRepository repo = new ReportRepository();
            var reports           = repo.RetrieveByChild(idChild);

            return(new ServerResponse <Report>()
            {
                Result = reports != null,
                Data = reports
            });
        }
예제 #30
0
        public void Controller_Post_Should_Be_OkResult()
        {
            var fixture    = new DbContextFixture();
            var logger     = new Mock <ILogger <ReportsController> >().Object;
            var repository = new ReportRepository(fixture.context);
            var controller = new ReportsController(logger, repository);
            var e          = ReportEntityTypeConfiguration.ReportSeed.ElementAt(0);
            ActionResult <Report> result = controller.Post(e);

            result.Result.Should().BeOfType <OkObjectResult>();
        }
예제 #31
0
        public void Controller_Get_ById_Should_Be_NoContentResult()
        {
            var fixture    = new DbContextFixture();
            var logger     = new Mock <ILogger <ReportsController> >().Object;
            var repository = new ReportRepository(fixture.context);
            var controller = new ReportsController(logger, repository);
            var e          = ReportEntityTypeConfiguration.ReportSeed.First().Id;
            ActionResult <Report> result = controller.Get(e);

            result.Result.Should().BeOfType <NoContentResult>();
        }
예제 #32
0
 public List<StudentVisitSummaryReportItem> GetStudentVisitSummaryReportByStudent(string clazzName, DateTime? startTime, DateTime? endTime)
 {
     var ds = new ReportRepository();
     if (String.IsNullOrEmpty(clazzName)) clazzName = "%";
     if (!startTime.HasValue) {
         startTime = new DateTime(1990, 1, 1);
     }
     if (!endTime.HasValue) {
         endTime = DateTime.Today.AddDays(1);
     }
     return ds.GetStudentVisitSummaryReportByStudent(clazzName, startTime, endTime);
 }
예제 #33
0
 // 招生统计报表-按组按月统计各组员的量
 public List<SalesTeamSummaryReport> GetSignUpSummaryReportByMonthAndSalesman(int year, int month, int teamId)
 {
     var ds = new ReportRepository();
     var m = ds.GetSignUpSummaryReportByMonthAndSalesman(year, month, teamId);
     return m;
 }
        public void ReportRepository()
        {
            Mock<IDbSetFactory> factory = new Mock<IDbSetFactory>();
            Mock<DbSet<Report>> dbSet = new Mock<DbSet<Report>>();

            factory.Setup(m => m.CreateDbSet<Report>()).Returns(dbSet.Object);

            ReportRepository repo = new ReportRepository(factory.Object);

            var Report = new Report();

            var sequence = new MockSequence();
            dbSet.InSequence(sequence).Setup(e => e.Add(Report));
            dbSet.InSequence(sequence).Setup(e => e.Find(Report.Id));
            dbSet.InSequence(sequence).Setup(e => e.Find(Report.Id));
            dbSet.InSequence(sequence).Setup(e => e.Find(Report.Id));
            repo.Create(Report);
            repo.Get(Report.Id);
            repo.Update(Report);
            repo.Delete(Report.Id);
        }
예제 #35
0
 // 招生统计报表-按月统计各学校的量
 public List<SalesTeamSummaryReport> GetSignUpSummaryReportByMonthAndSchool(int year, int month)
 {
     var ds = new ReportRepository();
     var m = ds.GetSignUpSummaryReportByMonthAndSchool(year, month);
     return m;
 }
예제 #36
0
 // 招生统计报表-按电话营销组、按月细化统计
 public List<SalesTeamSummaryReport> GetSignUpSummaryReportBySalesTeamAndMonth(int year, int teamId)
 {
     var ds = new ReportRepository();
     var m = ds.GetSignUpSummaryReportBySalesTeamAndMonth(year, teamId);
     return m;
 }
예제 #37
0
 /// <summary>
 /// Initializes a new instance of the ReportService class.
 /// </summary>
 /// <param name="unitOfWork">Unit of work</param>
 public ReportService(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
     this.reportRepository = new ReportRepository(this.unitOfWork);
 }
예제 #38
0
 // 招生统计报表-按学校统计
 public List<SalesTeamSummaryReport> GetSignUpSummaryReportBySchool(int year)
 {
     var ds = new ReportRepository();
     var m = ds.GetSignUpSummaryReportBySchool(year);
     return m;
 }
예제 #39
0
 // 招生统计报表-招生排名
 public List<SignUpRankingListItem> GetSignUpRankingList(DateTime? startTime, DateTime? endTime, string orderBy, string rankBy)
 {
     string o = "SignUpQty DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
     if (!String.IsNullOrEmpty(orderBy)) {
         switch (orderBy.ToLower()) {
             case "signupqty":
                 o = "SignUpQty DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
             case "dropinqty":
                 o = "DropInQty DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
             case "telsignupqty":
                 o = "TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
             case "nontelsignupqty":
                 o = "NonTelSignUpQty DESC, TelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
             case "teldropinqty":
                 o = "TelDropInQty DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
             case "nonteldropinqty":
                 o = "NonTelDropInQty DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
             case "signuprate":
                 o = "SignUpRate DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, DropInRate DESC";
                 break;
             case "dropinrate":
                 o = "DropInRate DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC";
                 break;
             case "telqty":
                 o = "TelQty DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
             default:
                 o = "TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
         }
     }
     var ds = new ReportRepository();
     if (startTime == null || endTime == null) {
         var n = 0;
         switch (DateTime.Today.DayOfWeek) {
             case DayOfWeek.Monday:
                 n = -1;
                 break;
             case DayOfWeek.Tuesday:
                 n = -2;
                 break;
             case DayOfWeek.Wednesday:
                 n = -3;
                 break;
             case DayOfWeek.Thursday:
                 n = -4;
                 break;
             case DayOfWeek.Friday:
                 n = -5;
                 break;
             case DayOfWeek.Saturday:
                 n = -6;
                 break;
             default:
                 break;
         }
         startTime = DateTime.Today.AddDays(n);
         endTime = startTime.Value.AddDays(8);
     }
     if (startTime == null) {
         startTime = new DateTime(2000, 1, 1);
     }
     if (endTime == null) {
         endTime = new DateTime(2099, 12, 31);
     }
     var m = ds.GetSignUpRankingList(startTime.Value, endTime.Value, o, (String.IsNullOrEmpty(rankBy) ? "SignUpQty" : rankBy));
     return m;
 }
예제 #40
0
 // 招生统计报表-按月统计
 public List<SignUpSummaryReportItem> GetSignUpSummaryReportByMonth(int year)
 {
     var ds = new ReportRepository();
     var m = ds.GetSignUpSummaryReportByMonth(year);
     return m;
 }
예제 #41
0
 public List<StudentVisitSummaryReportItem> GetStudentVisitSummaryReportByTeacher(DateTime? startTime, DateTime? endTime)
 {
     var ds = new ReportRepository();
     var m = ds.GetStudentVisitSummaryReportByTeacher(startTime, endTime);
     return m;
 }
예제 #42
0
 public List<EmploymentVisitReviewReprtItem> GetEmploymentVisitReviewReprt(DateTime? startTime, DateTime? endTime)
 {
     var ds = new ReportRepository();
     var m = ds.GetEmploymentVisitReviewReprt(startTime, endTime);
     return m;
 }
예제 #43
0
 // 招生统计报表-总表
 public List<SignUpSummaryReportItem> GetSignUpSummaryReport()
 {
     var ds = new ReportRepository();
     return ds.GetSignUpSummaryReport();
 }
예제 #44
0
 public List<StudentVisitSummaryReportItem> GetStudentVisitSummaryReport(DateTime? startTime, DateTime? endTime)
 {
     var ds = new ReportRepository();
     startTime = (startTime != null) ? startTime : new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
     endTime = (endTime != null) ? endTime : DateTime.Today;
     return ds.GetStudentVisitSummaryReport(startTime.Value, endTime.Value);
 }
예제 #45
0
 // 招生统计报表-按组统计学校数量和资料数量
 public List<SalesTeamSchoolQtyReportItem> GetSchoolQtyReportBySalesTeam(int year)
 {
     var ds = new ReportRepository();
     var m = ds.GetSchoolQtyReportBySalesTeam(year);
     return m;
 }
예제 #46
0
 public List<NewEmployeeCompanyReportItem> GetNewEmployeeCompanyReport(DateTime? startTime, DateTime? endTime)
 {
     var ds = new ReportRepository();
     var m = ds.GetNewEmployeeCompanyReport(startTime, endTime);
     return m;
 }