OrderDeletePhotosFormMain.cs 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. namespace LYFZ.Software.MainBusiness.StudioDataSet
  11. {
  12. public partial class OrderDeletePhotosFormMain : LYFZ.Software.UI.StudioDataSet.OrderDeletePhotosFormMain
  13. {
  14. public OrderDeletePhotosFormMain()
  15. {
  16. this.Load += OrderDeletePhotosFormMain_Load;
  17. this.btnQuery.Click += btnQuery_Click;
  18. this.btnDelete.Click += btnDelete_Click;
  19. this.cmbQueryText.KeyDown += cmbQueryText_KeyDown;
  20. this.UcPagerEx1.EventPaging += UcPagerEx1_EventPaging;
  21. }
  22. string strUsrID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  23. /// <summary>
  24. /// 窗体加载事件
  25. /// </summary>
  26. /// <param name="sender"></param>
  27. /// <param name="e"></param>
  28. void OrderDeletePhotosFormMain_Load(object sender, EventArgs e)
  29. {
  30. if (this.dgvData.Columns.Count <= 0)
  31. {
  32. string strColumn = "Ord_Number,订单号,客户姓名,订单类型,取件日期,已取天数,原片状况,初修片状况,精修片状况,设计片状况,接单人,套系名称,套系价格";
  33. this.dgvData.DataColumns(strColumn, "Ord_Number");
  34. this.dgvData.Columns["订单号"].Width = 120;
  35. this.dgvData.Columns["已取天数"].Width = 60;
  36. this.dgvData.Columns["原片状况"].Width = 140;
  37. this.dgvData.Columns["初修片状况"].Width = 140;
  38. this.dgvData.Columns["精修片状况"].Width = 140;
  39. this.dgvData.Columns["设计片状况"].Width = 140;
  40. }
  41. this.PublicFunctionRows();
  42. }
  43. /// <summary>
  44. /// 查询
  45. /// </summary>
  46. /// <param name="sender"></param>
  47. /// <param name="e"></param>
  48. void btnQuery_Click(object sender, EventArgs e)
  49. {
  50. this.PublicFunctionRows();
  51. }
  52. /// <summary>
  53. /// 查询回车事件
  54. /// </summary>
  55. /// <param name="sender"></param>
  56. /// <param name="e"></param>
  57. void cmbQueryText_KeyDown(object sender, KeyEventArgs e)
  58. {
  59. if (e.KeyCode == Keys.Enter)
  60. { this.PublicFunctionRows(); }
  61. }
  62. /// <summary>
  63. /// 删除
  64. /// </summary>
  65. /// <param name="sender"></param>
  66. /// <param name="e"></param>
  67. void btnDelete_Click(object sender, EventArgs e)
  68. {
  69. }
  70. /// <summary>
  71. /// 创建行
  72. /// </summary>
  73. private void PublicFunctionRows()
  74. {
  75. this.UcPagerEx1.PageCurrent = 1;
  76. this.UcPagerEx1.PageSize = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPageSize();//3;分页条数
  77. this.UcPagerEx1.Bind();
  78. }
  79. /// <summary>
  80. /// 分页前数据,便于展开时用来查询订单的子数据
  81. /// </summary>
  82. DataTable tblMianSelectData = new DataTable();
  83. /// <summary>
  84. /// 画分页
  85. /// </summary>
  86. /// <param name="e"></param>
  87. /// <returns></returns>
  88. int UcPagerEx1_EventPaging(UCPager.EventPagingArg e)
  89. {
  90. LYFZ.UCPager.PageData pageData = new LYFZ.UCPager.PageData();
  91. pageData.TableName = "Vw_OrderPickupSelect";
  92. pageData.PageIndex = this.UcPagerEx1.PageCurrent;
  93. pageData.PageSize = this.UcPagerEx1.PageSize;
  94. pageData.QueryCondition = GetWhereStr();
  95. pageData.OrderStr = "ID";
  96. pageData.OrderType = 1;
  97. this.dgvData.dgvGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0001.ToString().Trim();
  98. this.dgvData.dgvUserEmployeeID = strUsrID;
  99. this.dgvData.dgvFixedHideColumn = "Ord_Number";
  100. this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,sOrd_Number,Cus_Name,Ord_Type_CS,PickupStatus,PickupTime,dayCount,Ord_SeriesName,Ord_SeriesPrice,OrdPe_OrdersPerson,Ord_PhotoPath";
  101. pageData.QueryFieldName = this.dgvData.dgvSetColumnName();
  102. if (string.IsNullOrEmpty(pageData.QueryFieldName))
  103. { pageData.QueryFieldName = this.dgvData.dgvCurrentColumnOriginalSet; }
  104. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
  105. {
  106. this.tblMianSelectData = pageData.QueryDataTable().Tables[0];
  107. try
  108. {
  109. this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
  110. {
  111. //this.dgvData.DataSourceMain(this.tblMianSelectData);
  112. this.dgvData.Rows.Clear();
  113. for (int i = 0; i < tblMianSelectData.Rows.Count; i++)
  114. {
  115. DataGridViewRow dgvr = new DataGridViewRow();
  116. DataGridViewCell cell = null;
  117. cell = new DataGridViewTextBoxCell();
  118. cell.Value = tblMianSelectData.Rows[i]["Ord_Number"].ToString();
  119. dgvr.Cells.Add(cell);
  120. cell = new DataGridViewTextBoxCell();
  121. cell.Value = tblMianSelectData.Rows[i]["sOrd_Number"].ToString();
  122. dgvr.Cells.Add(cell);
  123. cell = new DataGridViewTextBoxCell();
  124. cell.Value = tblMianSelectData.Rows[i]["Cus_Name"].ToString();
  125. dgvr.Cells.Add(cell);
  126. cell = new DataGridViewTextBoxCell();
  127. cell.Value = tblMianSelectData.Rows[i]["Ord_Type_CS"].ToString();
  128. dgvr.Cells.Add(cell);
  129. cell = new DataGridViewTextBoxCell();
  130. cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(tblMianSelectData.Rows[i]["PickupTime"], "yyyy-MM-dd");
  131. dgvr.Cells.Add(cell);
  132. cell = new DataGridViewTextBoxCell();
  133. cell.Value = tblMianSelectData.Rows[i]["dayCount"].ToString();
  134. dgvr.Cells.Add(cell);
  135. cell = new DataGridViewTextBoxCell();
  136. cell.Value = LYFZ.BLL.BLL_ErpOrder.GetPhotoDelInfo(tblMianSelectData.Rows[i]["Ord_PhotoPath"].ToString(), LYFZ.Model.Model_ErpOrder.DirectoryType.PrimitivePicture);
  137. dgvr.Cells.Add(cell);
  138. cell = new DataGridViewTextBoxCell();
  139. cell.Value = LYFZ.BLL.BLL_ErpOrder.GetPhotoDelInfo(tblMianSelectData.Rows[i]["Ord_PhotoPath"].ToString(), LYFZ.Model.Model_ErpOrder.DirectoryType.EarlyRetouch);
  140. dgvr.Cells.Add(cell);
  141. cell = new DataGridViewTextBoxCell();
  142. cell.Value = LYFZ.BLL.BLL_ErpOrder.GetPhotoDelInfo(tblMianSelectData.Rows[i]["Ord_PhotoPath"].ToString(), LYFZ.Model.Model_ErpOrder.DirectoryType.FineRetouch);
  143. dgvr.Cells.Add(cell);
  144. cell = new DataGridViewTextBoxCell();
  145. cell.Value = LYFZ.BLL.BLL_ErpOrder.GetPhotoDelInfo(tblMianSelectData.Rows[i]["Ord_PhotoPath"].ToString(), LYFZ.Model.Model_ErpOrder.DirectoryType.DesignPiece);
  146. dgvr.Cells.Add(cell);
  147. cell = new DataGridViewTextBoxCell();
  148. cell.Value = tblMianSelectData.Rows[i]["OrdPe_OrdersPerson"].ToString();
  149. dgvr.Cells.Add(cell);
  150. cell = new DataGridViewTextBoxCell();
  151. cell.Value = tblMianSelectData.Rows[i]["Ord_SeriesName"].ToString();
  152. dgvr.Cells.Add(cell);
  153. cell = new DataGridViewTextBoxCell();
  154. cell.Value = tblMianSelectData.Rows[i]["Ord_SeriesPrice"].ToString();
  155. dgvr.Cells.Add(cell);
  156. this.dgvData.Rows.Add(dgvr);
  157. }
  158. }));
  159. }
  160. catch
  161. { }
  162. });
  163. try
  164. {
  165. this.UcPagerEx1.TbDataSource = this.tblMianSelectData;
  166. this.dgvData.Columns["客户姓名"].Frozen = true;
  167. //this.dgvData.Columns["套系价格"].Width = 30;
  168. }
  169. catch { }
  170. this.dgvData.ClearSelection();
  171. return pageData.TotalCount;
  172. }
  173. /// <summary>
  174. /// 返回要操作的条件
  175. /// </summary>
  176. /// <returns></returns>
  177. private string GetWhereStr()
  178. {
  179. string StrWhere = " 1=1 ";
  180. string StrText = cmbQueryText.Text.Trim();
  181. if (!string.IsNullOrEmpty(StrText))
  182. { StrWhere += " and sOrd_Number = '" + StrText + "'"; }
  183. return StrWhere;
  184. }
  185. }
  186. }