コード例 #1
0
        /// <summary>
        /// 编辑甘肃报表
        /// </summary>
        private void EditGS()
        {
            clsReportGS report;

            try
            {
                if (dataGridGS.SelectedItems.Count > 0)
                {
                    report = (clsReportGS)dataGridGS.SelectedItems[0];
                    //根据主表ID查询子表样品信息集合
                    DataTable dt = _resultTable.GetReportDetailGS(report.ID);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        List <clsReportGSDetail> ItemNames = (List <clsReportGSDetail>)IListDataSet.DataTableToIList <clsReportGSDetail>(dt, 1);
                        for (int i = 0; i < ItemNames.Count; i++)
                        {
                            DYSeriesDataSet.DataModel.clsReportGS.ReportDetail reportDetail = new DYSeriesDataSet.DataModel.clsReportGS.ReportDetail();
                            reportDetail.ID                 = ItemNames[i].ID;
                            reportDetail.ReportGSID         = ItemNames[i].ReportGSID;
                            reportDetail.ProjectName        = ItemNames[i].ProjectName;
                            reportDetail.InspectionStandard = ItemNames[i].InspectionStandard;
                            reportDetail.IndividualResults  = ItemNames[i].IndividualResults;
                            reportDetail.Unit               = ItemNames[i].Unit;
                            reportDetail.IndividualDecision = ItemNames[i].IndividualDecision;
                            report.reportDetailList.Add(reportDetail);
                        }
                    }
                    UpdateReportGSWindow window = new UpdateReportGSWindow();
                    window.ShowInTaskbar = false;
                    window.Owner         = this;
                    window.GetValues(report);
                    window.ShowDialog();
                    SearchReportGS();
                }
                else
                {
                    MessageBox.Show("请选择编辑条目!", "操作提示");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("异常(Edit):\n" + ex.Message);
            }
        }
コード例 #2
0
 /// <summary>
 /// 双击编辑报表 甘肃
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dataGridGS_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     if (!Global.EachDistrict.Equals("GS"))
     {
         clsReportGS report;
         try
         {
             if (dataGridGS.SelectedItems.Count > 0)
             {
                 report = (clsReportGS)dataGridGS.SelectedItems[0];
                 //根据主表ID查询子表样品信息集合
                 DataTable dt = _resultTable.GetReportDetailGS(report.ID);
                 if (dt != null && dt.Rows.Count > 0)
                 {
                     List <clsReportGSDetail> ItemNames = (List <clsReportGSDetail>)IListDataSet.DataTableToIList <clsReportGSDetail>(dt, 1);
                     for (int i = 0; i < ItemNames.Count; i++)
                     {
                         DYSeriesDataSet.DataModel.clsReportGS.ReportDetail reportDetail = new DYSeriesDataSet.DataModel.clsReportGS.ReportDetail();
                         reportDetail.ID                 = ItemNames[i].ID;
                         reportDetail.ReportGSID         = ItemNames[i].ReportGSID;
                         reportDetail.ProjectName        = ItemNames[i].ProjectName;
                         reportDetail.InspectionStandard = ItemNames[i].InspectionStandard;
                         reportDetail.IndividualResults  = ItemNames[i].IndividualResults;
                         reportDetail.Unit               = ItemNames[i].Unit;
                         reportDetail.IndividualDecision = ItemNames[i].IndividualDecision;
                         report.reportDetailList.Add(reportDetail);
                     }
                 }
                 UpdateReportGSWindow window = new UpdateReportGSWindow();
                 window.ShowInTaskbar = false;
                 window.Owner         = this;
                 window.GetValues(report);
                 window.ShowDialog();
                 SearchReportGS();
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("异常(Edit):\n" + ex.Message);
         }
     }
 }