public async Task <DataReport> GetReportsAsync(DateTime fromDate, DateTime toDate) { using (var sql = new SqlConnection(_config.GetConnectionString("DefaultConnection"))) { await sql.OpenAsync(); var dynamicParameters = new DynamicParameters(); var now = DateTime.Now; var firstDayOfMonth = new DateTime(now.Year, now.Month, 1); var lastDayOfMonth = firstDayOfMonth.AddMonths(1).AddDays(-1); dynamicParameters.Add("@fromDate", fromDate == default(DateTime) ? firstDayOfMonth.ToString("MM/dd/yyyy") : fromDate.ToString("MM/dd/yyyy")); dynamicParameters.Add("@toDate", fromDate == default(DateTime) ? lastDayOfMonth.ToString("MM/dd/yyyy") : toDate.ToString("MM/dd/yyyy")); try { var data = new DataReport(); data.Finance = await sql.QueryAsync <RevenueReportViewModel> ("GetRevenueDaily", dynamicParameters, commandType : System.Data.CommandType.StoredProcedure); data.Session = await sql.QueryAsync <SessionViewModel>("SumSessionPerDay", dynamicParameters, commandType : System.Data.CommandType.StoredProcedure); return(data); } catch (Exception ex) { throw; } } }
private void simpleButtonAccept_Click(object sender, EventArgs e) { Config.NewKeyValue("Operation", "Xem báo cáo"); Config.NewKeyValue("MenuName", this.Text); _bindingSource.EndEdit(); DataRowView drv = (_bindingSource.Current as DataRowView); DataReport __data = new DataReport((_data as DataReport).DrTable); __data.GetData(); __data.DsData = _data.DsData; __data.reConfig = new ReConfig(); __data.reConfig.Variables = (_data as DataReport).reConfig.Copy(); if (drv != null) { __data.DrCurrentMaster = drv.Row; } __data.CheckRules(DataAction.IUD); if (dxErrorProviderMain.HasErrors) { XtraMessageBox.Show("Chưa nhập đủ thông tin yêu cầu, vui lòng kiểm tra lại!"); return; } (__data as DataReport).SaveVariables(); (__data as DataReport).GenFilterString(); ReportPreview rptPre = new ReportPreview(__data); rptPre.MdiParent = this.MdiParent; rptPre.Show(); }
private void GetCongno_Click(object sender, EventArgs e) { try { if (MaKH == null) { return; } CDTData _data = DataFactory.DataFactory.Create(DataType.Report, "1453"); _data.GetData(); bsCongno.DataSource = _data.DsData.Tables[0]; bsCongno.AddNew(); bsCongno.EndEdit(); (bsCongno.Current as DataRowView)["NgayCT1"] = Tungay; (bsCongno.Current as DataRowView)["NgayCT2"] = Denngay; (bsCongno.Current as DataRowView)["TK"] = "131"; (bsCongno.Current as DataRowView)["MaKH"] = MaKH; DataReport __data = new DataReport((_data as DataReport).DrTable); __data.GetData(); __data.DsData = _data.DsData; __data.reConfig = new ReConfig(); __data.reConfig.Variables = (_data as DataReport).reConfig.Copy(); __data.DrCurrentMaster = (bsCongno.Current as DataRowView).Row; (__data as DataReport).SaveVariables(); (__data as DataReport).GenFilterString(); FormFactory.ReportPreview rptPre = new FormFactory.ReportPreview(__data); rptPre.Dock = DockStyle.Fill; pCongno.Controls.Clear();// rptPre.Visible = true; pCongno.Controls.Add(rptPre); } catch (Exception ex) { } }
static void Main(string[] args) { if (args.Length != 2) { Console.WriteLine(" Crime Analyzer"); Console.WriteLine("CrimeAnalyzer <crime_csv_file_path> <report_file_path>"); Environment.Exit(1); string csvDataFilePath = args[0]; string reportFilePath = args[1]; List <Data> crimeStatsList = null; try { crimeStatsList = CrimeStatsLoader.Load(csvDataFilePath); } catch (Exception e) { Console.WriteLine(e.Message); Environment.Exit(2); } var report = DataReport.GenerateText(crimeStatsList); try { System.IO.File.WriteAllText(reportFilePath, report); } catch (Exception e) { Console.WriteLine(e.Message); } } }
public ActionResult UploadReport(int?DataReportID) { DataReport dr = db.DataReports.Find(DataReportID); ViewBag.AssayNo = dr.AssayID; ViewBag.DataReportID = dr.DataReportID; return(View()); }
public override global::System.Data.DataSet Clone() { DataReport cln = ((DataReport)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public DataReport AddReport(DataReport report) { if (m_currentReports == null) { m_currentReports = new List <DataReport>(); } m_currentReports.Add(report); return(report); }
/// <summary> /// 在主线程中运行的流程测试完成事件响应函数 /// </summary> private void FlowCompleteHandler() { StopFlowTimer(); FlowControl.Instance.FlowStatus = FlowControl.FLOW_STATUS_COMPLETE; if (FlowControl.Instance.FlowResult == FlowControl.FLOW_RESULT_INIT) { bool pass = true; foreach (FlowItem flowItem in FlowControl.Instance.FlowItemList) { if (!flowItem.Item.Property.Disable && !flowItem.IsAuxiliaryItem() && !flowItem.IsPass()) { pass = false; break; } } FlowControl.Instance.FlowResult = pass ? FlowControl.FLOW_RESULT_PASS : FlowControl.FLOW_RESULT_FAIL; } else if (FlowControl.Instance.FlowResult == FlowControl.FLOW_RESULT_EXCEPTION) { //复位设备 string resp; EquipmentCmd.Instance.SendCommand(CommonString.CMD_RESET, String.Empty, out resp); } ShowResult(); if (FlowControl.Instance.FlowResult == FlowControl.FLOW_RESULT_FAIL) { Statistic.Instance.IncreaseFailNum(); } Statistic.Instance.IncreaseTotalNum(); UpdateStatisticInfo(); Statistic.Instance.Save(); if (FlowControl.Instance.FlowCompleteReason != FlowControl.FLOW_COMPLETE_STOP) { ResultRecord.Record(AppInfo.PhoneInfo.SN); if (0 == NetUtil.GetStationIndex()) { CompleteHandler(0); } else { LiteDataClient.Instance.SendCompleteFlag(NetUtil.GetStationIndex()); } } TimeLog.Save(); DataReport.Save(); }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { DataReport ds = new DataReport(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }
private void simpleButtonTrace_Click(object sender, EventArgs e) { string sysTableID = _data.DrTable["sysTableID"].ToString(); string pk = _data.DrTable["Pk"].ToString(); string pkValue = gvMain.GetFocusedRowCellValue(pk).ToString(); string sysPackageID = Config.GetValue("sysPackageID").ToString(); DataReport data = new DataReport("83", true); data.PsString = "h.sysPackageID = " + sysPackageID + " and h.pkValue = '" + pkValue + "' and h.sysMenuID in (select sysMenuID from sysMenu where sysTableID = " + sysTableID + ")"; ReportFactory.ReportPreview rp = new ReportFactory.ReportPreview(data); rp.ShowDialog(); }
// // CONSTRUCTOR // public TabbedDocumentDataReport() { InitializeComponent(); // this._dataReport = new DataReport(); this._dataReport.Invalidated += new EventHandler <EventArgs>(this.Report_Invalidated); // this.TabImage = Resources.BITMAP_DATA_REPORT; this.Text = "Data Report"; }
public Dashboard(DataRow drReport) { _drReport = drReport; _data = new DataReport(drReport); if (_data.DsData == null) { _data.GetData(); } if (_data.DsData.Tables[0].Rows.Count == 0) { _data.DsData.Tables[0].Rows.Add(_data.DsData.Tables[0].NewRow()); } _data.GenFilterString(); }
public ActionResult SendToReporting(int?AssayID) { ViewBag.AssayID = AssayID; Assay assay = db.Assays.Find(AssayID); assay.StatusID = 5; assay.NeedsReports = true; db.Entry(assay).State = EntityState.Modified; db.SaveChanges(); DataReport dr = new DataReport(); dr.AssayID = AssayID; db.DataReports.Add(dr); db.SaveChanges(); return(View()); }
private void button_Click(object sender, RoutedEventArgs e) { report.Reset(); ReportDataSource ds = new ReportDataSource("dataset", DataReport.UseMedicine(cbxMonth.SelectedValue.ToString(), cbxYear.SelectedValue.ToString())); report.LocalReport.DataSources.Add(ds); report.LocalReport.ReportEmbeddedResource = "QLPhongKhamTuNhan.GUI.UIReport.reportUseMedicine.rdlc"; ReportParameter rp = new ReportParameter("txtMonth", "Tháng: " + cbxMonth.SelectedValue + " năm " + cbxYear.SelectedValue); report.LocalReport.SetParameters(new ReportParameter[] { rp }); report.RefreshReport(); }
public ActionResult UploadReport(HttpPostedFileBase UploadedFile, FormCollection form) { // parse incoming form int DataReportID = Int32.Parse(form["DataReportID"]); DataReport postBackDR = db.DataReports.Find(DataReportID); ViewBag.AssayNo = postBackDR.AssayID; if (UploadedFile != null) { if (UploadedFile.ContentLength > 0) { if (Path.GetExtension(UploadedFile.FileName) == ".pdf") { DataReport dr = db.DataReports.Find(DataReportID); int? AssayNumber = dr.AssayID; string fileName = "DataReport_Assay" + AssayNumber + "-" + DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss-ffff") + ".pdf"; string folderPath = Path.Combine(Server.MapPath("~/UploadedFiles/DataReports"), fileName); // save path to server dr.DataReportPath = folderPath; db.Entry(dr).State = EntityState.Modified; db.SaveChanges(); UploadedFile.SaveAs(folderPath); ViewBag.Message = "File Uploaded Successfully."; // done saving to folder return(RedirectToAction("FileUploadSuccess", "DataReports", new { AssayID = dr.AssayID })); } else { ViewBag.Message = "Extension not supported."; } } } else { ViewBag.Message = "File not selected."; } return(View(DataReportID)); }
/// <summary> /// Data processing /// </summary> private void DataHandling() { while (_runingEvent.WaitOne(1)) { try { if (_quReceiveBuff.Count == 0) { SpinWait.SpinUntil(() => _quReceiveBuff.Count > 0, 10); continue; } byte[] data = _dequeueFunc(_quReceiveBuff); if (data == null || data.Length == 0) { SpinWait.SpinUntil(() => false, 10); continue; } if (_reportPredicate(data)) { DataReport?.BeginInvoke(this, new DataReportEventArgs(data), null, null); //If the data is spontaneously reported by the serial port, the DataReport event is called } else { //If the command response returned by the serial port, join the command response queue if (_quCmdRespone.Count > 0) { _quCmdRespone.Clear(); //The queue is cleared to ensure that if a command timed out does not affect subsequent command results } _quCmdRespone.Enqueue(data); _cmdResponseReset.Set(); } } catch (Exception ex) { var errorDescription = $"An error occurred in the data processing: {ex.Message}"; this.DataHandleError?.BeginInvoke(this, new DataHandleErrorEventArgs(errorDescription, new Exception(errorDescription, ex)), null, null); } } }
void glReport_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { //throw new Exception("The method or operation is not implemented."); if (glReport.EditValue == null) { return; } //xem báo cáo int index = glReport.Properties.GetIndexByKeyValue(glReport.EditValue); DataRow drTable = _data._dtDtReport.Rows[index]; CDTData datareport = new DataReport(drTable); ReportFilter tmp = new ReportFilter(datareport); tmp.ShowDialog(); if (tmp.reportPreview != null) { XtraTabPage Tab1 = new XtraTabPage(); Tab1.Text = "BC_" + drTable["ReportName"].ToString(); Tab1.Controls.Add(tmp.reportPreview); tmp.reportPreview.Dock = DockStyle.Fill; _frmDesigner.TabDetail.TabPages.Add(Tab1); } }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); DataReport ds = new DataReport(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "BaoCaoDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }
public UnitTest1() { var 立项申请 = new DataReport(Guid.Parse("3C50B6B4-5F15-4F76-A63C-1C3505286F61"), "立项申请", "表单" , "立项申请预览视图", "立项申请主界面", DataReportStatus.UnCommit); var 项目开发通知书 = new DataReport(Guid.Parse("0824D4E9-2508-40EE-AE3D-B554DF8531AF"), "项目开发通知书", "表单" , "项目开发通知书预览视图", "项目开发通知书主界面", DataReportStatus.UnCommit); var 开发任务书 = new DataReport(Guid.Parse("B9EC8360-1A27-41C0-98FA-97AD4B9E11FA"), "开发任务书", "表单" , "开发任务书预览视图", "开发任务书主界面", DataReportStatus.UnCommit); var 草案设计 = new DataReport(Guid.Parse("DB3964BA-C8B0-420E-BA66-CD202D673EAF"), "草案设计", "表单" , "草案设计预览视图", "草案设计主界面", DataReportStatus.UnCommit); var 寿命模拟 = new DataReport(Guid.Parse("6205156A-082B-4B8E-B117-659DD052C275"), "寿命模拟", "表单" , "寿命模拟预览视图", "寿命模拟主界面", DataReportStatus.UnCommit); var 测试任务 = new DataReport(Guid.Parse("FDF72E38-903B-46DE-A7EA-A54A9E54E036"), "测试任务", "表单" , "测试任务预览视图", "测试任务主界面", DataReportStatus.UnCommit); var 外观确认报表 = new DataReport(Guid.Parse("45F89F96-84C5-4F4B-99C0-6E52D6DDD877"), "外观确认报表", "表单" , "外观确认报表预览视图", "外观确认报表主界面", DataReportStatus.UnCommit); var 光电参数报告 = new DataReport(Guid.Parse("136005C9-ECAF-4A35-9D75-9DCDA67DD7C4"), "光电参数报告", "表单" , "光电参数报告预览视图", "光电参数报告主界面", DataReportStatus.UnCommit); var T25温升测试报告 = new DataReport(Guid.Parse("019E4970-B7A2-4E8F-8EE0-009B1CA0B78B"), "T25温升测试报告", "表单" , "T25温升测试报告预览视图", "T25温升测试报告主界面", DataReportStatus.UnCommit); var TIS温度测试报告 = new DataReport(Guid.Parse("DBC04FF4-74EC-4425-9897-77F811819E8D"), "TIS温度测试报告", "表单" , "TIS温度测试报告预览视图", "TIS温度测试报告主界面", DataReportStatus.UnCommit); var H100稳态测试报告 = new DataReport(Guid.Parse("3835C5E2-5BFC-4FC9-8AEC-0CC2EC5B4193"), "H100稳态测试报告", "表单" , "H100稳态测试报告预览视图", "H100稳态测试报告主界面", DataReportStatus.UnCommit); var 样品破坏新能测试报告 = new DataReport(Guid.Parse("7DCB762F-A1D7-4AAD-BCFA-C41A89DED261"), "样品破坏新能测试报告", "表单" , "样品破坏新能测试报告预览视图", "样品破坏新能测试报告主界面", DataReportStatus.UnCommit); var T40W6光衰测试报告 = new DataReport(Guid.Parse("5D106D28-CDDC-4091-816B-67F356B2CF66"), "T40W6光衰测试报告", "表单" , "T40W6光衰测试报告预览视图", "T40W6光衰测试报告主界面", DataReportStatus.UnCommit); var T40W12光衰测试报告 = new DataReport(Guid.Parse("3EF548AF-AF6E-411E-A4C5-15ED6DDE1416"), "T40W12光衰测试报告", "表单" , "T40W12光衰测试报告预览视图", "T40W12光衰测试报告主界面", DataReportStatus.UnCommit); var 商品命名 = new DataReport(Guid.Parse("541332A9-6C2E-46C6-AA61-B899FF95BCC2"), "商品命名", "表单" , "商品命名预览视图", "商品命名主界面", DataReportStatus.UnCommit); var 物料清单编制 = new DataReport(Guid.Parse("2A90394C-E1D6-4177-B196-DB88671F131A"), "物料清单编制", "表单" , "物料清单编制预览视图", "物料清单编制主界面", DataReportStatus.UnCommit); var 零部件图片上传 = new DataReport(Guid.Parse("B3BD4021-738A-45E2-A910-B6248AF174DF"), "零部件图片上传", "表单" , "零部件图片上传预览视图", "零部件图片上传主界面", DataReportStatus.UnCommit); var 来料及成品检验上传 = new DataReport(Guid.Parse("BF5D0D23-D2E2-4BA9-B251-8F067F4193EB"), "来料及成品检验上传", "表单" , "来料及成品检验上传预览视图", "来料及成品检验上传主界面", DataReportStatus.UnCommit); var 销售资料上传 = new DataReport(Guid.Parse("9030CC6A-DE11-4994-9F69-9E039CA7FBFB"), "销售资料上传", "表单" , "销售资料上传预览视图", "销售资料上传主界面", DataReportStatus.UnCommit); var 产品规格书 = new DataReport(Guid.Parse("113901D3-AFF4-430F-A1A3-F5C40515FA24"), "产品规格书", "表单" , "产品规格书预览视图", "产品规格书主界面", DataReportStatus.UnCommit); dataReports.AddRange(new DataReport[] { 立项申请, 项目开发通知书, 开发任务书, 草案设计, 寿命模拟, 测试任务, 外观确认报表, 光电参数报告, T25温升测试报告, TIS温度测试报告, H100稳态测试报告, 样品破坏新能测试报告, T40W6光衰测试报告, T40W12光衰测试报告, 商品命名, 物料清单编制, 零部件图片上传, 来料及成品检验上传, 销售资料上传, 产品规格书, }); var 项目可行性论证报告 = new ReviewReport(Guid.Parse("EC3F742D-AFA6-420C-9180-2785BA0A823A"), "项目可行性论证报告", "评审" , "项目可行性论证报告预览视图", "项目可行性论证报告主界面", DataReportType.Serial, ReviewReportStatus.Pending, false, dataReports.Where(p => p.Name.Equals("立项申请")).ToList()); var 技术方案论证报告 = new ReviewReport(Guid.Parse("90EC9D9C-7C70-4650-87B3-5A6319A56452"), "技术方案论证报告", "评审" , "技术方案论证报告预览视图", "技术方案论证报告主界面", DataReportType.Serial, ReviewReportStatus.Pending, false, dataReports.Where(p => p.Name.Equals("寿命模拟")).ToList()); var 产品性能及定性评审 = new ReviewReport(Guid.Parse("86B8FCD0-DA9E-41FD-AAA8-C8E9F16DE73A"), "产品性能及定性评审", "评审" , "产品性能及定性评审预览视图", "产品性能及定性评审主界面", DataReportType.Parallel, ReviewReportStatus.Pending, true, dataReports.Where(p => p.Name.Equals("外观确认报表") || p.Name.Equals("光电参数报告") || p.Name.Equals("T25温升测试报告") || p.Name.Equals("TIS温度测试报告")).ToList()); var 一阶段性能评审 = new ReviewReport(Guid.Parse("90EC9D9C-7C70-4650-87B3-5A6319A56452"), "一阶段性能评审", "评审" , "一阶段性能评审预览视图", "一阶段性能评审主界面", DataReportType.Parallel, ReviewReportStatus.Pending, false, dataReports.Where(p => p.Name.Equals("H100稳态测试报告") || p.Name.Equals("样品破坏新能测试报告")).ToList()); var 二阶段性能评审 = new ReviewReport(Guid.Parse("6DCE7736-70A2-4848-ACF7-388F2F49732C"), "二阶段性能评审", "评审" , "二阶段性能评审预览视图", "二阶段性能评审主界面", DataReportType.Parallel, ReviewReportStatus.Pending, false, dataReports.Where(p => p.Name.Equals("T40W6光衰测试报告")).ToList()); var 综合性能评审 = new ReviewReport(Guid.Parse("11C27E8F-C3B5-4F6F-8915-DF31C2AA13D7"), "综合性能评审", "评审" , "综合性能评审预览视图", "综合性能评审主界面", DataReportType.Parallel, ReviewReportStatus.Pending, false, dataReports.Where(p => p.Name.Equals("T40W12光衰测试报告")).ToList()); var 资料评审 = new ReviewReport(Guid.Parse("FAD8FA27-3F9B-4643-9B09-271B476296CE"), "资料评审", "评审" , "资料评审预览视图", "资料评审主界面", DataReportType.Parallel, ReviewReportStatus.Pending, false, dataReports.Where(p => p.Name.Equals("零部件图片上传") || p.Name.Equals("来料及成品检验上传") || p.Name.Equals("销售资料上传") || p.Name.Equals("产品规格书")) .ToList()); reviewReports.AddRange(new ReviewReport[] { 项目可行性论证报告, 技术方案论证报告, 产品性能及定性评审, 一阶段性能评审, 二阶段性能评审, 综合性能评审, 资料评审 }); var 决策 = new WorkFlow(Guid.Parse("5EAE9517-12AC-474D-81AB-401B78A24101") , "决策", Guid.Parse("0A9DEBFE-CFEF-43A5-9C21-E263BA682126") , new List <IWorkTask> { 立项申请, 项目可行性论证报告 }); var 设计前准备 = new WorkFlow(Guid.Parse("DC65EFB1-D802-4E5E-951D-3F340044608D") , "设计前准备", Guid.Parse("A963D7E8-3A1C-4192-8914-D36950AF5043") , new List <IWorkTask> { 项目开发通知书, 开发任务书 }); var 方案设计 = new WorkFlow(Guid.Parse("9A3827EA-0A70-492C-A27F-5DAAEC74256C") , "方案设计", Guid.Parse("41467A9D-331D-4815-81F8-68492CBF9057") , new List <IWorkTask> { 草案设计, 技术方案论证报告 }); var 方案验证 = new WorkFlow(Guid.Parse("4B28A1C5-150D-4C4D-AB60-6967BBEE025C") , "方案验证", Guid.Parse("CCFE6FE2-D7BF-4D25-9E86-77328E12B6C4") , new List <IWorkTask> { 测试任务, 产品性能及定性评审, 一阶段性能评审, 二阶段性能评审, 综合性能评审 }); var 资料设计 = new WorkFlow(Guid.Parse("71D09EFC-F2A7-4C9D-AC7A-AC097704F8C1") , "资料设计", Guid.Parse("F1465D41-AD74-4AE4-89DC-A3E8FA656DE3") , new List <IWorkTask> { 商品命名, 资料评审 }); projectFlow = new ProjectFlow(Guid.Parse("C0A00706-E619-4F71-A8A2-77D3F7478F62"), "项目管理流程" , Guid.Parse("A19300A7-8D7F-4571-895B-A0DD1B035ED7"), new List <IWorkFlow> { 设计前准备, 方案设计, 方案验证, 资料设计 }); }
public void FileDelete(DataReport.geReportKbn rptKbn, string pgId, string _deleteFileName, string _deleteFilePath) { try { string deleteFileName = ""; string deleteFilePath = ""; deleteFileName = System.Windows.Browser.HttpUtility.UrlEncode(_deleteFileName); deleteFilePath = _deleteFilePath.Replace(_deleteFileName, System.Windows.Browser.HttpUtility.UrlEncode(_deleteFileName)).Replace(@"\", "@AAB@").Replace("/", "@AAD@"); ; var requestUri = string.Format("{0}?rptKbn={1}&pgId={2}&random={3}&deleteFileName={4}&deleteFilePath={5}", Common.gstrReportDeleteUrl, ((int)rptKbn).ToString(), pgId, Common.gstrSessionString, deleteFileName, deleteFilePath); var client = new WebClient(); client.UploadStringCompleted += OnFileDeleteCompleted; client.UploadStringAsync(new Uri(requestUri), "delete"); } catch (Exception ex) { //ExMessageBox.Show("ファイルダウンロード処理で予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message); return; } }
public void FileDownLoad(DataReport.geReportKbn rptKbn, string pgId, string[] prm) { try { this.saveDialog = new SaveFileDialog(); switch (rptKbn) { case DataReport.geReportKbn.Download: this.saveDialog.DefaultExt = ".pdf"; this.saveDialog.Filter = "All Files|*.*|Pdf Files|*.pdf"; break; case DataReport.geReportKbn.Csv: this.saveDialog.DefaultExt = ".csv"; this.saveDialog.Filter = "All Files|*.*|Csv Files|*.csv"; break; case DataReport.geReportKbn.None: this.saveDialog.Filter = "All Files|*.*"; break; default: break; } this.saveDialog.FilterIndex = 2; } catch (Exception ex) { ExMessageBox.Show("ファイル保存処理(ダイアログ表示)で予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message); if (this.utlParentFKey != null) this.utlParentFKey.IsEnabled = true; return; } bool? dialogResult = this.saveDialog.ShowDialog(); if (dialogResult == true) { try { string downLoadFileName = ""; string downLoadFilePath = ""; downLoadFileName = System.Windows.Browser.HttpUtility.UrlEncode(prm[0]); downLoadFilePath = prm[1].Replace(prm[0], System.Windows.Browser.HttpUtility.UrlEncode(prm[0])).Replace(@"\", "@AAB@").Replace("/", "@AAD@"); ; var requestUri = string.Format("{0}?rptKbn={1}&pgId={2}&random={3}&downLoadFileName={4}&downLoadFilePath={5}", Common.gstrReportDownloadUrl, ((int)rptKbn).ToString(), pgId, Common.gstrSessionString, downLoadFileName, downLoadFilePath); var client = new WebClient(); client.OpenReadCompleted += OnFileDownloadCompleted; client.OpenReadAsync(new Uri(requestUri), null); switch (rptKbn) { case DataReport.geReportKbn.OutPut: case DataReport.geReportKbn.Download: Common.gstrProgressDialogTitle = "PDFファイルダウンロード中"; break; case DataReport.geReportKbn.Csv: Common.gstrProgressDialogTitle = "CSVファイルダウンロード中"; break; } if (dlgWin == null) { dlgWin = new Dlg_Progress(); } dlgWin.Show(); } catch (Exception ex) { ExMessageBox.Show("ファイルダウンロード処理で予期せぬエラーが発生しました。" + Environment.NewLine + ex.Message); if (this.utlParentFKey != null) this.utlParentFKey.IsEnabled = true; return; } } else { this.saveDialog = null; if (this.utlParentFKey != null) this.utlParentFKey.IsEnabled = true; GC.Collect(); } }
public ReportWriter(DataReport report) { m_report = report; }
private void simpleButtonDetail_Click(object sender, EventArgs e) { string linkField = _data.DrTable["LinkField"].ToString().ToUpper(); if (linkField == string.Empty) { return; } if (gridViewReport.SelectedRowsCount == 0) { return; } string linkItem = gridViewReport.GetFocusedRowCellValue(linkField).ToString().Trim(); DataRow dr = gridViewReport.GetDataRow(gridViewReport.FocusedRowHandle); foreach (DataColumn col in dr.Table.Columns) { Config.NewKeyValue("@" + col.ColumnName, dr[col]); } if (linkItem == string.Empty) { return; } string linkString = linkField + " = '" + linkItem + "'"; DataReport data = (_data as DataReport).GetDataForDetailReport(linkField, linkItem) as DataReport; if (data != null) { data.PsString = (_data as DataReport).PsString; ReportPreview rptPre = new ReportPreview(data); data.SaveVariables(); // rptPre.MdiParent = this.MdiParent; rptPre.Show(); rptPre.Disposed += new EventHandler(rptPre_Disposed); //load lại dữ liệu trong trường hợp sửa lại voucher //if (rptPre.DataChanged) //{ // (_data as DataReport).GetDataForReport(); // gridControlReport.DataSource = (_data as DataReport).DtReportData; // this.DataChanged = true; //} } else { string maCT;//= gridViewReport.GetFocusedRowCellValue("MACT").ToString(); maCT = dr["MaCT"].ToString(); CDTData data1 = (_data as DataReport).GetDataForVoucher(maCT, linkItem); _bindingSource = new BindingSource(); _bindingSource.DataSource = data1.DsData; this._bindingSource.DataMember = data1.DsData.Tables[0].TableName; this._frmDesigner = new FormDesigner(data1, _bindingSource); _frmDesigner.formAction = FormAction.Edit; FrmMasterDetailDt frmMtDtCt = new FrmMasterDetailDt(_frmDesigner); if (frmMtDtCt.ShowDialog() == DialogResult.OK) { (_data as DataReport).GetDataForReport(); gridControlReport.DataSource = (_data as DataReport).DtReportData; DataChanged = true; } } }
public static void SaveAsHtml(this DataReport report, string filepath) { throw new NotImplementedException(); }
public void StudentViewModelMessageRecieved(ObservableCollection <ScheduleReportItem> ScheduleForSem, List <ScheduleReportItem> fullSchedule, int batchSize, Course currentCourse, string year, int iterCount) { StudentData = new ObservableCollection <Student>(); DataReportList = new ObservableCollection <DataReport>(); try { StudentData = new ObservableCollection <Student>(getStudentData(currentCourse.Name.Replace(" ", String.Empty)).Where(s => s.Major == currentCourse.Name && s.FreshmanYear == year).ToList().GetRange(0, batchSize)); int studentCountInMajor = StudentData.Count; StudentHeadCount = StudentData.Count.ToString(); for (int i = 0; i < iterCount; i++) { //trying monte carlo simulation to generate probability distribution for students taking up sections foreach (var student in StudentData) { student.SubjectList = new List <ScheduleReportItem>(); var groupSubjects = ScheduleForSem.Where(s => s.Components == "SEM" || s.Components == "LEC" || s.Components == "ACT" || s.Components == "LAB").GroupBy(x => x.Subject); foreach (var sub in groupSubjects) { Random random = new Random(); int indexRandom = random.Next(sub.ToList().Count - 1); var subjectPicked = sub.ToList()[indexRandom]; student.SubjectList.Add(subjectPicked); } //foreach (var sub in groupSubjects) //{ // CryptoRandom random = new CryptoRandom(); // int indexRandom = random.Next(sub.ToList().Count - 1); // var subjectPicked = sub.ToList()[indexRandom]; // student.SubjectList.Add(subjectPicked); //} bool flagStduentConflictFound = false; //figure out how many students from above list have been assigned conflicting sections //var queryComplex = StudentData.Where(s => s.SubjectList.Any(sub => ScheduleForSem.Where(sc => sc.Color == "Color").Contains(sub))); && s1.Days.Equals(s2.Days) var queryStud = student.SubjectList.Where(s1 => student.SubjectList.Any(s2 => !s1.Subject.Equals(s2.Subject) && (s1.Days.Length > 0 && s2.Days.Length > 0) && (s1.Days.Contains(s2.Days) || s2.Days.Contains(s1.Days)) && ((s1.B_Time <= s2.E_Time) && (s2.B_Time <= s1.E_Time)) )).ToList().Select(c => { c.Color = " "; flagStduentConflictFound = true; student.SubInConflict++; return(c); }).ToList(); if (flagStduentConflictFound) { StudentsAffected++; flagStduentConflictFound = false; } student.SubjectList.Clear(); } currentCourse.SemesterList[0].AvgStudentEffected = StudentsAffected; DataReport dRObj = new DataReport(batchSize, currentCourse, year, StudentData.ToList()); DataReportList.Add(dRObj); StudentsAffected = 0; } string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"New Job\DataReportCSULB" + currentCourse.Name + ".csv"); double avgStudEffected = DataReportList.Average(f => f.StudentsAffected); FileHelper.CreateCSVFromGenericList(new List <DataReport>(DataReportList), path); } catch (Exception ex) { MessageBox.Show(ex.Message); } }