Esempio n. 1
0
        // GET: Accounts/Home
        public ActionResult Home()
        {
            try
            {
                var            companyId      = Convert.ToInt32(Session["CompanyId"]);
                int            branchId       = Convert.ToInt32(Session["BranchId"]);
                var            clients        = _iReportManager.GetTopClients().ToList();
                var            batteries      = _iReportManager.GetPopularBatteries().ToList();
                ViewTotalOrder totalOrder     = _iReportManager.GetTotalOrderByBranchIdCompanyIdAndYear(branchId, companyId, DateTime.Now.Year);
                var            accountSummary = _iAccountsManager.GetAccountSummaryofCurrentMonthByBranchAndCompanyId(branchId, companyId);
                var            branches       = _iBranchManager.GetAllBranches();
                SummaryModel   aModel         = new SummaryModel
                {
                    Branches       = branches.ToList(),
                    BranchId       = branchId,
                    CompanyId      = companyId,
                    TotalOrder     = totalOrder,
                    AccountSummary = accountSummary,
                    Clients        = clients,
                    Products       = batteries
                };

                return(View(aModel));
            }
            catch (Exception exception)
            {
                Log.WriteErrorLog(exception);
                return(PartialView("_ErrorPartial", exception));
            }
        }
Esempio n. 2
0
 public IActionResult Create(SummaryModel model)
 {
     // Store summary report
     SummariesStorage.Summaries.Add(model);
     // Return to list of all summaries. Maybe redirect to summary report details?
     return(RedirectToAction("Index"));
 }
        // GET: SCM/Home
        public ActionResult Home()
        {
            try
            {
                //Session.Remove("BranchId");
                //Session.Remove("Branch");
                int companyId = Convert.ToInt32(Session["CompanyId"]);

                var branches = _iBranchManager.GetAllBranches().ToList().FindAll(n => n.BranchId != 13).ToList();
                foreach (ViewBranch branch in branches)
                {
                    branch.Orders   = _iOrderManager.GetOrdersByBranchId(branch.BranchId).ToList();
                    branch.Products = _iInventoryManager.GetStockProductByBranchAndCompanyId(branch.BranchId, companyId).ToList();
                }


                var invoicedOrders = _iInvoiceManager.GetAllInvoicedOrdersByCompanyId(companyId).ToList();
                // var todaysInvoceOrders= _iInvoiceManager.GetInvoicedOrdersByCompanyIdAndDate(companyId,DateTime.Now).ToList();
                SummaryModel model = new SummaryModel
                {
                    Branches          = branches,
                    InvoicedOrderList = invoicedOrders
                                        //OrderListByDate = todaysInvoceOrders
                };
                return(View(model));
            }
            catch (Exception exception)
            {
                Log.WriteErrorLog(exception);
                return(PartialView("_ErrorPartial", exception));
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Gets summary details for all noticeboard message types.
        /// </summary>
        /// <param name="model">A <see cref="SummaryModel" /> with request data.</param>
        /// <returns>A <see cref="SummaryModel" /> with request and response data.</returns>
        public SummaryModel GetSummary(SummaryModel model)
        {
            var currentDateTime = UserService.DateTime;

            var request = model.ToMessageCountsGetRequest();//    MappingEngine.Map<MessageCountsGetRequest>(model);

            request.RequestDT = currentDateTime.ToString("dMMMyyyy HH:mm:ss");
            //request.SiteCode = UserService.SiteCode;

            ValidateRequest(request);

            try
            {
                var service = Client.Create <INoticeboardMessages>("NoticeboardMessages.svc");

                var response = service.MessageCountsGet(request);

                var summaryModel = response.ToSummaryModel();//   MappingEngine.Map<SummaryModel>(response);

                summaryModel.SearchCriteriaSiteCode         = request.SiteCode;
                summaryModel.SearchCriteriaJobseekerID      = model.SearchCriteriaJobseekerID;
                summaryModel.SearchCriteriaCreatedAfterDate = model.SearchCriteriaCreatedAfterDate;
                summaryModel.SearchCriteriaManagedBy        = model.SearchCriteriaManagedBy;

                return(summaryModel);
            }
            catch (FaultException <ValidationFault> vf)
            {
                throw vf.ToServiceValidationException();
            }
            catch (FaultException fe)
            {
                throw fe.ToServiceValidationException();
            }
        }
        public async Task SaveResponse_ValidModel_SavesResponse()
        {
            Mock <ISurveyResponses> mockSurveyResponse = new Mock <ISurveyResponses>();

            SurveyController surveyController = new SurveyController();
            HttpContext      context          = new DefaultHttpContext();

            surveyController.TempData = new TempDataDictionary(new DefaultHttpContext(), new Mock <ITempDataProvider>().Object);

            SummaryModel       summaryModel       = new SummaryModel();
            NameModel          nameModel          = new NameModel();
            EmailModel         emailModel         = new EmailModel();
            AddressModel       addressModel       = new AddressModel();
            LightingLevelModel lightingLevelModel = new LightingLevelModel();

            lightingLevelModel.HappyWithLightingLevel = true;
            BrightnessModel brightnessModel = new BrightnessModel();

            brightnessModel.BrightnessLevel = 5;

            summaryModel.Name          = nameModel;
            summaryModel.Email         = emailModel;
            summaryModel.Address       = addressModel;
            summaryModel.LightingLevel = lightingLevelModel;
            summaryModel.Brightness    = brightnessModel;

            RedirectToActionResult result = (RedirectToActionResult)await surveyController.SaveResponse(mockSurveyResponse.Object, summaryModel);

            Assert.IsNotNull(result);
            Assert.AreEqual("Confirmation", result.ActionName);

            mockSurveyResponse.Verify(s => s.SaveSurveyResponse(It.IsAny <LightingSurvey>()), Times.Once);
        }
Esempio n. 6
0
        public IActionResult Summary()
        {
            var name  = _databaseService.GetName();
            var model = new SummaryModel();

            return(View(model));
        }
Esempio n. 7
0
        public ActionResult Summary(int index)
        {
            TaskManager = (ImportMetadataStructureTaskManager)Session["TaskManager"];
            //set current stepinfo based on index
            if (TaskManager != null)
            {
                TaskManager.SetCurrent(index);
            }

            SummaryModel model = new SummaryModel(TaskManager.Current());

            model.StepInfo = TaskManager.Current();


            if (TaskManager.Bus.ContainsKey(ImportMetadataStructureTaskManager.ROOT_NODE))
            {
                model.RootName = TaskManager.Bus[ImportMetadataStructureTaskManager.ROOT_NODE].ToString();
            }

            if (TaskManager.Bus.ContainsKey(ImportMetadataStructureTaskManager.SCHEMA_NAME))
            {
                model.SchemaName = TaskManager.Bus[ImportMetadataStructureTaskManager.SCHEMA_NAME].ToString();
            }



            return(PartialView(model));
        }
Esempio n. 8
0
        public ActionResult Summary(int index)
        {
            TaskManager = (TaskManager)Session["TaskManager"];
            //set current stepinfo based on index
            if (TaskManager != null)
            {
                TaskManager.SetCurrent(index);
                // remove if existing
                TaskManager.RemoveExecutedStep(TaskManager.Current());

                _bus = TaskManager.Bus;
            }

            SummaryModel model = new SummaryModel();

            model.AsyncUpload = isASyncUpload();
            model.StepInfo    = TaskManager.Current();

            model = updateModel(model);

            if (TaskManager.Bus.ContainsKey(TaskManager.DATASET_TITLE) && TaskManager.Bus[TaskManager.DATASET_TITLE] != null)
            {
                model.DatasetTitle = TaskManager.Bus[TaskManager.DATASET_TITLE].ToString();
            }


            return(PartialView(model));
        }
        private void GetSummaryData(IEventBase obj)
        {
            var userSummary = userManager.GetSummary();

            var btcTickers = new List <TickerModel>();

            foreach (var btcTicker in userSummary.BtcTickers)
            {
                btcTickers.Add(new TickerModel
                {
                    Coin         = btcTicker.Value.Coin,
                    Exchange     = btcTicker.Value.Exchange,
                    Ticker       = btcTicker.Value.Last,
                    TickerSymbol = Util.GetCurrencySymbol(btcTicker.Value.TickerSymbol)
                });
            }

            var userSummaryModel = new SummaryModel
            {
                TotalBalance = userSummary.TotalBalance,
                Balance      = userSummary.Balance,
                RemainingBtc = userSummary.RemainingBtc,
                BtcTickers   = btcTickers
            };

            MainController.MainHub.SendMessage("summary", userSummaryModel);
        }
Esempio n. 10
0
        public ActionResult Home()
        {
            Session.Remove("BranchId");
            Session.Remove("Branch");

            int            companyId      = Convert.ToInt32(Session["CompanyId"]);
            var            branches       = _iBranchManager.GetAllBranches();
            ViewTotalOrder totalOrder     = _iReportManager.GetTotalOrdersByCompanyIdAndYear(companyId, DateTime.Now.Year);
            var            accountSummary = _iAccountsManager.GetAccountSummaryofCurrentMonthByCompanyId(companyId);
            var            clients        = _iReportManager.GetTopClients().ToList();
            var            batteries      = _iReportManager.GetPopularBatteries().ToList();

            SummaryModel summary = new SummaryModel
            {
                Branches       = branches.ToList(),
                CompanyId      = companyId,
                TotalOrder     = totalOrder,
                Clients        = clients,
                Products       = batteries,
                AccountSummary = accountSummary
            };
            var aModel = new MessageModel
            {
                PhoneNumber     = "01841000307",
                CustomerName    = "Abdus Salam",
                TotalQuantity   = 1,
                Amount          = 38000,
                TransactionDate = DateTime.Now,
                TransactionRef  = "192022500"
            };

            aModel.MessageBody = aModel.GetMessageForDistribution();
            //var res = _iCommonManager.SendSms(aModel);
            return(View(summary));
        }
Esempio n. 11
0
        public IList <SummaryModel> Get(int type)
        {
            IList <Summary>      list      = _summaryBusiness.Get(type);
            IList <SummaryModel> modelList = new List <SummaryModel>();

            foreach (var item in list)
            {
                SummaryModel model = new SummaryModel();
                model.Id           = item.Id;
                model.CompanyId    = item.CompanyId;
                model.DptId        = item.DptId;
                model.EmployeeId   = item.EmployeeId;
                model.EmployeeName = item.EmployeeName;
                model.SummaryDate  = item.SummaryDate;
                model.Finish       = item.Finish;
                model.Content      = item.Content;
                model.Plan         = item.Plan;
                model.Help         = item.Help;
                model.Description  = item.Description;
                model.AddTime      = item.AddTime.ToString();
                model.DateSummary  = item.SummaryDate + GetDescription(item.Index);
                model.ReadState    = GetDescription(item.IsRead);
                modelList.Add(model);
            }
            return(modelList);
        }
Esempio n. 12
0
        // GET: Admin/Home
        public ActionResult Home()
        {
            SummaryModel model = new SummaryModel();

            if (User.Identity.Name.Contains("nbl_sales"))
            {
                Session.Remove("BranchId");
                Session.Remove("Branch");
            }
            else
            {
                var branchId       = Convert.ToInt32(Session["BranchId"]);
                var companyId      = Convert.ToInt32(Session["CompanyId"]);
                var orders         = _iInvoiceManager.GetAllInvoicedOrdersByCompanyId(companyId).ToList().FindAll(n => n.BranchId == branchId).ToList();
                var pendingOrders  = _iOrderManager.GetAllOrderByBranchAndCompanyIdWithClientInformation(branchId, companyId).ToList().FindAll(n => n.Status == 1).ToList();
                var clients        = _iClientManager.GetAllClientDetailsByBranchId(branchId).ToList();
                var products       = _iInventoryManager.GetStockProductByBranchAndCompanyId(branchId, companyId).ToList();
                var delayedOrders  = _iOrderManager.GetDelayedOrdersToAdminByBranchAndCompanyId(branchId, companyId);
                var verifiedOrders = _iOrderManager.GetVerifiedOrdersByBranchAndCompanyId(branchId, companyId);
                model = new SummaryModel
                {
                    InvoicedOrderList = orders,
                    PendingOrders     = pendingOrders,
                    Clients           = clients,
                    Products          = products,
                    DelayedOrders     = delayedOrders,
                    VerifiedOrders    = verifiedOrders
                };
            }
            return(View(model));
        }
Esempio n. 13
0
        public ActionResult Home()
        {
            var branchId       = Convert.ToInt32(Session["BranchId"]);
            var companyId      = Convert.ToInt32(Session["CompanyId"]);
            var orders         = _iOrderManager.GetOrdersByBranchAndCompnayId(branchId, companyId).ToList().FindAll(n => n.Status == 4);
            var delayedOrders  = _iOrderManager.GetDelayedOrdersToNsmByBranchAndCompanyId(branchId, companyId);
            var clients        = _iClientManager.GetAllClientDetailsByBranchId(branchId).ToList();
            var pendingorders  = _iOrderManager.GetOrdersByBranchIdCompanyIdAndStatus(branchId, companyId, 0).ToList();
            var products       = _iInventoryManager.GetStockProductByBranchAndCompanyId(branchId, companyId).ToList();
            var verifiedOrders = _iOrderManager.GetVerifiedOrdersByBranchAndCompanyId(branchId, companyId);

            SummaryModel summary = new SummaryModel
            {
                BranchId       = branchId,
                CompanyId      = companyId,
                Orders         = orders,
                Clients        = clients,
                DelayedOrders  = delayedOrders,
                PendingOrders  = pendingorders,
                Products       = products,
                VerifiedOrders = verifiedOrders
            };

            return(View(summary));
        }
Esempio n. 14
0
        public void SendScrubbingInputData(ScrubCaCommand command)
        {
            PopulateFields(command.FieldsContent, command.Fields);
            foreach (var opt in command.Options)
            {
                PopulateFields(opt.FieldsContent, opt.Fields);
                foreach (var pyt in opt.Payouts)
                {
                    PopulateFields(pyt.FieldsContent, pyt.Fields);
                }
            }

            CaProcessViewModel viewModel = _apiService.Execute(command);

            IHubContext notifHub = GlobalHost.ConnectionManager.GetHubContext <NotificationHub>();

            if (viewModel != null)
            {
                notifHub.Clients.All.updateProcess(viewModel);
            }

            SummaryModel summaryModel = GetSummaryModel();

            if (summaryModel != null)
            {
                notifHub.Clients.All.updateSummaryModel(summaryModel);
            }
        }
Esempio n. 15
0
        public string RelativeUrlTo(SummaryModel model)
        {
            var outputPath   = OutputFile.Directory.FullName;
            var relativePath = model.OutputFileInfo !.FullName.Replace(outputPath, "./");

            return(relativePath.Replace('\\', '/'));
        }
Esempio n. 16
0
 // GET: Sales/SalesPerson
 public ActionResult Home()
 {
     try
     {
         var          user            = (ViewUser)Session["user"];
         var          branchId        = Convert.ToInt32(Session["BranchId"]);
         var          companyId       = Convert.ToInt32(Session["CompanyId"]);
         var          delayedOrders   = _iOrderManager.GetDelayedOrdersToSalesPersonByBranchAndCompanyId(branchId, companyId);
         var          cancelledOrders = _iOrderManager.GetCancelledOrdersToSalesPersonByBranchCompanyUserId(branchId, companyId, user.UserId);
         var          products        = _iInventoryManager.GetStockProductByBranchAndCompanyId(branchId, companyId).ToList();
         var          clients         = _iClientManager.GetAllClientDetailsByBranchId(branchId).ToList();
         var          orders          = _iOrderManager.GetAllOrderByBranchAndCompanyIdWithClientInformation(branchId, companyId).OrderByDescending(n => n.OrderId).DistinctBy(n => n.OrderId).ToList().FindAll(n => n.UserId == user.UserId);
         SummaryModel model           = new SummaryModel
         {
             Orders          = orders,
             Clients         = clients,
             PendingOrders   = _iOrderManager.GetOrdersByBranchIdCompanyIdAndStatus(branchId, companyId, 0),
             DelayedOrders   = delayedOrders,
             Products        = products,
             CancelledOrders = cancelledOrders
         };
         return(View(model));
     }
     catch (Exception exception)
     {
         Log.WriteErrorLog(exception);
         return(PartialView("_ErrorPartial", exception));
     }
 }
 // GET: Sales/SalesAdmin
 public ActionResult Home()
 {
     try
     {
         var branchId       = Convert.ToInt32(Session["BranchId"]);
         var companyId      = Convert.ToInt32(Session["CompanyId"]);
         var orders         = _iInvoiceManager.GetAllInvoicedOrdersByCompanyId(companyId).ToList().FindAll(n => n.BranchId == branchId).ToList();
         var pendingOrders  = _iOrderManager.GetAllOrderByBranchAndCompanyIdWithClientInformation(branchId, companyId).ToList().FindAll(n => n.Status == 1).ToList();
         var clients        = _iClientManager.GetAllClientDetailsByBranchId(branchId).ToList();
         var products       = _iInventoryManager.GetStockProductByBranchAndCompanyId(branchId, companyId).ToList();
         var delayedOrders  = _iOrderManager.GetDelayedOrdersToAdminByBranchAndCompanyId(branchId, companyId);
         var verifiedOrders = _iOrderManager.GetVerifiedOrdersByBranchAndCompanyId(branchId, companyId);
         var model          = new SummaryModel
         {
             InvoicedOrderList = orders,
             PendingOrders     = pendingOrders,
             Clients           = clients,
             Products          = products,
             DelayedOrders     = delayedOrders,
             VerifiedOrders    = verifiedOrders
         };
         return(View(model));
     }
     catch (Exception exception)
     {
         Log.WriteErrorLog(exception);
         return(PartialView("_ErrorPartial", exception));
     }
 }
Esempio n. 18
0
        /// <summary>
        /// Lambda to fetch all characters from the character table
        /// </summary>
        /// <param name="pRequest">Incoming API Gateway request object, not used currently</param>
        /// <param name="pContext">Incoming Lambda Context object, not used currently</param>
        /// <returns></returns>
        public APIGatewayProxyResponse FunctionHandler(APIGatewayProxyRequest pRequest, ILambdaContext pContext)
        {
            if (pRequest.Headers != null && pRequest.Headers.Count > 0 && pRequest.Headers.Keys.Contains("warmup"))
            {
                return(HttpHelper.WarmupResponse());
            }
            bool vForceUpdate = false;

            if (pRequest.Headers != null && pRequest.Headers.Count > 0 && pRequest.Headers.Keys.Contains("forceCache"))
            {
                Console.WriteLine("---ForceCache Requested");
                vForceUpdate = true;
            }
            if (HttpHelper.TriggeredLambda(pRequest))
            {
                Console.WriteLine("Auto triggered force cache update detected");
                vForceUpdate = true;
            }

            //We need to retrieve the ClientId for multitenancy purposes
            var vClientId = pRequest.Headers["clientid"];

            SummaryModel vModel = GetCachedModel(vForceUpdate, vClientId);

            return(HttpHelper.HandleResponse(vModel, 200));
        }
        public async Task GenerateAsync()
        {
            //Data
            var       sheetName  = "Summary";
            var       fileName   = "FileName";
            Workbook  workbook   = new Workbook();
            Worksheet worksheet  = workbook.Worksheets.Add(sheetName);
            var       dictionary = new Dictionary <string, IWorksheetReport>();

            //Mocks
            var fundingSummaryReportModelBuilderMock = new Mock <IModelBuilder <ISummaryModel> >();
            var reportServiceContextMock             = new Mock <IReportServiceContext>();
            var reportDataMock      = new Mock <IReportData>();
            var excelServiceMock    = new Mock <IExcelFileService>();
            var fileNameServiceMock = new Mock <IFileNameService>();
            var fundingSummaryReportRenderServiceMock = new Mock <IRenderService <ISummaryModel> >();
            var reportDataProviderMock = new Mock <IReportDataProvider>();
            var cancellationToken      = CancellationToken.None;

            var model = new SummaryModel();

            //Setup
            reportDataProviderMock.Setup(x => x.ProvideAsync(reportServiceContextMock.Object, cancellationToken))
            .ReturnsAsync(reportDataMock.Object);

            fundingSummaryReportModelBuilderMock.Setup(b => b.Build(reportServiceContextMock.Object, reportDataMock.Object)).Returns(model);
            fileNameServiceMock.Setup(s => s.GetFilename(reportServiceContextMock.Object, "Frm Summary Report", OutputTypes.Excel, true)).Returns(fileName);
            excelServiceMock.Setup(s => s.NewWorkbook()).Returns(workbook);
            excelServiceMock.Setup(s => s.GetWorksheetFromWorkbook(workbook, sheetName)).Returns(worksheet);

            await NewReport(dictionary, fileNameServiceMock.Object, excelServiceMock.Object, reportDataProviderMock.Object, fundingSummaryReportModelBuilderMock.Object, fundingSummaryReportRenderServiceMock.Object).GenerateAsync(reportServiceContextMock.Object, cancellationToken);

            fundingSummaryReportModelBuilderMock.Verify(x => x.Build(reportServiceContextMock.Object, reportDataMock.Object));
            fundingSummaryReportRenderServiceMock.Verify(s => s.Render(model, worksheet));
        }
Esempio n. 20
0
        // GET: Corporate/Home
        public ActionResult Home()
        {
            Session.Remove("BranchId");
            Session.Remove("Branch");

            int            companyId      = Convert.ToInt32(Session["CompanyId"]);
            var            branches       = _iBranchManager.GetAllBranches();
            ViewTotalOrder totalOrder     = _iReportManager.GetTotalOrdersByCompanyIdAndYear(companyId, DateTime.Now.Year);
            var            accountSummary = _iAccountsManager.GetAccountSummaryofCurrentMonthByCompanyId(companyId);
            var            products       = _iInventoryManager.GetStockProductByCompanyId(companyId);
            var            orders         = _iOrderManager.GetOrdersByCompanyId(companyId).ToList();
            var            topClients     = _iReportManager.GetTopClientsByYear(DateTime.Now.Year).ToList();
            var            clients        = _iClientManager.GetAllClientDetails();
            var            topProducts    = _iReportManager.GetPopularBatteriesByYear(DateTime.Now.Year).ToList();
            var            employees      = _iEmployeeManager.GetAllEmployeeWithFullInfo().ToList();
            SummaryModel   summary        = new SummaryModel
            {
                Branches       = branches.ToList(),
                CompanyId      = companyId,
                TotalOrder     = totalOrder,
                TopClients     = topClients,
                Orders         = orders,
                TopProducts    = topProducts,
                Clients        = clients,
                Employees      = employees,
                Products       = products,
                AccountSummary = accountSummary
            };

            return(View(summary));
        }
 public static void HighlightSummary(this SummaryModel summary, bool highlighted)
 {
     if (null != summary)
     {
         summary.Highlighted = highlighted;
     }
 }
        public IHttpActionResult GetSummaryInformation()
        {
            SummaryModel summaryModel = new SummaryModel();

            List <int> CaIds = _context.CaTimeline.Select(a => a.CaId).ToList();

            foreach (int caId in CaIds)
            {
                SummaryCaModel CorporateActionSummary = CreateSummaryCa(caId);
                summaryModel.CAs.Add(CorporateActionSummary);
            }

            ProcessPrecentageModel scrubingProcessPrecentage = CalculateScrubingProcessPrecentage(0, true);

            summaryModel.SummaryProcessPrecentage.Add(scrubingProcessPrecentage);
            ProcessPrecentageModel notificationProcessPrecentage = CalculateNotificationProcessPrecentage(0, true);

            summaryModel.SummaryProcessPrecentage.Add(notificationProcessPrecentage);
            ProcessPrecentageModel responseProcessPrecentage = CalculateResponseProcessPrecentage(0, true);

            summaryModel.SummaryProcessPrecentage.Add(responseProcessPrecentage);
            ProcessPrecentageModel instructionProcessPrecentage = CalculateInstructionProcessPrecentage(0, true);

            summaryModel.SummaryProcessPrecentage.Add(instructionProcessPrecentage);
            ProcessPrecentageModel paymentProcessPrecentage = CalculatePaymentProcessPrecentage(0, true);

            summaryModel.SummaryProcessPrecentage.Add(paymentProcessPrecentage);

            return(Ok(summaryModel));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            SummaryModel summaryModel = db.Summary.Find(id);

            db.Summary.Remove(summaryModel);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        /// <summary>
        /// Convert to the summary model.
        /// </summary>
        /// <param name="src">The source.</param>
        /// <returns></returns>
        public static SummaryModel ToSummaryModel(this MessageCountsGetResponse src)
        {
            var dest = new SummaryModel();

            dest.ManagedByUsers = src.ManagedByUsers;
            dest.MessageCounts  = ConvertMessageCounts(src.MessageCounts);
            return(dest);
        }
Esempio n. 25
0
 private List <SpendLineModel> CreateIncomeLine()
 {
     using (var db = new MyContext())
     {
         SummaryModel summary = new SummaryModel(db);
         var          spend   = summary.GetIncomeLine(Now_Summary);
         return(spend);
     }
 }
Esempio n. 26
0
        public IList <SummaryModel> Get(string startRangeBegin, string startRangeEnd, string endRangeBegin, string endRangeEnd, string locale)
        {
            Resources.Main.Culture = System.Globalization.CultureInfo.CreateSpecificCulture(locale);
            DateTime startRangeBeginDate;
            DateTime startRangeEndDate;
            DateTime endRangeBeginDate;
            DateTime endRangeEndDate;

            bool _continue = true;

            if (!DateTime.TryParse(startRangeBegin, null, System.Globalization.DateTimeStyles.AdjustToUniversal, out startRangeBeginDate))
            {
                _continue = false;
            }
            if (!DateTime.TryParse(startRangeEnd, null, System.Globalization.DateTimeStyles.AdjustToUniversal, out startRangeEndDate))
            {
                _continue = false;
            }
            if (!DateTime.TryParse(endRangeBegin, null, System.Globalization.DateTimeStyles.AdjustToUniversal, out endRangeBeginDate))
            {
                _continue = false;
            }
            if (!DateTime.TryParse(endRangeEnd, null, System.Globalization.DateTimeStyles.AdjustToUniversal, out endRangeEndDate))
            {
                _continue = false;
            }

            IList <SummaryModel> models = new List <SummaryModel>();

            try
            {
                SummaryDataRepository.ValidateRanges(startRangeBeginDate, startRangeEndDate, endRangeBeginDate, endRangeEndDate);
            }
            catch (Exception e)
            {
                throw new WrongDateException(e.Message);
            }

            _continue = SummaryDataRepository.RangesAreEqualSize(startRangeBeginDate, startRangeEndDate, endRangeBeginDate, endRangeEndDate);

            if (_continue)
            {
                SummaryDataRepository repository = new SummaryDataRepository();
                repository.CalculateNumberOfDays(startRangeBeginDate, startRangeEndDate);

                var data = SummaryData.CreateCollection(repository);

                models = SummaryModel.CreateCollection(data);
            }
            else
            {
                throw new WrongDateException(Resources.Main.Error);
            }

            return(models);
        }
Esempio n. 27
0
 private List <SpendPieModel> Create_Pie()
 {
     using (var db = new MyContext())
     {
         SummaryModel summary = new SummaryModel(db);
         var          piedata = summary.GetSpendPie(Now_Summary);
         Pie_chart.Title = $"合計:{summary.TotalSpend(Now_Summary).ToString()} 円";
         return(piedata);
     }
 }
Esempio n. 28
0
        public ActionResult GetSummary()
        {
            var           departments = ctx.GetAllDepartments().ToList();
            List <Course> courses     = ctx.GetAllCourses().ToList();
            var           summary     = new SummaryModel();

            summary.Courses     = courses;
            summary.Departments = departments;
            return(PartialView("_PartialDemo", summary));
        }
Esempio n. 29
0
        private SummaryModel GetSummaryModel(long accountId, SummaryTimePeriod timePeriod)
        {
            var expenses = ExpenseRepository.GetAccountExpenses(accountId);
            var settings = SettingsHelper.GetCategorySettings(accountId);
            var model    = new SummaryModel(timePeriod, expenses.Min(e => e.SpentDate), expenses.Max(e => e.SpentDate));

            expenses = expenses.Where(e => e.SpentDate >= model.StartDate && e.SpentDate <= model.EndDate.AddDays(1).AddSeconds(-1)).ToList();

            return(model);
        }
        /// <summary>
        /// Convert to the message counts get request.
        /// </summary>
        /// <param name="src">The source.</param>
        /// <returns></returns>
        public static MessageCountsGetRequest ToMessageCountsGetRequest(this SummaryModel src)
        {
            var dest = new MessageCountsGetRequest();

            dest.SiteCode       = src.SearchCriteriaSiteCode;
            dest.JobseekerId    = src.SearchCriteriaJobseekerID;
            dest.CreatedAfterDT = src.SearchCriteriaCreatedAfterDate.ToString("dMMMyyyy HH:mm:ss");
            dest.ManagedBy      = src.SearchCriteriaManagedBy;
            return(dest);
        }