Query_OperationInstruction.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using UAS_MES.DataOperate;
  10. using UAS_MES.Entity;
  11. using UAS_MES.PublicMethod;
  12. namespace UAS_MES.Query
  13. {
  14. public partial class Query_OperationInstruction : Form
  15. {
  16. DataHelper dh;
  17. AutoSizeFormClass asc = new AutoSizeFormClass();
  18. public Query_OperationInstruction()
  19. {
  20. InitializeComponent();
  21. }
  22. private void Query_OperationInstruction_Load(object sender, EventArgs e)
  23. {
  24. //asc.controllInitializeSize(this);
  25. dh = SystemInf.dh;
  26. }
  27. private void Query_OperationInstruction_SizeChanged(object sender, EventArgs e)
  28. {
  29. //asc.controlAutoSize(this);
  30. sn_label.Location = new Point(20, 0);
  31. SnCode.Location = new Point(sn_label.Location.X + sn_label.Width + 20, 0);
  32. FileList_label.Location = new Point(SnCode.Location.X + SnCode.Width + 20, 0);
  33. FileList.Location = new Point(FileList_label.Location.X + FileList_label.Width + 20, 0);
  34. }
  35. private void SnCode_KeyDown(object sender, KeyEventArgs e)
  36. {
  37. if (e.KeyCode == Keys.Enter)
  38. {
  39. string MachineType = dh.getFieldDataByCondition("makeserial left join product on pr_code=ms_prodcode", "pr_machinetype", "ms_id=(select max(ms_id) from makeserial where ms_sncode='" + SnCode.Text + "')").ToString();
  40. //string FilePath = dh.getFieldDataByCondition("", "", "").ToString();
  41. }
  42. }
  43. private void FileList_SelectedIndexChanged(object sender, EventArgs e)
  44. {
  45. string FileType = BaseUtil.GetFileSuffix(FileList.Text);
  46. switch (FileType)
  47. {
  48. case "MP4":
  49. MediaPlayer.Visible = true;
  50. PageView.Visible = false;
  51. PicBox.Visible = false;
  52. break;
  53. case "PDF":
  54. MediaPlayer.Visible = false;
  55. PageView.Visible = true;
  56. PicBox.Visible = false;
  57. break;
  58. case "JPEG":
  59. MediaPlayer.Visible = false;
  60. PageView.Visible = false;
  61. PicBox.Visible = true;
  62. break;
  63. case "JPG":
  64. MediaPlayer.Visible = false;
  65. PageView.Visible = false;
  66. PicBox.Visible = true;
  67. break;
  68. default:
  69. break;
  70. }
  71. }
  72. }
  73. }