public ReportViewPresenter(IReportView p_view) { this.m_view = p_view; m_customerDao = new CustomerDao(); m_laundryReportDao = new LaundryReportDao(); m_refillReportDao = new RefillReportDao(); }
/// <summary>Attach the model (report) and the view (IReportView)</summary> public void Attach(object Model, object View, ExplorerPresenter explorerPresenter) { this.report = Model as Report; this.explorerPresenter = explorerPresenter; this.view = View as IReportView; this.view.VariableList.Lines = report.VariableNames; this.view.EventList.Lines = report.EventNames; this.view.VariableList.ContextItemsNeeded += OnNeedVariableNames; this.view.EventList.ContextItemsNeeded += OnNeedEventNames; this.view.VariableList.TextHasChangedByUser += OnVariableNamesChanged; this.view.EventList.TextHasChangedByUser += OnEventNamesChanged; this.explorerPresenter.CommandHistory.ModelChanged += OnModelChanged; Simulations simulations = Apsim.Parent(report, typeof(Simulations)) as Simulations; dataStore = Apsim.Child(simulations, typeof(DataStore)) as DataStore; this.view.VariableList.SetSyntaxHighlighter("Report"); dataStorePresenter = new DataStorePresenter(); dataStorePresenter.Attach(dataStore, this.view.DataStoreView, explorerPresenter); this.view.DataStoreView.TableList.SelectedValue = this.report.Name; Simulation simulation = Apsim.Parent(report, typeof(Simulation)) as Simulation; if (simulation != null) { if (simulation.Parent is Experiment) dataStorePresenter.ExperimentFilter = simulation.Parent as Experiment; else dataStorePresenter.SimulationFilter = simulation; dataStorePresenter.PopulateGrid(); } }
public ReportController(IReportView view, ReadOnlyContext context) { _leaseRepository = context.GetRepository<Lease>(); _view = view; _view.GenerateReport += GenerateReport; _view.Show(); }
public ReportPresenter(IReportView view, IErrorLogRepository repository, IReportGenerator generator, ISettingsManager settingsManager) { View = view; _repository = repository; _generator = generator; _settingsManager = settingsManager; RegisterEvents(); }
public ReportPresenter(IReportManager reportManager, IGroupManager groupManager, IReportView view) { this.reportManager = reportManager; this.groupManager = groupManager; this.view = view; view.ShowGroups += new EventHandler(view_ShowGroups); view.ShowReportClicked += new EventHandler(view_ShowReportClicked); view.SaveReportClicked += new EventHandler(view_SaveReportClicked); }
public ReportViewPresenterTests() { _mockView = Substitute.For <IReportView>(); _mockView.When(m => m.ShowDialog()).Do(x => _mockView.OnFormLoad += Raise.EventWith(new object(), new EventArgs())); _mockOKDialog = Substitute.For <IMessageBoxService>(); _presenter = new ReportViewPresenter(_mockView, _mockOKDialog); _presenter.Url = "test"; }
/// <summary> /// Attach the model (report) and the view (IReportView) /// </summary> /// <param name="model">The report model object</param> /// <param name="view">The view object</param> /// <param name="explorerPresenter">The explorer presenter</param> public void Attach(object model, object view, ExplorerPresenter explorerPresenter) { this.report = model as Report; this.explorerPresenter = explorerPresenter; this.view = view as IReportView; this.intellisense = new IntellisensePresenter(view as ViewBase); intellisense.ItemSelected += OnIntellisenseItemSelected; this.view.VariableList.Mode = EditorType.Report; this.view.EventList.Mode = EditorType.Report; this.view.VariableList.Lines = report.VariableNames; this.view.EventList.Lines = report.EventNames; this.view.GroupByEdit.Value = report.GroupByVariableName; this.view.VariableList.ContextItemsNeeded += OnNeedVariableNames; this.view.EventList.ContextItemsNeeded += OnNeedEventNames; this.view.GroupByEdit.IntellisenseItemsNeeded += OnNeedVariableNames; this.view.VariableList.TextHasChangedByUser += OnVariableNamesChanged; this.view.EventList.TextHasChangedByUser += OnEventNamesChanged; this.view.GroupByEdit.Changed += OnGroupByChanged; this.view.SplitterChanged += OnSplitterChanged; this.view.SplitterPosition = Configuration.Settings.ReportSplitterPosition; this.explorerPresenter.CommandHistory.ModelChanged += OnModelChanged; this.view.TabChanged += OnChangeTab; Simulations simulations = Apsim.Parent(report, typeof(Simulations)) as Simulations; if (simulations != null) { dataStore = Apsim.Child(simulations, typeof(IDataStore)) as IDataStore; } //// TBI this.view.VariableList.SetSyntaxHighlighter("Report"); dataStorePresenter = new DataStorePresenter(); Simulation simulation = Apsim.Parent(report, typeof(Simulation)) as Simulation; Experiment experiment = Apsim.Parent(report, typeof(Experiment)) as Experiment; Zone paddock = Apsim.Parent(report, typeof(Zone)) as Zone; // Only show data which is in scope of this report. // E.g. data from this zone and either experiment (if applicable) or simulation. if (paddock != null) { dataStorePresenter.ZoneFilter = paddock; } if (experiment != null) { dataStorePresenter.ExperimentFilter = experiment; } else if (simulation != null) { dataStorePresenter.SimulationFilter = simulation; } dataStorePresenter.Attach(dataStore, this.view.DataStoreView, explorerPresenter); this.view.TabIndex = this.report.ActiveTabIndex; }
public ReportPresenter(IReportView view) { _business = new ReportBusiness(Singleton <PosEngine> .Instance.Resolve <IRepository <Order> >()); _businessProduct = new ProductBusiness(Singleton <PosEngine> .Instance.Resolve <IRepository <Product> >()); _businessCustomer = new CustomerBusiness(Singleton <PosEngine> .Instance.Resolve <IRepository <Customer> >()); _view = view; _model = new ReportModel(); _view.InitView(_model); }
public ReportPresenter(IUnityContainer container, IReportView view) { View = view; this.container = container; this.service = new WMSServiceClient(); View.Model = this.container.Resolve <ReportModel>(); //Event Delegate LoadUrlReport(); }
public ReportPresenter(IUnityContainer container, IReportView view) { View = view; this.container = container; this.service = new WMSServiceClient(); View.Model = this.container.Resolve<ReportModel>(); //Event Delegate LoadUrlReport(); }
public void Initialize <T>(IConstituencyModel model, T view) { _view = (IReportView)view; _model = model; _view.ConstituencyFilterChanged += ConstituencyFilterChanged; IEnumerable <Contracts.Constituency> constituencies = _model.GetConstituencies(); _view.InitializeConstituencyFilter(constituencies); ConstituencyFilterChanged(null, null); }
/// <summary> /// Attach the model (report) and the view (IReportView) /// </summary> /// <param name="model">The report model object</param> /// <param name="view">The view object</param> /// <param name="explorerPresenter">The explorer presenter</param> public void Attach(object model, object view, ExplorerPresenter explorerPresenter) { this.report = model as Report; this.explorerPresenter = explorerPresenter; this.view = view as IReportView; this.intellisense = new IntellisensePresenter(view as ViewBase); intellisense.ItemSelected += OnIntellisenseItemSelected; this.view.VariableList.ScriptMode = false; this.view.EventList.ScriptMode = false; this.view.VariableList.Lines = report.VariableNames; this.view.EventList.Lines = report.EventNames; this.view.VariableList.ContextItemsNeeded += OnNeedVariableNames; this.view.EventList.ContextItemsNeeded += OnNeedEventNames; this.view.VariableList.TextHasChangedByUser += OnVariableNamesChanged; this.view.EventList.TextHasChangedByUser += OnEventNamesChanged; this.explorerPresenter.CommandHistory.ModelChanged += OnModelChanged; Simulations simulations = Apsim.Parent(report, typeof(Simulations)) as Simulations; if (simulations != null) { dataStore = Apsim.Child(simulations, typeof(IStorageReader)) as IStorageReader; } //// TBI this.view.VariableList.SetSyntaxHighlighter("Report"); dataStorePresenter = new DataStorePresenter(); Simulation simulation = Apsim.Parent(report, typeof(Simulation)) as Simulation; if (simulation != null) { if (simulation.Parent is Experiment) { dataStorePresenter.ExperimentFilter = simulation.Parent as Experiment; } else { dataStorePresenter.SimulationFilter = simulation; } } dataStorePresenter.Attach(dataStore, this.view.DataStoreView, explorerPresenter); this.view.DataStoreView.TableList.SelectedValue = this.report.Name; this.view.TabIndex = this.report.ActiveTabIndex; }
public ReportViewModel(IReportView view) { View = view; View.ViewModel = this; PrintHWReportCommand = new CommandHandler <object, object>(PrintHWReportCommandAction); PrintRunningHWCommand = new CommandHandler <object, object>(PrintRunningHWCommandAction); PrintInactiveHWCommand = new CommandHandler <object, object>(PrintInactiveHWCommandAction); PrintRepairHWCommand = new CommandHandler <object, object>(PrintRepairHWCommandAction); PrintUserReportCommand = new CommandHandler <object, object>(PrintUserReportCommandAction); SearchByUserCommand = new CommandHandler <object, object>(SearchByUserCommandAction); _userCollection = new OptimizedObservableCollection <User>(); _allHardwares = new OptimizedObservableCollection <Hardware>(); _hardwareCollection = new OptimizedObservableCollection <HardwareCountReport>(); _activeHardwareCollection = new OptimizedObservableCollection <HardwareReport>(); _inActiveHardwareCollection = new OptimizedObservableCollection <HardwareReport>(); _inRepairHardwareCollection = new OptimizedObservableCollection <HardwareReport>(); _userReportCollection = new OptimizedObservableCollection <HardwareReport>(); }
/// <summary>Attach the model (report) and the view (IReportView)</summary> public void Attach(object Model, object View, ExplorerPresenter explorerPresenter) { this.report = Model as Report; this.explorerPresenter = explorerPresenter; this.view = View as IReportView; this.view.VariableList.Lines = report.VariableNames; this.view.EventList.Lines = report.EventNames; this.view.VariableList.ContextItemsNeeded += OnNeedVariableNames; this.view.EventList.ContextItemsNeeded += OnNeedEventNames; this.view.VariableList.TextHasChangedByUser += OnVariableNamesChanged; this.view.EventList.TextHasChangedByUser += OnEventNamesChanged; this.explorerPresenter.CommandHistory.ModelChanged += OnModelChanged; Simulations simulations = Apsim.Parent(report, typeof(Simulations)) as Simulations; if (simulations != null) { dataStore = Apsim.Child(simulations, typeof(IStorageReader)) as IStorageReader; } this.view.VariableList.SetSyntaxHighlighter("Report"); dataStorePresenter = new DataStorePresenter(); dataStorePresenter.Attach(dataStore, this.view.DataStoreView, explorerPresenter); this.view.DataStoreView.TableList.SelectedValue = this.report.Name; Simulation simulation = Apsim.Parent(report, typeof(Simulation)) as Simulation; if (simulation != null) { if (simulation.Parent is Experiment) { dataStorePresenter.ExperimentFilter = simulation.Parent as Experiment; } else { dataStorePresenter.SimulationFilter = simulation; } dataStorePresenter.PopulateGrid(); } }
/// <summary> /// Attach the model (report) and the view (IReportView) /// </summary> public void Attach(object Model, object View, ExplorerPresenter explorerPresenter) { this.Report = Model as Report; this.ExplorerPresenter = explorerPresenter; this.View = View as IReportView; this.View.VariableList.Lines = Report.VariableNames; this.View.EventList.Lines = Report.EventNames; this.View.VariableList.ContextItemsNeeded += OnNeedVariableNames; this.View.EventList.ContextItemsNeeded += OnNeedEventNames; this.View.VariableList.TextHasChangedByUser += OnVariableNamesChanged; this.View.EventList.TextHasChangedByUser += OnEventNamesChanged; ExplorerPresenter.CommandHistory.ModelChanged += CommandHistory_ModelChanged; Simulation simulation = Apsim.Parent(Report, typeof(Simulation)) as Simulation; DataStore = new DataStore(Report); this.View.VariableList.SetSyntaxHighlighter("Report"); PopulateDataGrid(); this.View.DataGrid.ResizeControls(); }
/// <summary> /// Attach the model (report) and the view (IReportView) /// </summary> public void Attach(object Model, object View, ExplorerPresenter explorerPresenter) { this.Report = Model as Report; this.ExplorerPresenter = explorerPresenter; this.View = View as IReportView; this.View.VariableList.Lines = Report.VariableNames; this.View.EventList.Lines = Report.EventNames; this.View.VariableList.ContextItemsNeeded += OnNeedVariableNames; this.View.EventList.ContextItemsNeeded += OnNeedEventNames; this.View.VariableList.TextHasChangedByUser += OnVariableNamesChanged; this.View.EventList.TextHasChangedByUser += OnEventNamesChanged; ExplorerPresenter.CommandHistory.ModelChanged += CommandHistory_ModelChanged; Simulation simulation = Apsim.Parent(Report, typeof(Simulation)) as Simulation; DataStore = new DataStore(Report); this.View.VariableList.SetSyntaxHighlighter("Report"); PopulateDataGrid(); }
public void add(IReportView repView, HttpContext context) { iView = repView; tipollamada = context.Request.HttpMethod.ToUpper(); accion = context.Request.QueryString["."] == null ? string.Empty : context.Request.QueryString["."].ToString(); if (tipollamada == "GET") { accion = context.Request.QueryString["."].ToString(); } else if (accion == string.Empty) { context.Request.InputStream.Position = 0; var jsonString = String.Empty; using (var inputStream = new StreamReader(context.Request.InputStream)) { jsonString = inputStream.ReadToEnd(); } JavaScriptSerializer deserializer = new JavaScriptSerializer(); Dictionary <String, Object> contenido = deserializer.Deserialize <Dictionary <String, Object> >(jsonString); accion = contenido["iddrequest"].ToString(); } }
public void Render(IReportView view) { }
public override void Render(IReportView view) { var v = view as ICanRenderAllErrorsReport; v?.Render(this); }
public abstract void Render(IReportView view);
public ReportPresenter(IReportView view, IRepository repository) { _view = view; _repository = repository; }
public ReportViewModel(IReportView view) { View = view; View.ViewModel = this; PrintHWReportCommand = new CommandHandler<object, object>(PrintHWReportCommandAction); PrintRunningHWCommand = new CommandHandler<object, object>(PrintRunningHWCommandAction); PrintInactiveHWCommand = new CommandHandler<object, object>(PrintInactiveHWCommandAction); PrintRepairHWCommand = new CommandHandler<object, object>(PrintRepairHWCommandAction); PrintUserReportCommand = new CommandHandler<object, object>(PrintUserReportCommandAction); SearchByUserCommand = new CommandHandler<object, object>(SearchByUserCommandAction); _userCollection = new OptimizedObservableCollection<User>(); _allHardwares = new OptimizedObservableCollection<Hardware>(); _hardwareCollection = new OptimizedObservableCollection<HardwareCountReport>(); _activeHardwareCollection = new OptimizedObservableCollection<HardwareReport>(); _inActiveHardwareCollection = new OptimizedObservableCollection<HardwareReport>(); _inRepairHardwareCollection = new OptimizedObservableCollection<HardwareReport>(); _userReportCollection = new OptimizedObservableCollection<HardwareReport>(); }
public Dictionary <string, object> Process(ProcessInfo pi, Ctx ctx, out byte[] report, out string reportFilePath) { reportFilePath = null; _ctx = ctx; _pi = pi; report = null; MPInstance instance = null; if (_pi.GetAD_PInstance_ID() < 1) { try { instance = new MPInstance(ctx, _pi.GetAD_Process_ID(), _pi.GetRecord_ID()); } catch (Exception e) { _pi.SetSummary(e.Message); _pi.SetError(true); return(_pi.ToList()); } if (!instance.Save()) { _pi.SetSummary(Msg.GetMsg(ctx, "ProcessNoInstance", true)); _pi.SetError(true); return(_pi.ToList()); } _pi.SetAD_PInstance_ID(instance.Get_ID()); } String procedureName = ""; int AD_ReportView_ID = 0; int AD_ReportFormat_ID = 0; int AD_Workflow_ID = 0; bool IsReport = false; bool IsDirectPrint = false; bool IsCrystalReport = false; String sql = "SELECT p.Name, p.procedureName,p.Classname, p.AD_Process_ID," // 1..4 + " p.IsReport,p.IsDirectPrint,p.AD_ReportView_ID,p.AD_Workflow_ID," // 5..8 + " CASE WHEN COALESCE(p.Statistic_Count,0)=0 THEN 0 ELSE p.Statistic_Seconds/p.Statistic_Count END," //9 + " p.IsServerProcess, " //10 + " p.IsCrystalReport, " // crystal 11...12 + " p.AD_ReportFormat_ID " //12 + " FROM AD_Process p" + " INNER JOIN AD_PInstance i ON (p.AD_Process_ID=i.AD_Process_ID) " + " WHERE p.IsActive='Y'" + " AND i.AD_PInstance_ID=@pinstanceid"; IDataReader dr = null; try { SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@pinstanceid", _pi.GetAD_PInstance_ID()); dr = SqlExec.ExecuteQuery.ExecuteReader(sql, param); while (dr.Read()) { _pi.SetTitle(dr[0].ToString()); //if (m_waiting != null) // m_waiting.setTitle(_pi.getTitle()); procedureName = dr[1].ToString(); _pi.SetClassName(dr[2].ToString()); _pi.SetAD_Process_ID(Utility.Util.GetValueOfInt(dr[3].ToString())); // Report if ("Y".Equals(dr[4].ToString())) { IsReport = true; IsCrystalReport = "Y".Equals(dr[10].ToString()); AD_ReportFormat_ID = dr[11].ToString() == "" ? 0 : Utility.Util.GetValueOfInt(dr[11].ToString()); //later } AD_ReportView_ID = dr[6].ToString() == "" ? 0 : Utility.Util.GetValueOfInt(dr[6].ToString()); AD_Workflow_ID = dr[7].ToString() == "" ? 0 : Utility.Util.GetValueOfInt(dr[7].ToString()); // //_IsServerProcess = "Y".Equals(dr[9].ToString()); } dr.Close(); } catch (Exception ex) { if (dr != null) { dr.Close(); } _pi.SetSummary(Msg.GetMsg(ctx, "ProcessNoProcedure") + " " + ex.Message, true); Unlock(); } if (procedureName == null) { procedureName = ""; } if (AD_Workflow_ID > 0) { StartWorkflow(AD_Workflow_ID); //Updated by raghu to open reports from work flow byte[] repByt = null; re = ReportCtl.Report; if (re != null) { int reportTable_ID = 0; if (re is IReportView) { IReportView irv = re as IReportView; reportTable_ID = irv.GetPrintFormat().GetAD_Table_ID(); irv.GetView(); _pi.Set_AD_PrintFormat_Table_ID(irv.GetPrintFormat().GetAD_Table_ID()); } _pi.SetSummary("Report", re != null); Unlock(); if (re != null) { reportFilePath = re.GetReportFilePath(true, out repByt); } } else { repByt = null; } report = repByt; return(_pi.ToList()); } if (_pi.GetClassName() != null) { if (!StartProcess()) { report = null; return(_pi.ToList()); } if (!IsReport && procedureName.Length == 0) { report = null; return(_pi.ToList()); } } report = null; if (IsReport) { if (procedureName.Length > 0) { if (!StartDBProcess(procedureName)) { } } if (AD_ReportFormat_ID > 0) // For Report Formats { _pi.SetIsReportFormat(true); int totalRecords = 0; re = VAdvantage.ReportFormat.ReportFormatEngine.Get(_ctx, _pi, out totalRecords, IsArabicReportFromOutside); Unlock(); _pi.SetSummary("Report", re != null); _pi.SetTotalRecords(totalRecords); if (re != null) { //isRCReport = true; if (GetIsPrintCsv()) { string s = ""; reportFilePath = re.GetCsvReportFilePath(s); } else { report = re.GetReportBytes(); reportFilePath = re.GetReportFilePath(true, out report); } ReportString = re.GetReportString(); } } else if (!IsCrystalReport) { //start report code // Start Report ----------------------------------------------- re = ReportCtl.Start(_ctx, _pi, IsDirectPrint); ReportEngine_N _rep = (ReportEngine_N)re; //null check Implemented by raghu 22-May-2015 if (_rep != null) { reportTable_ID = _rep.GetPrintFormat().GetAD_Table_ID(); _rep.GetView(); _pi.Set_AD_PrintFormat_Table_ID(_rep.GetPrintFormat().GetAD_Table_ID()); _pi.Set_AD_PrintFormat_ID(_rep.GetPrintFormat().GetAD_PrintFormat_ID()); _pi.SetSummary("Report", re != null); Unlock(); if (GetIsPrintFormat() && re != null && !GetIsPrintCsv()) { reportFilePath = re.GetReportFilePath(true, out report); } else if (GetIsPrintCsv() && re != null) { report = _rep.CreateCSV(_ctx); string filePath = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "TempDownload"; if (!Directory.Exists(filePath)) { Directory.CreateDirectory(filePath); } filePath = filePath + "\\temp_" + CommonFunctions.CurrentTimeMillis() + ".csv"; File.WriteAllBytes(filePath, report); reportFilePath = filePath.Substring(filePath.IndexOf("TempDownload")); } else { rptHtml = _rep.GetRptHtml().ToString(); } report = _rep.CreatePDF(); } } else { _pi.SetIsCrystal(true); string errorMsg = null; CrystalReportEngine en = null; try { en = new CrystalReportEngine(_ctx, _pi); reportFilePath = en.GetReportFilePath(true, out report);// .GenerateCrystalReport(); } catch (Exception err) { errorMsg = err.Message; } _pi.SetSummary(errorMsg ?? "Done", errorMsg != null); } } else { if (!StartDBProcess(procedureName)) { _pi.SetSummary("procedure ERROR"); return(_pi.ToList()); } ProcessInfoUtil.SetSummaryFromDB(_pi); } return(_pi.ToList()); }
public override void Render(IReportView view) { }
public ReportService(IReportView reportView) { this._reportView = reportView; _db = new ReportRepo(this); }
public override void Render(IReportView view) { var v = view as ICanRenderEventSequenceReport; v?.Render(this); }