frmSelectProductionList.cs 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using LYFZ.PhotoSelectSystem;
  6. namespace LYFZ.Software.MainBusiness.CameraControlBook
  7. {
  8. public class frmSelectProductionList : LYFZ.Software.UI.CameraControlBook.frmChooseScenicToPrint
  9. {
  10. public frmSelectProductionList()
  11. {
  12. this.MaximizeBox = false;
  13. this.IsUserControlsSize = false;
  14. this.Load += FrmSelectProductionList_Load;
  15. btn_ok.Click += Btn_ok_Click;
  16. btn_cancle.Click += Btn_cancle_Click;
  17. }
  18. /// <summary>
  19. ///
  20. /// </summary>
  21. /// <param name="sender"></param>
  22. /// <param name="e"></param>
  23. private void Btn_cancle_Click(object sender, EventArgs e)
  24. {
  25. this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  26. }
  27. /// <summary>
  28. ///
  29. /// </summary>
  30. /// <param name="sender"></param>
  31. /// <param name="e"></param>
  32. private void Btn_ok_Click(object sender, EventArgs e)
  33. {
  34. this.SelectPhoto.SelectPrintList.Clear();
  35. foreach (LYFZ.ComponentLibrary.CheckBoxEx cbox in CheckBoxList)
  36. {
  37. if (cbox.Checked)
  38. {
  39. this.SelectPhoto.SelectPrintList.Add((SelectPrintProduction)cbox.Tag);
  40. }
  41. }
  42. if (this.SelectPhoto.SelectPrintList.Count > 0)
  43. {
  44. this.DialogResult = System.Windows.Forms.DialogResult.OK;
  45. }
  46. else {
  47. MessageBoxCustom.Show("请选择你要打印的成长阶段");
  48. }
  49. }
  50. PhotoSelectSystem.EventSelectPhotoPrint _SelectPhoto;
  51. LYFZ.EnumPublic.OrderType _OrdType = EnumPublic.OrderType.写真订单;
  52. /// <summary>
  53. /// 订单类型
  54. /// </summary>
  55. public LYFZ.EnumPublic.OrderType OrderType
  56. {
  57. get
  58. {
  59. return _OrdType;
  60. }
  61. set
  62. {
  63. _OrdType = value;
  64. }
  65. }
  66. public EventSelectPhotoPrint SelectPhoto { get => _SelectPhoto; set => _SelectPhoto = value; }
  67. LYFZ.BLL.BLL_ErpOrderDigital orderDigitalBll = new BLL.BLL_ErpOrderDigital();
  68. LYFZ.BLL.BLL_ErpOrdersPhotography photographyBll = new BLL.BLL_ErpOrdersPhotography();
  69. List<LYFZ.ComponentLibrary.CheckBoxEx> CheckBoxList = new List<ComponentLibrary.CheckBoxEx>();
  70. private void FrmSelectProductionList_Load(object sender, EventArgs e)
  71. {
  72. if (SelectPhoto != null)
  73. {
  74. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, System.ComponentModel.BackgroundWorker backgroundWorker)
  75. {
  76. backgroundWorker.ReportProgress(0, "正在获取信息....");
  77. this.SelectPhoto.OrderDigitalList = orderDigitalBll.GetModelList(String.Format("Ordv_Number='{0}'", SelectPhoto.CurrentModel.Ord_Number), "Ordv_DigitalNumber asc");
  78. this.SelectPhoto.PhotographyList = photographyBll.GetModelList(String.Format("Ordpg_Number='{0}'", SelectPhoto.CurrentModel.Ord_Number));
  79. });
  80. if (this.OrderType == EnumPublic.OrderType.儿童订单)
  81. {
  82. #region 生成控件;
  83. int nCtrlCount = this.SelectPhoto.OrderDigitalList.Count;
  84. int nHeight = 65/*上下边框总高*/ + nCtrlCount * 27 + 28 + 25 * 2/*上下边距*/;
  85. base.Size = new System.Drawing.Size(435, nHeight);
  86. int i = 0;
  87. foreach (LYFZ.Model.Model_ErpOrderDigital digital in this.SelectPhoto.OrderDigitalList)
  88. {
  89. LYFZ.Model.Model_ErpOrdersPhotography photography = this.SelectPhoto.PhotographyList.Find(p => p.Ordpg_ViceNumber.ToLower() == digital.Ordv_ViceNumber.ToLower());
  90. if (photography != null)
  91. {
  92. LYFZ.ComponentLibrary.CheckBoxEx check = new ComponentLibrary.CheckBoxEx();
  93. this.plExMainContainer.Controls.Add(check);
  94. check.Tag = new SelectPrintProduction(digital, photography);
  95. check.AutoSize = true;
  96. check.BackColor = System.Drawing.Color.Transparent;
  97. check.CurrentCheckState = LYFZ.ComponentLibrary.CheckStateEx.Unchecked;
  98. check.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134)));
  99. check.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(119)))), ((int)(((byte)(113)))), ((int)(((byte)(113)))));
  100. check.Fourstates = false;
  101. check.IsGreenTick = false;
  102. check.Location = new System.Drawing.Point(115, 25 + 27 * i);
  103. check.Name = string.Format("checkBoxEx{0}", i);
  104. check.Size = new System.Drawing.Size(200, 21);
  105. check.TabIndex = 0;
  106. check.Text = string.Format("{0} {1}", photography.Ordpg_Sights, photography.GetPhotographyStatus() == "OK" ? "√" : "");
  107. check.CheckState = System.Windows.Forms.CheckState.Checked;
  108. check.UseVisualStyleBackColor = false;
  109. CheckBoxList.Add(check);
  110. i++;
  111. }
  112. }
  113. // ok按钮;
  114. btn_ok.Location = new System.Drawing.Point(115, 35 + 27 * nCtrlCount);
  115. // cancle按钮;
  116. btn_cancle.Location = new System.Drawing.Point(115 + 85 + 45, 35 + 27 * nCtrlCount);
  117. #endregion
  118. }
  119. }
  120. else {
  121. MessageBoxCustom.Show("参数不能为空");
  122. this.Close();
  123. }
  124. }
  125. }
  126. }