public ActionResult Report(EnumReport rpt, ReportParamViewModel viewModel, FormCollection formCollection) { ReportDataSource[] repCol = new ReportDataSource[1]; switch (rpt) { case EnumReport.RptDetailSales: repCol[0] = GetSalesDet(viewModel.DateFrom.Value, viewModel.DateTo.Value, viewModel.AgentId, viewModel.GameId); break; case EnumReport.RptRecapSalesByAgent: repCol[0] = GetSalesDet(viewModel.DateFrom.Value, viewModel.DateTo.Value, viewModel.AgentId, viewModel.GameId); break; case EnumReport.RptRecapSalesByGame: repCol[0] = GetSalesDet(viewModel.DateFrom.Value, viewModel.DateTo.Value, viewModel.AgentId, viewModel.GameId); break; case EnumReport.RptRecapWinSales: repCol[0] = GetSalesDet(viewModel.DateFrom.Value, viewModel.DateTo.Value, viewModel.AgentId, viewModel.GameId, EnumSalesDetStatus.Win.ToString()); break; } Session["ReportData"] = repCol; var e = new { Success = true, Message = "redirect", UrlReport = string.Format("{0}", rpt.ToString()) }; return(Json(e, JsonRequestBehavior.AllowGet)); }
static void Main(string[] args) { CallBackPtr callBackPtr = new CallBackPtr(EnumReport.Report); EnumReport.EnumWindows(callBackPtr, 0); EnumReport.PrintDict(); }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Process pr = RI(); if (pr != null) { pid = pr.Id; CallBackPtr callBackPtr = new CallBackPtr(EnumReport.Report); EnumReport.EnumWindows(callBackPtr, 0); if (win.Count != 0) { DisplayWindow(win[0]); } else if (UnvWin.Count != 0) { //MessageBox.Show("Пожалуйста, подождите...", "Енот"); foreach (IntPtr item in UnvWin) { if (GetWindowText(item).Contains(Process.GetCurrentProcess().ProcessName)) { DisplayWindow(item); } } } } else { Application.Run(new MainForm(args)); } }
static void Main() { do { Console.Clear(); CallBackPtr callBackPtr = new CallBackPtr(EnumReport.Show); EnumReport.EnumWindows(callBackPtr, 0); Console.WriteLine("\n\nPress Enter to refresh results or any button to exit"); } while (Console.ReadKey(false).Key == ConsoleKey.Enter); }
public void Perform() { Process[] myProcesses; myProcesses = Process.GetProcesses(); MyFormPoster = new FormPoster(); MyConsoleLogger = new ConsoleLogger(); MyNTEventLogLogger = new NTEventLogLogger(); myDiscovery = new ToolSpecificEvent(); myDiscovery.ActionEvent += new ToolSpecificEventHandler(MyConsoleLogger.handler); myDiscovery.ActionEvent += new ToolSpecificEventHandler(MyNTEventLogLogger.handler); myDiscovery.ActionEvent += new ToolSpecificEventHandler(MyFormPoster.handler); configuration_from_xml = new ConfigRead(); configuration_from_xml.LoadConfiguration("Configuration/ProcessDetection/Process", "ProcessName"); string process_detector_expression = configuration_from_xml.DetectorExpression; Regex process_detector_regex = new Regex(process_detector_expression, RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase); foreach (Process myProcess in myProcesses) { string res = String.Empty; string sProbe = myProcess.ProcessName; // myProcess.StartInfo.FileName - not accessible if (Debug) { Console.WriteLine("Process scan: {0}", process_detector_expression); } MatchCollection m = process_detector_regex.Matches(sProbe); if (sProbe != null && m.Count != 0) { try { DialogDetected = true; process_command_line = new ProcessCommandLine(myProcess.Id.ToString()); if (Debug) { Console.WriteLine("{0}{1}", myProcess.Id.ToString(), process_command_line.CommandLine); } CommandLine = process_command_line.CommandLine; // CommandLine = myProcess.ProcessName; Console.WriteLine("--> {0} {1} {2} {3}", sProbe, myProcess.ProcessName, myProcess.Id, DateTime.Now - myProcess.StartTime); } catch (Win32Exception e) { System.Diagnostics.Trace.Assert(e != null); } } } CallBackPtr callBackPtr = new CallBackPtr(EnumReport.Report); if (DialogDetected) { EnumReport.evt = myDiscovery; EnumReport.CommandLine = CommandLine; EnumReport.EnumWindows(callBackPtr, 0); } }
//──────────────────────────────────────── /// <summary> /// コンストラクター。 /// </summary> public Log_RecordReportsImpl(Log_Reports parent_Log_Logging) { this.Owner = parent_Log_Logging; this.errorSymbol = ""; this.fullnameMethod = ""; this.p1pText = new Builder_TexttemplateP1pImpl(); this.sConfigStack = ""; this.sGroupTag = ""; this.enumReport = EnumReport.Error; }
public ActionResult Report(EnumReport rpt) { ReportParamViewModel viewModel = ReportParamViewModel.Create(_mAgentRepository, _mGameRepository); string title = string.Empty; switch (rpt) { case EnumReport.RptDetailSales: title = "Lap. Detail Penjualan"; viewModel.ShowDateFrom = true; viewModel.ShowDateTo = true; viewModel.ShowAgent = true; break; case EnumReport.RptRecapSalesByAgent: title = "Lap. Rekap Penjualan"; viewModel.ShowDateFrom = true; viewModel.ShowDateTo = true; viewModel.ShowAgent = true; viewModel.ShowGame = true; break; case EnumReport.RptRecapSalesByGame: title = "Lap. Rekap Penjualan Per Game"; viewModel.ShowDateFrom = true; viewModel.ShowDateTo = true; viewModel.ShowAgent = true; viewModel.ShowGame = true; break; case EnumReport.RptRecapWinSales: title = "Lap. Rekap Penjualan Yg Menang"; viewModel.ShowDateFrom = true; viewModel.ShowDateTo = true; viewModel.ShowAgent = true; viewModel.ShowGame = true; break; } ViewData["CurrentItem"] = title; return(View(viewModel)); }
//──────────────────────────────────────── /// <summary> /// デバッグ報告開始。 /// </summary> /// <param name="d_EnumReport"></param> /// <returns>新しいレポート。</returns> public Log_RecordReports BeginCreateReport(EnumReport enumReport) { this.bNotInfiniteLoop = false; Log_RecordReportsImpl r; r = new Log_RecordReportsImpl(this); r.EnumReport = enumReport; // ダミーレポートでない場合、レポートを記録します。 if (EnumReport.Dammy != enumReport) { r.ToText_Pathbreadcrumbs(this.Log_Callstack); this.Add(r); } return(r); }
public static void Send(List <Report> reports, XmlNode notificationConfigurationElement, EnumReport report) { try { string isSmsEnabled = notificationConfigurationElement.SelectSingleNode("//SMS").Attributes["Enabled"].Value; if (string.IsNullOrEmpty(isSmsEnabled)) { Log.WriteLine("SMS Enabled attribute in NotificationConfig is null or empty"); } else { int sendSms = 0; if (!int.TryParse(isSmsEnabled, out sendSms)) { Log.WriteLine("SMS Enabled attribute in NotificationConfig is NAN"); } else { if (!((sendSms == 0) || (sendSms == 1))) { Log.WriteLine("SMS Enabled attribute in NotificationConfig is not '1' or '0'"); } else { if (sendSms == 0) { Log.WriteLine("SMS Enabled attribute in NotificationConfig is off"); } else { string msgText = report.ToString() + " " + Environment.NewLine; foreach (var r in reports) { msgText += r.Remarks + Environment.NewLine; } msgText += "Report End"; string gatewayUrl = notificationConfigurationElement.SelectSingleNode("//SMS/SMSGatewayUrl").InnerText; string apiKey = notificationConfigurationElement.SelectSingleNode("//SMS/APIKey").InnerText; using (var client = new HttpClient()) { client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); var recipients = notificationConfigurationElement.SelectSingleNode("//SMS/Recipients").ChildNodes; foreach (XmlNode item in recipients) { var mobile = item.InnerText.Length == 10 ? item.InnerText : 0 + item.InnerText; string uriDialog = gatewayUrl + "destination=" + mobile + "&q=" + apiKey + "&message=" + System.Uri.EscapeDataString(msgText); HttpResponseMessage response = client.GetAsync(uriDialog.ToString()).Result; string SendingStatus = ""; if (response.IsSuccessStatusCode) { using (HttpContent content = response.Content) { SendingStatus = ((content.ReadAsStringAsync().Result == "0") ? "SENT" : "SENDING FAILED - " + content.ReadAsStringAsync().Result); Log.WriteLine("Report " + SendingStatus + " to " + mobile); } } else { Log.WriteLine("Report " + SendingStatus + " to " + mobile); } } } } } } } } catch (Exception ex) { Log.WriteLine("Exception in SMS Sending"); Log.WriteLine(ex.Message); throw ex; } Log.WriteLine("SMS sent successfully"); }
//──────────────────────────────────────── /// <summary> /// デバッグ報告開始。 /// </summary> /// <param name="d_EnumReport"></param> /// <returns>新しいレポート。</returns> public Log_RecordReports BeginCreateReport(EnumReport enumReport) { this.bNotInfiniteLoop = false; Log_RecordReportsImpl r; r = new Log_RecordReportsImpl(this); r.EnumReport = enumReport; // ダミーレポートでない場合、レポートを記録します。 if (EnumReport.Dammy != enumReport) { r.ToText_Pathbreadcrumbs(this.Log_Callstack); this.Add(r); } return r; }