Query_SOP.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. using System;
  2. using System.IO;
  3. using System.Text;
  4. using System.Windows.Forms;
  5. using System.Net;
  6. using System.Collections.Generic;
  7. using System.Threading;
  8. using System.Data;
  9. using System.Drawing.Imaging;
  10. using System.Drawing;
  11. using UAS_MES_NEW.Entity;
  12. using UAS_MES_NEW.PublicMethod;
  13. using Aspose.Cells;
  14. using UAS_MES_NEW.DataOperate;
  15. using UAS_MES_NEW.PublicForm;
  16. using Aspose.Cells.Drawing;
  17. using Aspose.Cells.Rendering;
  18. using System.Web.Script.Serialization;
  19. using Seagull.BarTender.Print;
  20. namespace UAS_MES_NEW.Query
  21. {
  22. public partial class Query_SOP : Form
  23. {
  24. DataHelper dh;
  25. string usercode;
  26. string sourcecode;
  27. DataTable Dbfind;
  28. public Query_SOP()
  29. {
  30. usercode = "";
  31. sourcecode = "";
  32. InitializeComponent();
  33. }
  34. private void Form3_Load(object sender, EventArgs e)
  35. {
  36. CheckForIllegalCrossThreadCalls = false;
  37. ps_prodcode.TableName = "productsop";
  38. ps_prodcode.SelectField = "ps_code # 流水号,ps_prodcode # SOP编号";
  39. ps_prodcode.FormName = Name;
  40. ps_prodcode.DBTitle = "SOP查询";
  41. ps_prodcode.SetValueField = new string[] { "ps_code", "ps_prodcode" };
  42. ps_prodcode.Condition = "";
  43. ps_prodcode.DbChange += nr_rule_DBChange;
  44. pr_code.TableName = "product";
  45. pr_code.SelectField = "pr_code # 产品编号,pr_detail # 产品名称,pr_spec # 产品规格";
  46. pr_code.FormName = Name;
  47. pr_code.DBTitle = "物料查询";
  48. pr_code.Condition = "pr_code not like '%LX%'";
  49. pr_code.SetValueField = new string[] { "pr_code" };
  50. dh = SystemInf.dh;
  51. }
  52. private void nr_rule_DBChange(object sender, EventArgs e)
  53. {
  54. Dbfind = ps_prodcode.ReturnData;
  55. BaseUtil.SetFormValue(this.Controls, Dbfind);
  56. }
  57. void uploadfile()
  58. {
  59. if (FilePath.Text == "")
  60. {
  61. MessageBox.Show("文件不能为空!");
  62. return;
  63. }
  64. //if (pr_code.Text == "")
  65. //{
  66. // MessageBox.Show("产品编号不能为空!");
  67. // return;
  68. //}
  69. if (JPG.Checked)
  70. {
  71. ps_prodcode.Text = FilePath.Text.Substring(FilePath.Text.LastIndexOf(@"\") + 1).Replace(".xls", "").Replace(".xlsx", "");
  72. pr_code_Leave(new object(), new EventArgs());
  73. DataTable dt = (DataTable)dh.ExecuteSql("select * from productsop where ps_prodcode='" + ps_prodcode.Text + "' ", "select");
  74. if (dt.Rows.Count == 0)
  75. {
  76. string code = LogicHandler.GetPiInoutCode("ProductSOP", "1");
  77. ps_code.Text = code;
  78. if (VaildDate.Checked)
  79. {
  80. dh.ExecuteSql("insert into productsop(ps_id,ps_code,ps_prodcode,ps_indate,ps_inman,ps_status,ps_statuscode,ps_vailddate,ps_prcode)values(productsop_seq.nextval,'" + code + "','" + ps_prodcode.Text + "',sysdate,'" + User.UserName + "','在录入','ENTERING',to_date('" + DateCode.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd'),'" + pr_code.Text + "')", "insert");
  81. }
  82. else
  83. {
  84. dh.ExecuteSql("insert into productsop(ps_id,ps_code,ps_prodcode,ps_indate,ps_inman,ps_status,ps_statuscode,ps_prcode)values(productsop_seq.nextval,'" + code + "','" + ps_prodcode.Text + "',sysdate,'" + User.UserName + "','在录入','ENTERING','" + pr_code.Text + "')", "insert");
  85. }
  86. }
  87. else
  88. {
  89. string ps_id = dt.Rows[0]["ps_id"].ToString();
  90. dh.ExecuteSql("delete from ProductSOPdetail where psd_psid='" + ps_id + "'", "delete");
  91. ps_prodcode.Text = dt.Rows[0]["ps_prodcode"].ToString();
  92. }
  93. Workbook workbook = new Workbook(FilePath.Text);
  94. List<Worksheet> list = new List<Worksheet>();
  95. List<string> filename = new List<string>();
  96. if (VaildDate.Checked)
  97. {
  98. dh.ExecuteSql("update ProductSOP set ps_attachsop='',ps_inman='" + User.UserName + "',ps_vailddate=to_date('" + DateCode.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd') where ps_prodcode='" + ps_prodcode.Text + "'", "update");
  99. }
  100. else
  101. {
  102. dh.ExecuteSql("update ProductSOP set ps_attachsop='',ps_inman='" + User.UserName + "' where ps_prodcode='" + ps_prodcode.Text + "'", "update");
  103. }
  104. OperatResult.AppendText("一共Sheet: " + workbook.Worksheets.Count + "\n");
  105. for (int i = 0; i < workbook.Worksheets.Count; i++)
  106. {
  107. OperatResult.AppendText("正在解析Sheet" + workbook.Worksheets[i].Name + "\n");
  108. if (JPG.Checked)
  109. {
  110. try
  111. {
  112. if (!Directory.Exists(Application.StartupPath + @"\" + ps_prodcode.Text))
  113. {
  114. Directory.CreateDirectory(Application.StartupPath + @"\" + ps_prodcode.Text);
  115. }
  116. string path = Application.StartupPath + @"\" + ps_prodcode.Text + @"\";
  117. Worksheet she = workbook.Worksheets[i];
  118. // 获取原表的实际数据范围和最大列
  119. int totalRows = she.Cells.MaxDataRow + 1;
  120. int lastColIndex = she.Cells.MaxDataColumn;
  121. string lastColLetter = CellsHelper.ColumnIndexToName(lastColIndex);
  122. int rowSliceSize = int.Parse(RowCount.Value.ToString());
  123. int imageIndex = 1;
  124. // 记录原表设置,循环结束后恢复,避免污染原文件
  125. string originalPrintArea = she.PageSetup.PrintArea;
  126. double originalLeftMargin = she.PageSetup.LeftMargin;
  127. double originalRightMargin = she.PageSetup.RightMargin;
  128. double originalTopMargin = she.PageSetup.TopMargin;
  129. double originalBottomMargin = she.PageSetup.BottomMargin;
  130. // 设置居中、无边距的打印模式,确保图片紧密贴合
  131. she.PageSetup.CenterHorizontally = true;
  132. she.PageSetup.CenterVertically = true;
  133. she.PageSetup.LeftMargin = 0;
  134. she.PageSetup.RightMargin = 0;
  135. she.PageSetup.TopMargin = 0;
  136. she.PageSetup.BottomMargin = 0;
  137. for (int startRow = 0; startRow < totalRows; startRow += rowSliceSize)
  138. {
  139. int endRow = Math.Min(startRow + rowSliceSize - 1, totalRows - 1);
  140. // 1. 动态设置原表的打印区域(模拟切片)
  141. // 注意:这里直接使用原表渲染,虽然旧版本对图片的浮层处理有限,但这能最大程度保留图片
  142. she.PageSetup.PrintArea = $"A{startRow + 1}:{lastColLetter}{endRow + 1}";
  143. // 2. 创建渲染选项
  144. ImageOrPrintOptions options = new ImageOrPrintOptions();
  145. options.ImageFormat = ImageFormat.Png;
  146. options.OnePagePerSheet = true; // 强制在一页内输出,严格限制范围
  147. options.PrintingPage = PrintingPageType.Default; // 禁止忽略空白行列
  148. // 3. 渲染图片
  149. SheetRender sr = new SheetRender(she, options);
  150. Bitmap bitmap = sr.ToImage(0);
  151. // 4. 处理并保存图片
  152. string imagename = $"{she.Name}_{imageIndex}.png";
  153. string imagePath = Path.Combine(path, imagename);
  154. bitmap.Save(imagePath, ImageFormat.Png);
  155. // 释放资源,防止内存溢出
  156. bitmap.Dispose();
  157. //sr.Dispose();
  158. imageIndex++;
  159. OperatResult.AppendText("解析图片【" + imagePath + "】" + "\n");
  160. // 5. 上传与入库
  161. Dictionary<string, object> dic = new Dictionary<string, object>();
  162. dic.Add("em_name", "管理员");
  163. dic.Add("em_code", "ADMIN");
  164. dic.Add("caller", "ProductSOP");
  165. OperatResult.AppendText("上传文件【" + imagePath + "】\n");
  166. string fp_id = UploadFilesToRemoteUrl("https://mes.lihantech.cn/mes/MEScommon/uploadFiles.action?_noc=1", imagePath, dic);
  167. string ps_id = dh.getFieldDataByCondition("ProductSOP", "ps_id", "ps_prodcode='" + ps_prodcode.Text + "'").ToString();
  168. dh.ExecuteSql("insert into ProductSOPdetail(psd_id,psd_psid,psd_attach) select ProductSOPdetail_seq.nextval,ps_id,'" + imagename + ";" + fp_id + "' from ProductSOP where ps_prodcode='" + ps_prodcode.Text + "'", "insert");
  169. }
  170. // 恢复原表设置
  171. she.PageSetup.PrintArea = originalPrintArea;
  172. she.PageSetup.LeftMargin = originalLeftMargin;
  173. she.PageSetup.RightMargin = originalRightMargin;
  174. she.PageSetup.TopMargin = originalTopMargin;
  175. she.PageSetup.BottomMargin = originalBottomMargin;
  176. }
  177. catch (Exception ex)
  178. {
  179. OperatResult.AppendText(ex.Message + ex.StackTrace);
  180. }
  181. }
  182. }
  183. }
  184. else if (PDF.Checked)
  185. {
  186. ps_prodcode.Text = FilePath.Text.Substring(FilePath.Text.LastIndexOf(@"\") + 1).Replace(".pdf", "");
  187. pr_code_Leave(new object(), new EventArgs());
  188. DataTable dt = (DataTable)dh.ExecuteSql("select * from productsop where ps_prodcode='" + ps_prodcode.Text + "' ", "select");
  189. if (dt.Rows.Count == 0)
  190. {
  191. string code = LogicHandler.GetPiInoutCode("ProductSOP", "1");
  192. ps_code.Text = code;
  193. if (VaildDate.Checked)
  194. {
  195. dh.ExecuteSql("insert into productsop(ps_id,ps_code,ps_prodcode,ps_indate,ps_inman,ps_status,ps_statuscode,ps_vailddate)values(productsop_seq.nextval,'" + code + "','" + ps_prodcode.Text + "',sysdate,'" + User.UserName + "','在录入','ENTERING',to_date('" + DateCode.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd'))", "insert");
  196. }
  197. else
  198. {
  199. dh.ExecuteSql("insert into productsop(ps_id,ps_code,ps_prodcode,ps_indate,ps_inman,ps_status,ps_statuscode)values(productsop_seq.nextval,'" + code + "','" + ps_prodcode.Text + "',sysdate,'" + User.UserName + "','在录入','ENTERING')", "insert");
  200. }
  201. }
  202. else
  203. {
  204. string psid = dt.Rows[0]["ps_id"].ToString();
  205. dh.ExecuteSql("delete from ProductSOPdetail where psd_psid='" + psid + "'", "delete");
  206. ps_prodcode.Text = dt.Rows[0]["ps_prodcode"].ToString();
  207. }
  208. if (VaildDate.Checked)
  209. {
  210. dh.ExecuteSql("update ProductSOP set ps_attachsop='',ps_inman='" + User.UserName + "',ps_vailddate=to_date('" + DateCode.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd') where ps_prodcode='" + ps_prodcode.Text + "'", "update");
  211. }
  212. else
  213. {
  214. dh.ExecuteSql("update ProductSOP set ps_attachsop='',ps_inman='" + User.UserName + "' where ps_prodcode='" + ps_prodcode.Text + "'", "update");
  215. }
  216. Dictionary<string, object> dic = new Dictionary<string, object>();
  217. dic.Add("em_name", "管理员");
  218. dic.Add("em_code", "ADMIN");
  219. dic.Add("caller", "ProductSOP");
  220. OperatResult.AppendText("上传文件【" + ps_prodcode.Text + "" + "】\n");
  221. string fp_id = UploadFilesToRemoteUrl("https://mes.lihantech.cn/mes/MEScommon/uploadFiles.action?_noc=1", FilePath.Text, dic);
  222. string ps_id = dh.getFieldDataByCondition("ProductSOP", "ps_id", "ps_prodcode='" + ps_prodcode.Text + "'").ToString();
  223. dh.ExecuteSql("insert into ProductSOPdetail(psd_id,psd_psid,psd_attach) select ProductSOPdetail_seq.nextval,ps_id,'" + ps_prodcode.Text + ";" + fp_id + "' from ProductSOP where ps_prodcode='" + ps_prodcode.Text + "'", "insert");
  224. }
  225. }
  226. /// <summary>
  227. /// 请求上传图片到阿里云
  228. /// </summary>
  229. /// <param name="url">上传地址</param>
  230. /// <param name="filepath">本地文件路径</param>
  231. /// <param name="dic">上传的数据信息</param>
  232. /// <returns></returns>
  233. public string UploadFilesToRemoteUrl(string url1, string filepath, Dictionary<string, object> dic)
  234. {
  235. try
  236. {
  237. ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;
  238. ServicePointManager.DefaultConnectionLimit = 50;
  239. string boundary = DateTime.Now.Ticks.ToString("x");
  240. byte[] boundarybytes = System.Text.Encoding.UTF8.GetBytes("--" + boundary + "\r\n");
  241. HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url1);
  242. request.Method = "POST";
  243. request.Timeout = 10 * 10000;
  244. request.ContentType = "multipart/form-data; boundary=" + boundary;
  245. Stream rs = request.GetRequestStream();
  246. var endBoundaryBytes = Encoding.UTF8.GetBytes("--" + boundary + "--\r\n");
  247. string formdataTemplate = "Content-Disposition: form-data; name=\"{0}\"\r\n" + "\r\n" + "{1}" + "\r\n";
  248. if (dic != null)
  249. {
  250. foreach (string key in dic.Keys)
  251. {
  252. rs.Write(boundarybytes, 0, boundarybytes.Length);
  253. string formitem = string.Format(formdataTemplate, key, dic[key]);
  254. byte[] formitembytes = System.Text.Encoding.UTF8.GetBytes(formitem);
  255. rs.Write(formitembytes, 0, formitembytes.Length);
  256. }
  257. }
  258. string headerTemplate = "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"\r\n\r\n";
  259. {
  260. rs.Write(boundarybytes, 0, boundarybytes.Length);
  261. var header = string.Format(headerTemplate, "file", Path.GetFileName(filepath));
  262. var headerbytes = System.Text.Encoding.UTF8.GetBytes(header);
  263. rs.Write(headerbytes, 0, headerbytes.Length);
  264. using (var fileStream = new FileStream(filepath, FileMode.Open, FileAccess.Read))
  265. {
  266. var buffer = new byte[1024];
  267. var bytesRead = 0;
  268. while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) != 0)
  269. {
  270. rs.Write(buffer, 0, bytesRead);
  271. }
  272. }
  273. var cr = Encoding.UTF8.GetBytes("\r\n");
  274. rs.Write(cr, 0, cr.Length);
  275. }
  276. rs.Write(endBoundaryBytes, 0, endBoundaryBytes.Length);
  277. var response = request.GetResponse() as HttpWebResponse;
  278. StreamReader newReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
  279. string Content = newReader.ReadToEnd();
  280. Dictionary<string, object> dic1 = new Dictionary<string, object>();
  281. List<Dictionary<string, object>> dic2 = null;
  282. dic1 = BaseUtil.ToDictionary(Content);
  283. dic2 = dic1["data"] as List<Dictionary<string, object>>;
  284. string fp_id = "";
  285. if (dic2[0]["filepath"] != null)
  286. {
  287. fp_id = dic2[0]["filepath"].ToString();
  288. }
  289. if (response.StatusCode == HttpStatusCode.OK)
  290. {
  291. return fp_id;
  292. }
  293. }
  294. catch (Exception e)
  295. {
  296. LogicHandler.DoCommandLog("SOP", usercode, "", "", sourcecode, "上传SOP", "上传失败", ps_prodcode.Text, "");
  297. Console.WriteLine(e.Message + e.StackTrace);
  298. }
  299. return "";
  300. }
  301. private void ChooseFile_Click(object sender, EventArgs e)
  302. {
  303. ChoosePath.Filter = "(*.xlsx)|*.xlsx|(*.xls)|*.xls|(*.pdf)|*.pdf";
  304. DialogResult result = ChoosePath.ShowDialog();
  305. if (result == DialogResult.OK)
  306. {
  307. FilePath.Text = ChoosePath.FileName;
  308. }
  309. }
  310. private void UploadSOP_Click(object sender, EventArgs e)
  311. {
  312. Thread thread = new Thread(uploadfile);
  313. SetLoadingWindow stw = new SetLoadingWindow(thread, "上传文件");
  314. stw.StartPosition = FormStartPosition.CenterScreen;
  315. stw.ShowDialog();
  316. if (JPG.Checked)
  317. {
  318. LogicHandler.DoCommandLog("SOP", usercode, "", "", sourcecode, "上传SOP【图片格式】", "上传成功", ps_prodcode.Text, "");
  319. }
  320. else
  321. {
  322. LogicHandler.DoCommandLog("SOP", usercode, "", "", sourcecode, "上传SOP【PDF格式】", "上传成功", ps_prodcode.Text, "");
  323. }
  324. }
  325. private void OperatResult_TextChanged(object sender, EventArgs e)
  326. {
  327. //OperatResult.SelectionStart = Text.Length;
  328. OperatResult.ScrollToCaret();
  329. }
  330. private void SendSop_Click(object sender, EventArgs e)
  331. {
  332. try
  333. {
  334. if (ps_prodcode.Text == "")
  335. {
  336. MessageBox.Show("线别和SOP文档不能为空");
  337. return;
  338. }
  339. if (SendDGV.Rows.Count > 0)
  340. {
  341. List<Dictionary<string, string>> listr = new List<Dictionary<string, string>>();
  342. JavaScriptSerializer jss = new JavaScriptSerializer();
  343. Dictionary<string, object> map1 = new Dictionary<string, object>();
  344. Dictionary<string, object> map = new Dictionary<string, object>();
  345. string path;
  346. string pathroot = dh.GetConfig("filePathUrl", "sys").ToString();
  347. dh.ExecuteSql("insert into soprelease(SR_ID, sr_pscode, SR_STATUS, SR_MACHINETYPE,sr_releaseman,sr_readman)" +
  348. "select soprelease_seq.nextval,'" + ps_code.Text + "',0,'" + ps_prodcode.Text + "','" + User.UserName + "',em_code from employee ", "insert");
  349. LogicHandler.DoCommandLog("SOP", usercode, "", "", sourcecode, "广播SOP", "广播成功", ps_prodcode.Text, "");
  350. MessageBox.Show("文档[" + ps_prodcode.Text + "]下放成功");
  351. }
  352. else
  353. {
  354. MessageBox.Show("产品编号" + ps_prodcode.Text + "未维护SOP文档");
  355. LogicHandler.DoCommandLog("SOP", usercode, "", "", sourcecode, "广播SOP", "广播失败,未维护SOP文档", ps_prodcode.Text, "");
  356. }
  357. }
  358. catch (Exception ex)
  359. {
  360. LogicHandler.DoCommandLog("SOP", usercode, "", "", sourcecode, "广播SOP", "广播失败", ps_prodcode.Text, "");
  361. Console.WriteLine(ex.Message + ex.StackTrace);
  362. }
  363. }
  364. public string encryptBASE64(string key)
  365. {
  366. Console.WriteLine(key);
  367. byte[] bytes = Encoding.Default.GetBytes(key);
  368. return Convert.ToBase64String(bytes);
  369. }
  370. public static string EncodeBase64(string code_type, string code)
  371. {
  372. string encode = "";
  373. byte[] bytes = Encoding.GetEncoding(code_type).GetBytes(code);
  374. try
  375. {
  376. encode = Convert.ToBase64String(bytes);
  377. }
  378. catch
  379. {
  380. encode = code;
  381. }
  382. return encode;
  383. }
  384. private void pr_code_KeyDown(object sender, KeyEventArgs e)
  385. {
  386. if (e.KeyCode == Keys.Enter)
  387. {
  388. LoadPrCode();
  389. }
  390. }
  391. private BindingSource bs = new BindingSource(); // 类成员变量
  392. private void LoadPrCode()
  393. {
  394. DataTable dt = (DataTable)dh.ExecuteSql("select * from productsop where ps_prodcode='" + ps_prodcode.Text + "'", "select");
  395. if (dt.Rows.Count > 0)
  396. {
  397. string ps_id = dt.Rows[0]["ps_id"].ToString();
  398. dt = (DataTable)dh.ExecuteSql(@"select fp_name,fp_path,'' issend,psd_iskey
  399. from ProductSOPdetail
  400. left join filepath on FP_ID=substr(PSD_ATTACH,instr(PSD_ATTACH,';')+1)
  401. where psd_psid=" + ps_id, "select");
  402. if (dt.Rows.Count > 0)
  403. {
  404. // 在 UI 线程安全执行(如果已经在 UI 线程则直接调用)
  405. if (SendDGV.InvokeRequired)
  406. SendDGV.Invoke(new Action(() => BindData(dt)));
  407. else
  408. BindData(dt);
  409. }
  410. }
  411. }
  412. private void BindData(DataTable dt)
  413. {
  414. // 使用 BindingSource 避免直接置 null
  415. if (SendDGV.DataSource == null)
  416. {
  417. bs.DataSource = dt;
  418. SendDGV.DataSource = bs;
  419. }
  420. else
  421. {
  422. bs.DataSource = dt; // 直接替换内部数据,控件不会经历“无数据”状态
  423. }
  424. // 可选:刷新显示
  425. SendDGV.Refresh();
  426. }
  427. private void pr_code_Leave(object sender, EventArgs e)
  428. {
  429. //LoadPrCode();
  430. }
  431. bool AllChecked = false;
  432. private void ChooseALL_Click(object sender, EventArgs e)
  433. {
  434. if (AllChecked)
  435. {
  436. foreach (DataGridViewRow dr in SendDGV.Rows)
  437. dr.Cells[0].Value = false;
  438. AllChecked = false;
  439. }
  440. else
  441. {
  442. foreach (DataGridViewRow dr in SendDGV.Rows)
  443. dr.Cells[0].Value = true;
  444. AllChecked = true;
  445. }
  446. }
  447. private void ps_prodcode_UserControlTextChanged(object sender, EventArgs e)
  448. {
  449. LoadPrCode();
  450. }
  451. private void GetSOP_Click(object sender, EventArgs e)
  452. {
  453. LoadPrCode();
  454. }
  455. private void ChoosePrint_Click(object sender, EventArgs e)
  456. {
  457. ChoosePath.Filter = "(*.png)|*.png";
  458. DialogResult result = ChoosePath.ShowDialog();
  459. if (result == DialogResult.OK)
  460. {
  461. PrintPath.Text = ChoosePath.FileName;
  462. }
  463. }
  464. private void SendDGV_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
  465. {
  466. if (e.RowIndex < 0 || e.ColumnIndex < 0) return;
  467. }
  468. }
  469. }