示例#1
0
 public virtual IActionResult ExportExcelIndexs(ReportSearchModel searchModel)
 {
     if (!string.IsNullOrEmpty(searchModel.StringConstructionIds))
     {
         var listConstruction = searchModel.StringConstructionIds.Split(',').ToList();
         searchModel.SelectConstructionIds = listConstruction.Select(c => (int)c.ToNumber()).ToList();
     }
     try
     {
         var report = _reportService.GetReport(constructionCode: searchModel.ConstructionCode,
                                               SelectConstructionName: searchModel.SelectConstructionIds.ToList(),
                                               contractNameCode: searchModel.ContractNameCode,
                                               startDateFrom: searchModel.StartDateFrom,
                                               startDateTo: searchModel.StartDateTo,
                                               constructionType: searchModel.ConstructionType,
                                               contractFormId: searchModel.ContractFormId,
                                               contractStatus: searchModel.contractStatus);
         byte[] bytes;
         using (var stream = new MemoryStream())
         {
             _exportManager.ExportReportToXlsx(report, stream, Convert.ToDateTime(searchModel.StartDateFrom), Convert.ToDateTime(searchModel.StartDateTo));
             bytes = stream.ToArray();
         }
         return(File(bytes, MimeTypes.TextXlsx, "BaoCaoChung.xlsx"));
     }
     catch (Exception exc)
     {
         ErrorNotification(exc);
         return(RedirectToAction("List"));
     }
 }
        public ActionResult ExportSummaryReport(ReportSearchModel model)
        {
            //model.StartData=  Convert.ToDateTime(Request.Params["StartData"]);
            //model.EndData = Convert.ToDateTime(Request.Params["EndData"]);
            //model.createDeptid = Request.Params["createDeptid"];
            //model.clientName = Request.Params["clientName"];
            //model.projectName = Request.Params["projectName"];
            DateTime sTime     = DataHelper.CalculateFirstDateOfWeek(DateTime.Now);
            DateTime eTime     = DataHelper.CalculateLastDateOfWeek(DateTime.Now);
            DateTime startDate = model.StartData.HasValue ? model.StartData.Value : sTime;
            DateTime endDate   = model.EndData.HasValue ? model.EndData.Value : DateTime.Now;

            model.StartData = startDate;
            model.EndData   = endDate;
            model.page      = 1;
            model.pageSize  = 10000;
            var            res   = _charData.GetData(model);
            ExcelPackage   excel = new ExcelPackage();
            ExcelWorksheet sheet = excel.Workbook.Worksheets.Add("工时汇总");

            sheet.Cells[1, 1].Value = "客户";
            sheet.Cells[1, 2].Value = "立项部门";
            sheet.Cells[1, 3].Value = "项目名称";
            sheet.Cells[1, 4].Value = "总工时";
            for (int i = 0; i < res.Count; i++)
            {
                sheet.Cells[i + 2, 1].Value = res[i].ClientName;
                sheet.Cells[i + 2, 2].Value = res[i].DepartmentName;
                sheet.Cells[i + 2, 3].Value = res[i].ProjectName;
                sheet.Cells[i + 2, 4].Value = res[i].Totalhours.ToString();
            }
            var resArr = excel.GetAsByteArray();

            return(File(resArr, "application/vnd.ms-excel", HttpUtility.UrlEncode("Excel.xlsx")));
        }
示例#3
0
        public DataTable StudentsReport(ReportSearchModel model)
        {
            var dataTable = new DataTable();

            dataTable.Columns.Add("ID", typeof(string));
            dataTable.Columns.Add("ФИО", typeof(string));
            dataTable.Columns.Add("Учебное заведение", typeof(string));
            dataTable.Columns.Add("Специальность", typeof(string));
            dataTable.Columns.Add("Направление практики", typeof(string));
            dataTable.Columns.Add("Куратор", typeof(string));
            var result = FindStudents(model);

            foreach (var student in result)
            {
                dataTable.Rows.Add(
                    student.Id,
                    student.FirstName + " " + student.SecondName + " " + student.Patronymic,
                    student.Institution.Name,
                    student.Speciality,
                    student.PracticArea,
                    student.Mentor?.FirstName + student.Mentor?.SecondName + student.Mentor?.Patronymic);
            }
            return(dataTable);
            //CreateReport(dataTable);
        }
示例#4
0
        public List <ReportModel> GetRankReports(ReportSearchModel model)
        {
            using (var db = new RacingDbContext())
            {
                var reports = new List <ReportModel>();

                // 下注
                var betReportSql = GetBetReportSql(model);
                var betReports   = db.Database.SqlQuery <BetReportModel>(betReportSql);

                // 奖金
                var bonusReportSql = GetBonusReportSql(model);
                var bonusReports   = db.Database.SqlQuery <BonusReportModel>(bonusReportSql);

                foreach (var betReport in betReports)
                {
                    var bonusReport = bonusReports.Where(r => r.Num > 0 && r.Num == betReport.Num).FirstOrDefault();
                    var bonusAmount = bonusReport != null ? bonusReport.Amount : 0;

                    reports.Add(new ReportModel
                    {
                        Num                   = betReport.Num,
                        BetCount              = betReport.BetCount,
                        BetAmount             = betReport.Amount,
                        MemberWinOrLoseAmount = bonusAmount - betReport.Amount,
                        ReceiveAmount         = bonusAmount - betReport.Amount,
                        //RebateAmount = 0,
                        ContributeHigherLevelAmount = 0,
                        PayHigherLevelAmount        = 0
                    });
                }

                return(reports);
            }
        }
示例#5
0
        // 代理应收
        private string GetAgentReceiveSql(ReportSearchModel model, List <User> members)
        {
            var sql = new StringBuilder();

            var memberUserIds = members.Select(m => m.UserId).Distinct().ToList();

            //var agentUserIds = new UserService().GetParentUserIds(memberUserIds);


            //sql.AppendLine("SELECT[UM].UserId ChildUserId, T.* FROM(");

            //sql.AppendLine("SELECT [B].UserId,[R].RoleId, [B].BonusType, Amount");
            //sql.AppendLine("FROM [dbo].[PKBonus] [B]");
            //sql.AppendLine("INNER JOIN [dbo].[PK] [PK] ON [PK].PKId = [B].PKId");
            //sql.AppendLine("INNER JOIN [dbo].[User] [U] ON [U].UserId = [B].UserId");
            //sql.AppendLine("INNER JOIN [dbo].[UserRole] [R] ON [U].UserId = [R].UserId");
            //sql.AppendLine(GetWhereSql(model) + string.Format(" AND [B].UserId in ({0})", string.Join(",", agentUserIds)));
            //sql.AppendLine(") T");
            //sql.AppendLine(" INNER JOIN ");
            //sql.AppendLine(string.Format("( SELECT UserId, ParentUserId FROM [dbo].[User] WHERE UserId IN({0}) ) [UM] ", string.Join(",", memberUserIds)));
            //sql.AppendLine(" ON[UM].ParentUserId = [T].UserId");


            sql.AppendLine("SELECT [B].UserId, [B].ChildUserId, [R].RoleId, [B].BonusType, Amount");
            sql.AppendLine("FROM [dbo].[PKBonus] [B]");
            sql.AppendLine("INNER JOIN [dbo].[PK] [PK] ON [PK].PKId = [B].PKId");
            sql.AppendLine("INNER JOIN [dbo].[User] [U] ON [U].UserId = [B].UserId");
            sql.AppendLine("INNER JOIN [dbo].[UserRole] [R] ON [U].UserId = [R].UserId");
            sql.AppendLine(GetWhereSql(model));

            return(sql.ToString());
        }
示例#6
0
        private string GetWhereSql(ReportSearchModel model)
        {
            var sql = new StringBuilder(); sql.AppendLine(string.Format("WHERE IsSettlementDone = {0}", model.SettlementType));

            // 1:按期數, 2:按日期
            if (model.SearchType == 1)
            {
                sql.AppendLine(string.Format("AND [B].PKId = {0}", model.PKId));
            }
            else
            {
                if (model.FromDate.HasValue)
                {
                    sql.AppendLine(string.Format("AND DATEDIFF(DAY, '{0}', CreateTime) >= 0", model.FromDate.Value.ToString("yyyy/MM/dd")));
                }
                if (model.ToDate.HasValue)
                {
                    sql.AppendLine(string.Format("AND DATEDIFF(DAY, '{0}', CreateTime) <= 0", model.ToDate.Value.ToString("yyyy/MM/dd")));
                }
            }

            if (model.ParentUserId.HasValue)
            {
                sql.AppendLine(string.Format("AND ([U].ParentUserId = {0} OR [B].UserId = {0})", model.ParentUserId));//取自己和下级的奖金+退水
                //sql.AppendLine(string.Format("AND ([U].ParentUserId = {0})", model.ParentUserId));
            }

            if (model.BetType.HasValue)
            {
                sql.AppendLine(string.Format("AND [B].Num = {0}", model.BetType));
            }

            return(sql.ToString());
        }
示例#7
0
        public JsonResult SearchReport(ReportSearchModel model)
        {
            var result = new ResponseResult();

            try
            {
                if (model.ReportType == 1)
                {
                    // 交收報表
                    result.Data = new ReportService().GetAgentReports(model);
                }
                else
                {
                    // 分类報表
                    result.Data = new ReportService().GetRankReports(model);
                }
            }
            catch (Exception ex)
            {
                result.Success = false;
                result.Message = MessageConst.System_Error;
                _logger.Info(ex);
            }

            return(Json(result));
        }
示例#8
0
        public virtual IActionResult Index()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageConstruction))
            {
                return(AccessDeniedKendoGridJson());
            }
            var model = new ReportSearchModel();

            model.ConstructionName = ConstructionNameddl();
            var contractforms = _contractFormService.GetAllContractForms();

            model.AvailableContractForm = contractforms.Select(c => new SelectListItem
            {
                Value    = c.Id.ToString(),
                Text     = c.Name,
                Selected = model.ContractFormId == c.Id,
            }).ToList();
            model.AvailableContractForm.Insert(0, new SelectListItem
            {
                Value = "0",
                Text  = "--Chọn hình thức hợp đồng--"
            });
            var constructionType = _constructionTypeService.GetAllConstructionTypes();

            model.ConstructionTypeSLI = constructionType.Select(c => new SelectListItem
            {
                Value = c.Id.ToString(),
                Text  = c.Name,
            }).ToList();
            model.AvailableContractStatus = ((ContractStatus)model.contractStatus).ToSelectList();
            model.StartDateFrom           = new DateTime(DateTime.Now.Year, 1, 1);
            model.StartDateTo             = DateTime.Now;
            return(View(model));
        }
示例#9
0
        public IActionResult Search(ReportSearchModel model)
        {
            var result = _uow.TechnicalsRepository.GetAll();

            //serach technical
            if (model.UserId != 0)
            {
                result = result.Where(ent => ent.UsersId == model.UserId);
            }
            //serach city
            if (model.CityId != 0)
            {
                result = result.Where(ent => ent.User.CityId == model.CityId);
            }
            //serach service
            if (model.ServiceId != 0)
            {
                result = result.Where(ent => ent.ServiceId == model.ServiceId);
            }

            result = result.Include(ent => ent.User).ThenInclude(ent => ent.Orders).ThenInclude(ent => ent.OrderService)
                     .Include(ent => ent.Service);
            //   result = result.OrderByDescending(ent => ent.CreationDate).ToHashSet();

            if (AppSession.CurrentUser.JobTitleId == (int)En_JobTitle.egent)
            {
                result = result.Where(ent => ent.User.CityId == AppSession.CurrentUser.CityId);
            }
            return(PartialView("_List", result.ToHashSet()));
        }
        public IActionResult Search(ReportSearchModel model)
        {
            var result = _uow.OrderRepository.GetMany(ent => ent.OrderService != null);

            if (model.CustomerId != 0)
            {
                result = result.Where(ent => ent.CustomerId == model.CustomerId);
            }
            if (model.UserId != 0)
            {
                result = result.Where(ent => ent.ResponsibleUserId == model.UserId);
            }
            if (model.OrderActionId != 0)
            {
                result = result.Where(ent => ent.OrderTrackActionId == model.OrderActionId);
            }

            if (model.Code != null && model.Code != "")
            {
                result = result.Where(ent => ent.Code == model.Code);
            }

            //search with order customer/supplier city
            if (model.CityId != 0)
            {
                result = result.Where(ent => ent.Customer.CityId == model.CityId || ent.ResponsibleUser.CityId == model.CityId);
            }

            switch (model.DateRangeId)
            {
            case "Today":
                result = result.Where(ent => ent.CreationDate.Date >= DateTime.Now.Date);
                break;

            case "yesterday":
                result = result.Where(ent => ent.CreationDate.Date == DateTime.Now.AddDays(-1).Date);
                break;

            case "Last week":
                result = result.Where(ent => ent.CreationDate.Date >= DateTime.Now.Date.AddDays(-7));
                break;

            case "previous x days":
                result = result.Where(ent => ent.CreationDate.Date >= DateTime.Now.Date.AddDays(-model.PreviousDaysNum));
                break;

            case "Custom":
                result = result.Where(ent => ent.CreationDate.Date >= model.StartDate.Date && ent.CreationDate.Date <= model.EndDate.Date
                                      );
                break;
            }
            result = result.Include(ent => ent.Customer)
                     .Include(ent => ent.OrderTrackAction)
                     .Include(ent => ent.ResponsibleUser)
                     .Include(ent => ent.OrderService).ThenInclude(ent => ent.Service);

            //   result = result.OrderByDescending(ent => ent.CreationDate).ToHashSet();

            return(PartialView("_List", result.ToHashSet()));
        }
示例#11
0
        public List <ReportDataByClient> GetData(ReportSearchModel model)
        {
            SqlParameter[] parameters = ReportDataByClient.Parameters(model);
            var            res        = _repository.ExecuteStoredProcedure(ReportDataByClient.NAME, parameters).ToList();

            return(res);
        }
示例#12
0
        private string GetBetReportSql(ReportSearchModel model)
        {
            var sql = new StringBuilder();

            sql.AppendLine("SELECT Num, Count(0) BetCount, Sum(Amount) Amount");
            sql.AppendLine("FROM [dbo].[Bet] [B]");
            sql.AppendLine(GetWhereSql(model));
            sql.AppendLine("GROUP BY [B].Num");

            return(sql.ToString());
        }
示例#13
0
        public ActionResult ReportGrid(string stateId, int firstYear, int secondYear)
        {
            var searchParams = new ReportSearchModel()
            {
                StateId = stateId != null?int.Parse(stateId) : -1,
                              FirstYear  = firstYear,
                              SecondYear = secondYear
            };

            return(PartialView(_reportService.GetDisadges(searchParams)));
        }
示例#14
0
 public static SqlParameter[] Parameters(ReportSearchModel pSearchModel)
 {
     SqlParameter[] parameters =
     {
         ParamVar("@st",           pSearchModel.StartData.Value),
         ParamVar("@et",           pSearchModel.EndData.Value),
         ParamVar("@createDeptid", pSearchModel.createDeptid),
         ParamVar("@clientName",   pSearchModel.clientName),
         ParamVar("@projectName",  pSearchModel.projectName)
     };
     return(parameters);
 }
示例#15
0
        private string GetBonusReportSql(ReportSearchModel model)
        {
            var sql = new StringBuilder();

            sql.AppendLine("SELECT [B].Num, Sum([B].Amount) Amount");
            sql.AppendLine("FROM [dbo].[PKBonus] [B]");
            sql.AppendLine("INNER JOIN [dbo].[PK] [PK] ON [PK].PKId = [B].PKId");
            sql.AppendLine(GetWhereSql(model));
            sql.AppendLine("GROUP BY [B].Num");

            return(sql.ToString());
        }
示例#16
0
        private string GetAgentUserIdsSql(ReportSearchModel model)
        {
            var sql = new StringBuilder();

            var userId = GetUserIdField(model.UserType);

            sql.AppendLine(string.Format("SELECT DISTINCT [B].{0}", userId));
            sql.AppendLine("FROM [dbo].[Bet] [B]");
            sql.AppendLine(string.Format("INNER JOIN [dbo].[User] [U] ON [U].UserId = [B].{0}", userId));
            sql.AppendLine(GetWhereSql(model));

            return(sql.ToString());
        }
示例#17
0
        private string GetAgentBetReportSql(ReportSearchModel model)
        {
            var sql = new StringBuilder();

            var userId = GetUserIdField(model.UserType);

            sql.AppendLine(string.Format("SELECT [B].{0} UserId, Count(0) BetCount, Sum(Amount) Amount", userId));
            sql.AppendLine("FROM [dbo].[Bet] [B]");
            sql.AppendLine(string.Format("INNER JOIN [dbo].[User] [U] ON [U].UserId = [B].{0}", userId));
            sql.AppendLine(GetWhereSql(model));
            sql.AppendLine(string.Format("GROUP BY [B].{0}", userId));

            return(sql.ToString());
        }
        public ActionResult GetReportDataByProject(ReportSearchModel model)
        {
            DateTime sTime     = DataHelper.CalculateFirstDateOfWeek(DateTime.Now);
            DateTime eTime     = DataHelper.CalculateLastDateOfWeek(DateTime.Now);
            DateTime startDate = model.StartData.HasValue ? model.StartData.Value : sTime;
            DateTime endDate   = model.EndData.HasValue ? model.EndData.Value : DateTime.Now;

            model.StartData = startDate;
            model.EndData   = endDate;
            var projectRes = _projectData.GetData(model);


            return(Json(projectRes, JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        /// Get Reports By Filters
        /// </summary>
        /// <param name="reportSearchModel"></param>
        /// <returns></returns>
        public List <ProviderReportModel> GetServiceProviderReportsByFilters(ReportSearchModel reportSearchModel)
        {
            var URL     = string.Format($"{AppSettings.BaseApiUrl}{ApiUrls.SearchReportApiURL.GetProviderReports}");
            var Content = Post <List <ProviderReportModel> >(URL, reportSearchModel);

            if (Content.IsSuccessful)
            {
                return(Content.Model);
            }
            else
            {
                return(new List <ProviderReportModel>());
            }
        }
        public List <ClaimListModel> GetAllClaims(ReportSearchModel reportSearchModel)
        {
            var URL     = string.Format(AppSettings.BaseApiUrl + ApiUrls.ClaimApiURL.GetAllClaims);
            var Content = Post <List <ClaimListModel> >(URL, reportSearchModel);

            if (Content.IsSuccessful)
            {
                return(Content.Model);
            }
            else
            {
                return(new List <ClaimListModel>());
            }
        }
示例#21
0
        public ActionResult ListReport(ReportSearchModel searchModel)
        {
            if (searchModel == null)
            {
                searchModel = new ReportSearchModel();
            }
            DateTime sdate;
            DateTime edate;

            DateTime.TryParseExact(searchModel.StartDate, Helper.FormatDate,
                                   new CultureInfo("en-US"),
                                   DateTimeStyles.None,
                                   out sdate);
            DateTime.TryParseExact(searchModel.EndDate, Helper.FormatDate,
                                   new CultureInfo("en-US"),
                                   DateTimeStyles.None,
                                   out edate);

            var reports = TaskBO.ReportSearch(searchModel.UserId, sdate, edate);

            var user = new List <User>
            {
                new User {
                    UserName = "******"
                }
            };

            user.AddRange(UserBO.GetByDepartmentId(CurrentUser.DepartmentLeader));
            ViewBag.Users = user;
            var temReport = new List <Report>();

            if (reports != null && reports.Count > 0)
            {
                for (int i = 0; i < reports.Count; i++)
                {
                    reports[i].AssignTask = TaskBO.AssignTaskGetById(reports[i].AssignTaskId);
                    reports[i].Task       = TaskBO.GetById(reports[i].AssignTask.TaskId);
                    reports[i].User       = UserBO.GetById(reports[i].UserReport);


                    if (reports[i].User.DepartmentId == CurrentUser.DepartmentLeader)
                    {
                        temReport.Add(reports[i]);
                    }
                }
            }

            searchModel.Reports = temReport;
            return(View(searchModel));
        }
        public List <PaymentReportModel> SearchPaymentReports(ReportSearchModel reportSearchModel)
        {
            var URL     = string.Format($"{AppSettings.BaseApiUrl}{ApiUrls.SearchReportApiURL.SearchPaymentReports}");
            var Content = Post <List <PaymentReportModel> >(URL, reportSearchModel);

            if (Content.IsSuccessful)
            {
                return(Content.Model);
            }
            else
            {
                return(new List <PaymentReportModel>());
            }
        }
示例#23
0
 public List <StudentsEntityModel> FindStudents(ReportSearchModel model)
 {
     if (model == null || (model.InstitutionId == null && model.MentorId == null && model.PracticArea == "" && model.Speciality == "" && model.StudentId == null))
     {
         return(GetQuery().Distinct().ToList());
     }
     //TODO: Если я правильно понял логику запроса, то должно быть что-то вроде этого: ((...||...||...) && IsDeleted == false)
     return(GetQuery().Where(st =>
                             st.Id == model.StudentId ||
                             st.InstitutionId == model.InstitutionId ||
                             st.MentorId == model.MentorId ||
                             st.PracticArea == model.PracticArea ||
                             st.Speciality == model.Speciality &&
                             st.IsDeleted == false).Include(st => st.Institution).Include(st => st.Mentor).Distinct().ToList());
 }
示例#24
0
        public virtual IActionResult _Report(ReportSearchModel SearchModel)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageConstruction))
            {
                return(AccessDeniedKendoGridJson());
            }

            var model = _reportService.GetReport(constructionCode: SearchModel.ConstructionCode,
                                                 contractNameCode: SearchModel.ContractNameCode, startDateFrom: SearchModel.StartDateFrom, startDateTo: SearchModel.StartDateTo,
                                                 constructionType: SearchModel.ConstructionType, contractFormId: SearchModel.ContractFormId,
                                                 SelectConstructionName: SearchModel.SelectConstructionIds.ToList(),
                                                 contractStatus: SearchModel.contractStatus, SelectConstructionType: SearchModel.SelectedConstructionType).ToList();

            return(PartialView(model));
        }
示例#25
0
        private string GetMemberBonusReportSql(ReportSearchModel model)
        {
            var sql = new StringBuilder();

            var userId = GetUserIdField(model.UserType);

            sql.AppendLine("SELECT [B].UserId,[R].RoleId, [B].BonusType, Sum([B].Amount) Amount");
            sql.AppendLine("FROM [dbo].[PKBonus] [B]");
            sql.AppendLine("INNER JOIN [dbo].[PK] [PK] ON [PK].PKId = [B].PKId");
            sql.AppendLine("INNER JOIN [dbo].[User] [U] ON [U].UserId = [B].UserId");
            sql.AppendLine("INNER JOIN [dbo].[UserRole] [R] ON [U].UserId = [R].UserId");
            sql.AppendLine(GetWhereSql(model) + " AND [R].RoleId = 4");
            sql.AppendLine("GROUP BY [B].UserId,[R].RoleId,[B].BonusType");

            return(sql.ToString());
        }
示例#26
0
        private string GetAgentBonusReportSql(ReportSearchModel model)
        {
            var sql = new StringBuilder();

            var userId = GetUserIdField(model.UserType);

            sql.AppendLine(string.Format("SELECT [B].UserId,[R].RoleId,[UE].{0}, [B].BonusType, Sum([B].Amount) Amount", userId));
            sql.AppendLine("FROM [dbo].[PKBonus] [B]");
            sql.AppendLine("INNER JOIN [dbo].[PK] [PK] ON [PK].PKId = [B].PKId");
            sql.AppendLine("INNER JOIN [dbo].[UserExtension] [UE] ON [UE].UserId = [B].UserId");
            sql.AppendLine("INNER JOIN [dbo].[UserRole] [R] ON [B].UserId = [R].UserId");
            sql.AppendLine(string.Format("INNER JOIN [dbo].[User] [U] ON [U].UserId = [UE].{0}", userId));
            sql.AppendLine(GetWhereSql(model));
            sql.AppendLine(string.Format("GROUP BY [B].UserId, [R].RoleId, [UE].{0}, [B].BonusType", userId));

            return(sql.ToString());
        }
        /// <summary>
        /// Get Provider Reports By Filters
        /// </summary>
        /// <param name="reportSearchModel"></param>
        /// <returns></returns>
        public List <ProviderReportModel> GetServiceProviderReportsByFilters(ReportSearchModel reportSearchModel)
        {
            var obj = new
            {
                SearchProvider            = reportSearchModel.SearchProvider,
                SearchContactractor       = reportSearchModel.SearchContactractor,
                SearchEmployeeName        = reportSearchModel.SearchEmployeeName,
                SearchFromDate            = reportSearchModel.SearchFromDate,
                SearchToDate              = reportSearchModel.SearchToDate,
                SearchEmployeeInsuranceId = reportSearchModel.SearchEmployeeInsuranceId,
                SearchStatusId            = reportSearchModel.SearchStatusId,
                SearchVisitTypeId         = reportSearchModel.SearchVisitTypeId,
                SearchClaimId             = reportSearchModel.SearchClaimId,
            };

            return(QueryExecutor.Query <ProviderReportModel>(StoreProcedures.usp_GetTPAClaimsReportForServiceProvider.ToString(), obj, CommandType.StoredProcedure).ToList());
        }
示例#28
0
        public JsonResult GetBets(ReportSearchModel model)
        {
            var result = new ResponseResult();

            try
            {
                result.Data = new ReportService().GetUserBetReports(model);
            }
            catch (Exception ex)
            {
                result.Success = false;
                result.Message = MessageConst.System_Error;
                _logger.Info(ex);
            }

            return(Json(result));
        }
示例#29
0
        public ActionResult List(ReportSearchModel model)
        {
            if (ModelState.IsValid)
            {
                DateTimeOffset start          = model.ReportDate.Start ?? new DateTime(2019, 01, 01);
                DateTimeOffset end            = model.ReportDate.End ?? DateTime.MaxValue.Date;
                var            brokerId       = User.TryGetBrokerId();
                var            organisationId = User.TryGetCustomerOrganisationId();
                var            customerUnits  = User.IsInRole(Roles.CentralAdministrator) ? null : User.TryGetLocalAdminCustomerUnits();
                switch (model.ReportType)
                {
                case ReportType.OrdersForCustomer:
                case ReportType.OrdersForSystemAdministrator:
                    model.ReportItems = _statService.GetNoOfOrders(start, end, organisationId, customerUnits);
                    break;

                case ReportType.DeliveredOrdersCustomer:
                case ReportType.DeliveredOrdersSystemAdministrator:
                case ReportType.DeliveredOrdersBrokers:
                    model.ReportItems = _statService.GetNoOfDeliveredOrders(start, end, organisationId, customerUnits, brokerId);
                    break;

                case ReportType.RequestsForBrokers:
                    model.ReportItems = _statService.GetNoOfRequestsForBroker(start, end, brokerId.Value);
                    break;

                case ReportType.RequisitionsForCustomer:
                case ReportType.RequisitionsForSystemAdministrator:
                case ReportType.RequisitionsForBroker:
                    model.ReportItems = _statService.GetNoOfRequisitions(start, end, organisationId, customerUnits, brokerId);
                    break;

                case ReportType.ComplaintsForCustomer:
                case ReportType.ComplaintsForSystemAdministrator:
                case ReportType.ComplaintsForBroker:
                    model.ReportItems = _statService.GetNoOfComplaints(start, end, organisationId, customerUnits, brokerId);
                    break;
                }
                model.StartDate          = start.ToSwedishString();
                model.EndDate            = end.ToSwedishString();
                model.SelectedReportType = model.ReportType;
                return(View(model));
            }
            return(View(model));
        }
示例#30
0
 public IActionResult StudentsReport(ReportSearchModel model)
 {
     try
     {
         var result = _reportService.StudentsReport(model);
         if (result == null)
         {
             return(BadRequest("Неудалось сформировать отчёт"));
         }
         _logger.LogInformation("Успешенное создание отчёта по прохождению студентами практики");
         return(Ok(result));
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "Ошибка при создании отчёта по прохождению студентами практики");
         return(BadRequest(ex));
     }
 }