Exemple #1
0
        private void GridSn2Print_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (GridSn2Print.Rows.Count == 0)
            {
                return;
            }

            if (e.RowIndex == -1)
            {
                return;
            }

            if (e.ColumnIndex == 0)
            {
                string rmes_id   = GridSn2Print.Rows[e.RowIndex].Cells["colRmesID"].Value.ToString();
                string sn        = GridSn2Print.Rows[e.RowIndex].Cells["colSn"].Value.ToString();
                string file_path = @"\\10.212.202.20\d$\SyncFiles";
                string file_name = GridSn2Print.Rows[e.RowIndex].Cells["colFileName"].Value.ToString();
                file_name = file_path + "\\" + file_name;
                if (!File.Exists(file_name))
                {
                    MessageBox.Show("相应的质检报告文件没有找到");
                    return;
                }
                //File.Open(file_name,FileMode.Open);

                System.Diagnostics.Process pExecuteEXE = new System.Diagnostics.Process();
                pExecuteEXE.StartInfo.FileName  = @"C:\Program Files\Microsoft Office\Office15\excel.exe";
                pExecuteEXE.StartInfo.FileName  = "excel.exe";
                pExecuteEXE.StartInfo.Arguments = file_name;
                pExecuteEXE.Start();
                pExecuteEXE.WaitForExit();//

                DetectReportEntity ent = DetectReportFactory.GetByKey(rmes_id);
                ent.PRINT_DATE  = DateTime.Now;
                ent.PRINT_TIMES = ent.PRINT_TIMES + 1;
                DetectReportFactory.UpdateInsertRecord(ent);

                //InitSn2Print();
            }
        }
Exemple #2
0
 public void InsertRecord(DetectReportEntity ent)
 {
     db.Insert(ent);
 }
Exemple #3
0
 public static void UpdateInsertRecord(DetectReportEntity ent)
 {
     new DetectReportDal().UpdateRecord(ent);
 }
Exemple #4
0
 public void UpdateRecord(DetectReportEntity ent)
 {
     db.Update(ent);
     //db.Insert(ent);
     //}
 }
Exemple #5
0
 public static void InsertRecord(DetectReportEntity ent)
 {
     new DetectReportDal().InsertRecord(ent);
 }