public ActionResult SaveData(IList <ReportsViewModel> reportsViewModelList) { try { int index = 0; String result = String.Empty; int daId = reportsViewModelList.First().daId; //1; TempData["daId"] = daId; ReportsViewModel reportsdata = new ReportsViewModel(); index = reportsdata.SaveReports(reportsViewModelList, daId); if (index > 0) { result = "1"; } else { result = "0"; } // ModelState.Clear(); return(Json(result, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { errorlogviewmodel = new ErrorLogViewModel(); errorlogviewmodel.LogError(ex); return(View("Error")); } }
public JsonResult MonthlyReport(string year, string month) { string[] value = User.Identity.Name.Split('|'); ML.OFW.Contracts.Models.billsPayModel.MonthlyBillsPayReport smodel = new OFW.Contracts.Models.billsPayModel.MonthlyBillsPayReport(); smodel.accountNo = value[1].Trim(); smodel.UserName = value[0].Trim(); smodel.month = Convert.ToInt32(month); smodel.year = Convert.ToInt32(year); ML.OFW.Services.OFW service = new OFW.Services.OFW(); var respVal = service.MonthlySendoutBillsPayReport(smodel); var model = new IenumerableReportResult(); if (respVal.respCode != "0") { model.monthlyReport = respVal.listTransactions; int hasData = model.monthlyReport.Count(); var model1 = new ReportsViewModel(); model1.PrintBy = respVal.printBy; model1.Date = respVal.date; model1.runDate = respVal.runDate; model1.TotalCount = respVal.totalCount.ToString(); model1.TotalCommission = String.Format("{0:#,##0.00}", Convert.ToDecimal(respVal.totalCommission)); model1.TotalAmount = String.Format("{0:#,##0.00}", Convert.ToDecimal(respVal.totalPrincipal)); if (hasData > 0) { return(Json(new { status = true, respCode = "1", msg = respVal.respMsg, transDate = respVal.runDate, printBy = respVal.printBy, Date = respVal.date, hasRecord = hasData, otherData = model1, monthlyReport = RenderPartialViewToString("_reportMonthly", model), }, JsonRequestBehavior.AllowGet)); } return(Json(new { status = true, respCode = "0", msg = respVal.respMsg, hasRecord = hasData }, JsonRequestBehavior.AllowGet)); } return(Json(new { status = false, respCode = "0", msg = respVal.respMsg, }, JsonRequestBehavior.AllowGet)); }
public ReportsView() { InitializeComponent(); DataContext = _viewModel = new ReportsViewModel(); Loaded += OnViewLoaded; }
public ActionResult Index() { ReportsViewModel viewModel; // Get the default report var defaultReport = PowerBiHelper.FetchReport(_defaultsRepository.GetApplicationDefault(DefaultReportCode)); // Build up the view model if (defaultReport.Report != null) { viewModel = new ReportsViewModel() { SelectedReportId = new Guid(defaultReport.Report.Id), Reports = PowerBiHelper.FetchReports(defaultReport.Report.Id, "Seatingmap"), Report = defaultReport.Report, AccessToken = defaultReport.AccessToken }; } else { viewModel = new ReportsViewModel() { SelectedReportId = Guid.Empty, Reports = PowerBiHelper.FetchReports(null, "Seatingmap"), Report = null, AccessToken = string.Empty }; } return(View(viewModel)); }
public ActionResult Approved(string session) { var rvm = new ReportsViewModel(); if (session.IsNullOrWhiteSpace()) { return(View(rvm)); } var years = session.Split('-'); if (!years.Any()) { return(View(rvm)); } try { var sYear = Convert.ToInt32(years[0]); rvm.SYear = sYear; var reports = _db.Reports.Where(r => r.IsApproved).Where(r => r.Assignment.Start.Year == sYear).ToList(); rvm.Reports = reports; return(View(rvm)); } catch { return(View(rvm)); } }
public ActionResult Reports(Guid confId) { List <ReportsViewModel> model = new List <ReportsViewModel>(); ReportsViewModel item = new ReportsViewModel() { ConfId = confId }; model.Add(item); return(View(model)); //var listId = _conferencService.GetListReports(confId); //if (listId.Count() > 0) //{ // foreach (var id in listId) // { // var report = _conferencService.GetReport(id); // ReportsViewModel item = new ReportsViewModel(); // item.Id = report.Id; // item.Title = report.Title; // item.Author = report.Author; // item.ConfId = confId; // model.Add(item); // } //} }
// Run the report using dataset and tableadapter. // Modify to use your code for running the report. private void Run(ReportsViewModel reportsViewModel) { var dataSet = new ReportADataSet(); dataSet.BeginInit(); // We reference the ReportViewer control in XAML. ReportViewer.ProcessingMode = ProcessingMode.Local; ReportViewer.LocalReport.ShowDetailedSubreportMessages = true; ReportViewer.LocalReport.DataSources.Clear(); var dataSource = new ReportDataSource { Name = "ReportA_DS", Value = dataSet.uspReportA // Uses a stored proc }; ReportViewer.LocalReport.DataSources.Add(dataSource); ReportViewer.LocalReport.ReportEmbeddedResource = "MyApp.Reports.ReportA.rdlc"; dataSet.EndInit(); new reportATableAdapter { ClearBeforeFill = true } .Fill(dataSet.uspReportA); // Send message back to viewmodel that the report is ready. Messenger.Default.Send(Constants.Report.ReportA, "SsrsReportReady"); }
public ActionResult Reports() { string tenantID = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/tenantid").Value; using (var client = this.CreatePowerBIClient()) { var viewModel = new ReportsViewModel(); var reportsResponse = client.Reports.GetReports(this.workspaceCollection, this.workspaceId); if (tenantID == adminTenant) { viewModel.Reports = reportsResponse.Value.ToList(); } else { //if tenant id starts with a letter, show acme, otherwise, show contoso string tenantReportName = (Char.IsLetter(tenantID[0])) ? Startup.tenantODataMap["acmeuser"][1]: Startup.tenantODataMap["contosouser"][1]; var report = reportsResponse.Value.FirstOrDefault(r => r.Name == tenantReportName); viewModel.Reports = new List <Report>(); viewModel.Reports.Add(report); } return(View(viewModel)); } }
public ReportsPage() { InitializeComponent(); ReportsViewModel vm = new ReportsViewModel(); BindingContext = vm; }
private void ShowReportsImplementation() { if (_currentReportsViewModel == null) { try { _currentReportsViewModel = new ReportsViewModel( _synchronizationReportRepository, _optionsDataAccess.Load().ToDictionary(o => o.Id, o => o.Name), this); _currentReportsViewModel.ReportsClosed += delegate { _currentReportsViewModel = null; }; _uiService.Show(_currentReportsViewModel); } catch { _currentReportsViewModel = null; throw; } } else { _currentReportsViewModel.RequireBringToFront(); } }
public ActionResult Index(EnumReports rpt, ReportsViewModel rptVM) { ReportDataSource[] repCol = new ReportDataSource[1]; ReportParameterCollection paramCol = null; switch (rpt) { case EnumReports.RptWODailyRecap: repCol[0] = GetWOs(rptVM.RptDateFrom, rptVM.RptDateTo); //set params paramCol = new ReportParameterCollection(); paramCol.Add(new ReportParameter("V_START_DATE", rptVM.RptDateFrom.Value.ToString())); paramCol.Add(new ReportParameter("V_END_DATE", rptVM.RptDateTo.Value.ToString())); break; } //send report data source and report params to session data Session["ReportData"] = repCol; Session["ReportParams"] = paramCol; var e = new { Success = true, Message = "redirect", UrlReport = string.Format("{0}", rpt.ToString()) }; return(Json(e, JsonRequestBehavior.AllowGet)); }
public IActionResult Index() { var centreId = User.GetCentreId(); var categoryIdFilter = User.GetAdminCourseCategoryFilter(); var filterData = Request.Cookies.RetrieveFilterDataFromCookie(categoryIdFilter); Response.Cookies.SetReportsFilterCookie(filterData, DateTime.UtcNow); var activity = activityService.GetFilteredActivity(centreId, filterData); var(jobGroupName, courseCategoryName, courseName) = activityService.GetFilterNames(filterData); var filterModel = new ReportsFilterModel( filterData, jobGroupName, courseCategoryName, courseName, categoryIdFilter == null ); var evaluationResponseBreakdowns = evaluationSummaryService.GetEvaluationSummary(centreId, filterData); var model = new ReportsViewModel( activity, filterModel, evaluationResponseBreakdowns, filterData.StartDate, filterData.EndDate ?? DateTime.Today ); return(View(model)); }
// // GET: /Reports/ public ActionResult Index() { Model = new ReportsViewModel { Units = UnitClient.GetListOfUnits(true, "") }; return(View(Model)); }
public IActionResult Index() { var avm = new ReportsViewModel() { }; return(View(avm)); }
public JsonResult GenerateReport(ReportRequestData model) { var dirPath = System.Web.Configuration.WebConfigurationManager.AppSettings["ReportPath"].ToString(); ReportsViewModel vm = new ReportsViewModel(); var data = vm.GenerateReport(model, dirPath); return(Json(data)); }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { DataContext = new ReportsViewModel(); DateTill.DisplayDateEnd = DateTime.Now; DateTill.DisplayDateStart = DateTime.Parse("01/01/2000"); DateFrom.DisplayDateEnd = DateTime.Now; DateFrom.DisplayDateStart = DateTime.Parse("01/01/2000"); }
public ActionResult DailyCancellationReport() { var model = new ReportsViewModel(); model.dtFrom = DateTime.Now; return(View(model)); }
/// <summary> /// ctor(). /// </summary> public ReportsPage() { InitializeComponent(); SlideMenu = new SideMenuView(); BindingContext = _viewModel = new ReportsViewModel(); }
public ActionResult GetReport() { ReportsViewModel reportsViewModel = new ReportsViewModel() { }; return(View(reportsViewModel)); }
// Reports public ActionResult Reports() { var vm = new ReportsViewModel { Title = "Reports" }; return(View(vm)); }
public ActionResult HistoryReport() { var model = new ReportsViewModel(); model.dtFrom = DateTime.Now; model.dtTo = DateTime.Now; return(View(model)); }
public ActionResult Reports() { // students string[] names = ConfigurationManager.AppSettings.AllKeys .Where(k => k.StartsWith("StudentReport")) .Select(k => ConfigurationManager.AppSettings[k]) .ToArray(); var vm = new ReportsViewModel { StudentReports = names }; //vm.StudentReports = new ICollection<string>(); //foreach (var name in names) //{ // vm.StudentReports.Add(name); //} // OleDbConnection connection = new OleDbConnection( // "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Inventar.accdb"); // DataSet DS = new DataSet(); // connection.Open(); // string query = // @"SELECT Status.* // FROM Status"; // OleDbDataAdapter DBAdapter = new OleDbDataAdapter(); // DBAdapter.SelectCommand = new OleDbCommand(query, connection); // DBAdapter.Fill(DS); // Assumes that connection is a valid SqlConnection object. System.Data.SqlClient.SqlConnection connection = new System.Data.SqlClient.SqlConnection("Data Source=.\\sqlexpress;Initial Catalog=LitProRead;Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFramework"); string queryString = "SELECT * FROM dbo.Status"; System.Data.SqlClient.SqlDataAdapter adapter = new System.Data.SqlClient.SqlDataAdapter(queryString, connection); DataSet status = new DataSet(); adapter.Fill(status);//, "Status"); //List<SelectListItem> list = new List<SelectListItem>(); List <string> statusList = new List <string>(); foreach (DataRow row in status.Tables[0].Rows) { statusList.Add((string)row["status"]); } vm.StudentReportsStatus = statusList; StatusDataSet statusDs = new StatusDataSet(); StatusTableAdapter ad = new StatusTableAdapter(); DataTable dt = ad.GetData(); //using (LitProReadEntities db = new LitProReadEntities()) //{ // StudentReportsStatus = from s in db.GetTable<Status>(); //} return(View(vm)); }
public ActionResult Index(int?id) { try { if (id == null) { id = (int)TempData["daId"]; } ReportsViewModel reportsViewModel = new ReportsViewModel(); reportsViewModel.lstSource = reportsViewModel.GetSourcesList((int)id); reportsViewModel.lstHighLevelTxns = reportsViewModel.GetTransactionsList((int)id).lstTransactions; reportsViewModel.lstPeriodType = reportsViewModel.GetPeriodTypeList((int)id); //reportsViewModel.GetPeriodTypeList((int)id); reportsViewModel.lstReports = reportsViewModel.getReportsFrmDB((int)id); //(1); //reportsViewModel.GetSourcesList((int)id); CommonFunctions comfuns = new CommonFunctions(); var da = comfuns.FindDA((int)id); reportsViewModel.daId = (int)id; reportsViewModel.ModuleId = da.ModuleId; reportsViewModel.daName = da.DAName; TempData["daId"] = reportsViewModel.daId; int clientId; int projectId; int applicationId; string projectName; string appName; string modName; comfuns.GetModuleName(da.ModuleId, out applicationId, out modName); reportsViewModel.ApplicationID = applicationId; reportsViewModel.ModuleName = modName; comfuns.GetApplicationName(applicationId, out projectId, out appName); reportsViewModel.ProjectID = projectId; reportsViewModel.ApplicationName = appName; comfuns.GetProjectName(projectId, out clientId, out projectName); reportsViewModel.ClientID = clientId; reportsViewModel.ProjectName = projectName; reportsViewModel.ClientName = comfuns.GetClientName(clientId); return(View(reportsViewModel)); } catch (Exception ex) { errorlogviewmodel = new ErrorLogViewModel(); errorlogviewmodel.LogError(ex); return(View("Error")); } }
public ActionResult Products() { ReportsViewModel reportsViewModel = new ReportsViewModel() { ReportName = "Products" }; return(View(reportsViewModel)); }
public IActionResult Index() { var viewModel = new ReportsViewModel { Reports = this.reportsService.GetAllReports <ReportViewModel>(), }; return(this.View(viewModel)); }
/// <summary> /// Конструктор, принимающие интерфейс загрузки отчетов /// </summary> /// <param name="reportLoader"></param> public ReportsPage(IReportLoader reportLoader) { InitializeComponent(); Title = Droid.Resources.Messages.Text_Reports; _viewModel = new ReportsViewModel(reportLoader); this.BindingContext = _viewModel; }
public ActionResult Index() { ReportsViewModel vm = new ReportsViewModel(); var username = HttpContext.User.Identity.Name; vm.user = _UserRepository.GetUserByUsername(username); return(View(vm)); }
public ActionResult PlantsList() { ReportsViewModel reportsViewModel = new ReportsViewModel() { ReportName = "PlantsList" }; return(View(reportsViewModel)); }
private void ReportSpace_PreviewMouseDown(object sender, MouseButtonEventArgs e) { ReportLabel.Foreground = new SolidColorBrush(Colors.White); ReportSpace.Fill = new SolidColorBrush(Color.FromRgb(22, 191, 131)); DataContext = new ReportsViewModel(); ChangeAllSelections("reports"); }
public ActionResult MachinesList() { ReportsViewModel reportsViewModel = new ReportsViewModel() { ReportName = "MachinesList" }; return(View(reportsViewModel)); }
public void Show (ReportsViewModel reportsViewModel) { var view = new ReportsView(); view.DataContext = reportsViewModel; var window = new GenericElementHostWindow(); window.Text = "Synchronization Reports"; window.Child = view; window.Show(); window.FormClosed += delegate { reportsViewModel.NotifyReportsClosed(); }; reportsViewModel.RequiresBringToFront += delegate { window.BringToFront(); }; SetWindowSizeToQuarterOfScreenSize (window); }
public void Show (ReportsViewModel reportsViewModel) { var view = new ReportsView(); view.DataContext = reportsViewModel; var window = new GenericElementHostWindow(); window.Text = "Synchronization Reports"; window.Icon = Resources.ApplicationIcon; window.ShowIcon = true; window.BackColor = SystemColors.Window; window.Child = view; window.Show(); window.FormClosed += delegate { reportsViewModel.NotifyReportsClosed(); }; reportsViewModel.RequiresBringToFront += delegate { window.BringToFront(); }; SetWindowSize (window, 0.75); }