frmPerturbedController.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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. namespace LYFZ.Software.MainBusiness.CameraControlBook
  10. {
  11. public partial class frmPerturbedController : LYFZ.Software.UI.CameraControlBook.frmPerturbedController
  12. {
  13. BLL.BLL_ErpOrderDigital orderDigitalBll = new BLL.BLL_ErpOrderDigital();
  14. public frmPerturbedController()
  15. {
  16. this.Load += FrmPerturbedController_Load;
  17. this.btnSearch.Click += BtnSearch_Click;
  18. }
  19. private void FrmPerturbedController_Load(object sender, EventArgs e)
  20. {
  21. //PublicDataRows();
  22. // 部门人员绑定
  23. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_DepartmentAndEmployee(this.cmbEmployeeName, IsFirstNodeNull: true, IsFirstNodeName: "全部", IsShowResign: false, IsShowAdmin: true, tb_User: LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable);
  24. this.cmbEmployeeName.TagFindText(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID);
  25. }
  26. void PublicDataRows()
  27. {
  28. dgvUnarranged.Rows.Clear();
  29. dgvArranged.Rows.Clear();
  30. string dataValue = this.cmbEmployeeName.Tag.ToString();
  31. DataTable arrangeTable = orderDigitalBll.GetErpOrderDigitalNotArrange(tbSearchText.Text,dtpStartDate.Text, dtpEndDate.Text, dataValue);
  32. BindNotArrangeData(arrangeTable);
  33. BindArrangeData(arrangeTable);
  34. }
  35. void BindArrangeData(DataTable arrangeTable)
  36. {
  37. foreach (DataRow dr in arrangeTable.Rows)
  38. {
  39. string funcName = "";
  40. if (string.IsNullOrEmpty(dr["Ordpg_PhotographyTime"].ToString_s()) && !string.IsNullOrEmpty(dr["Ordpg_ReservationPhotographyTime"].ToString_s()))
  41. {
  42. if (rdoPhotographed.Checked||rdoAll.Checked)
  43. {
  44. string StrRowValue = dr["Ordpg_Dispatcher"].ToString_s().Trim();
  45. if (!string.IsNullOrEmpty(StrRowValue))
  46. {
  47. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrRowValue);
  48. if (dtRows != null)
  49. {
  50. StrRowValue = dtRows["User_Name"].ToString().Trim();
  51. }
  52. else
  53. {
  54. StrRowValue = "";
  55. }
  56. }
  57. BindArrangeDataRowData(dr, "拍照已安排未完成", dr["Ordpg_ReservationPhotographyTime"].ToString_s(), StrRowValue, dr["Ordpg_DispatchTime"].ToString_s());
  58. }
  59. }
  60. if (!string.IsNullOrEmpty(dr["Ordv_ReservationFilmSelectionTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_FilmSelectionTime"].ToString_s()))
  61. {
  62. if (rdoFilmSelection.Checked || rdoAll.Checked)
  63. {
  64. string StrRowValue = dr["Ordv_FilmSelectionDispatcher"].ToString_s().Trim();
  65. if (!string.IsNullOrEmpty(StrRowValue))
  66. {
  67. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrRowValue);
  68. if (dtRows != null)
  69. {
  70. StrRowValue = dtRows["User_Name"].ToString().Trim();
  71. }
  72. else
  73. {
  74. StrRowValue = "";
  75. }
  76. }
  77. BindArrangeDataRowData(dr, "选片已安排未完成", dr["Ordv_ReservationFilmSelectionTime"].ToString_s(), StrRowValue, dr["Ordv_FilmSelectionDispatchTime"].ToString_s());
  78. }
  79. }
  80. if (!string.IsNullOrEmpty(dr["Ordv_ReservationLookDesignTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_LookDesignTime"].ToString_s()))
  81. {
  82. if (rdoLookDesign.Checked || rdoAll.Checked)
  83. {
  84. string StrRowValue = dr["Ordv_LookDesignDispatcher"].ToString_s().Trim();
  85. if (!string.IsNullOrEmpty(StrRowValue))
  86. {
  87. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrRowValue);
  88. if (dtRows != null)
  89. {
  90. StrRowValue = dtRows["User_Name"].ToString().Trim();
  91. }
  92. else
  93. {
  94. StrRowValue = "";
  95. }
  96. }
  97. BindArrangeDataRowData(dr, "看版已安排未完成", dr["Ordv_ReservationLookDesignTime"].ToString_s(), StrRowValue, dr["Ordv_LookDesignDispatchTime"].ToString_s());
  98. }
  99. }
  100. if (!string.IsNullOrEmpty(dr["Ordv_ReservationSendPhotoTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_SendPhotoTime"].ToString_s()))
  101. {
  102. if (rdoTotakePiece.Checked|| rdoAll.Checked)
  103. {
  104. string StrRowValue = dr["Ordv_SendPhotoDispatcher"].ToString_s().Trim();
  105. if (!string.IsNullOrEmpty(StrRowValue))
  106. {
  107. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrRowValue);
  108. if (dtRows != null)
  109. {
  110. StrRowValue = dtRows["User_Name"].ToString().Trim();
  111. }
  112. else
  113. {
  114. StrRowValue = "";
  115. }
  116. }
  117. BindArrangeDataRowData(dr, "取件已安排未完成", dr["Ordv_ReservationSendPhotoTime"].ToString_s(), StrRowValue, dr["Ordv_SendPhotoDispatchTime"].ToString_s());
  118. }
  119. }
  120. if (!string.IsNullOrEmpty(dr["Ordv_ReservationClothingTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_ClothingTime"].ToString_s()))
  121. {
  122. if (rdoSelectDress.Checked || rdoAll.Checked)
  123. {
  124. string StrRowValue = dr["Ordv_ClothingDispatcher"].ToString_s().Trim();
  125. if (!string.IsNullOrEmpty(StrRowValue))
  126. {
  127. DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrRowValue);
  128. if (dtRows != null)
  129. {
  130. StrRowValue = dtRows["User_Name"].ToString().Trim();
  131. }
  132. else
  133. {
  134. StrRowValue = "";
  135. }
  136. }
  137. BindArrangeDataRowData(dr, "送礼服已安排未完成", dr["Ordv_ReservationClothingTime"].ToString_s(), StrRowValue, dr["Ordv_ClothingDispatchTime"].ToString_s());
  138. }
  139. }
  140. }
  141. }
  142. void BindArrangeDataRowData(DataRow dr ,string msg, string time,string dname, string dtime)
  143. {
  144. DataGridViewRow dgvr = new DataGridViewRow();
  145. DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
  146. dgvr.Cells.Add(cell);
  147. cell.Value = dr["Ordpg_Number"];
  148. cell = new DataGridViewTextBoxCell();
  149. dgvr.Cells.Add(cell);
  150. cell.Value = dr["cus_Name"];
  151. cell = new DataGridViewTextBoxCell();
  152. dgvr.Cells.Add(cell);
  153. cell.Value = dr["Cus_Telephone"];
  154. cell = new DataGridViewTextBoxCell();
  155. dgvr.Cells.Add(cell);
  156. cell.Value = dr["Ordpg_Sign"]+"("+ msg + ")";
  157. cell = new DataGridViewTextBoxCell();
  158. dgvr.Cells.Add(cell);
  159. cell.Value = time;
  160. cell = new DataGridViewTextBoxCell();
  161. dgvr.Cells.Add(cell);
  162. cell.Value = dname;
  163. cell = new DataGridViewTextBoxCell();
  164. dgvr.Cells.Add(cell);
  165. cell.Value = dtime;
  166. dgvArranged.Rows.Add(dgvr);
  167. }
  168. void BindNotArrangeData(DataTable arrangeTable)
  169. {
  170. foreach (DataRow dr in arrangeTable.Rows)
  171. {
  172. DataGridViewRow dgvr = new DataGridViewRow();
  173. DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
  174. dgvr.Cells.Add(cell);
  175. cell.Value = dr["Ordpg_Number"];
  176. cell = new DataGridViewTextBoxCell();
  177. dgvr.Cells.Add(cell);
  178. cell.Value = dr["cus_Name"];
  179. cell = new DataGridViewTextBoxCell();
  180. dgvr.Cells.Add(cell);
  181. cell.Value = dr["Cus_Telephone"];
  182. cell = new DataGridViewTextBoxCell();
  183. dgvr.Cells.Add(cell);
  184. cell.Value = dr["Ordpg_Sign"];
  185. cell = new DataGridViewTextBoxCell();
  186. dgvr.Cells.Add(cell);
  187. cell.Value = dr["Ord_CreateDateTime"];
  188. string funcName = "";
  189. if (string.IsNullOrEmpty(dr["Ordpg_PhotographyTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordpg_ReservationPhotographyTime"].ToString_s()))
  190. {
  191. if (!string.IsNullOrEmpty(funcName))
  192. {
  193. funcName += ",";
  194. }
  195. funcName += "未安排拍照";
  196. }
  197. if (string.IsNullOrEmpty(dr["Ordv_ReservationFilmSelectionTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_FilmSelectionTime"].ToString_s()))
  198. {
  199. if (!string.IsNullOrEmpty(funcName))
  200. {
  201. funcName += ",";
  202. }
  203. funcName += "未安排选片";
  204. }
  205. if (string.IsNullOrEmpty(dr["Ordv_ReservationLookDesignTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_LookDesignTime"].ToString_s()))
  206. {
  207. if (!string.IsNullOrEmpty(funcName))
  208. {
  209. funcName += ",";
  210. }
  211. funcName += "未安排看版";
  212. }
  213. if (string.IsNullOrEmpty(dr["Ordv_ReservationSendPhotoTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_SendPhotoTime"].ToString_s()))
  214. {
  215. if (!string.IsNullOrEmpty(funcName))
  216. {
  217. funcName += ",";
  218. }
  219. funcName += "未安排取件";
  220. }
  221. if (string.IsNullOrEmpty(dr["Ordv_ReservationClothingTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_ClothingTime"].ToString_s()))
  222. {
  223. if (!string.IsNullOrEmpty(funcName))
  224. {
  225. funcName += ",";
  226. }
  227. funcName += "未安排送礼服";
  228. }
  229. if (Convert.ToInt32(dr["serviceCount"].ToString_s()) > 0)
  230. {
  231. if (!string.IsNullOrEmpty(funcName))
  232. {
  233. funcName += ",";
  234. }
  235. funcName += "未安排服务(" + dr["serviceCount"].ToString_s() + ")";
  236. }
  237. if(rdoPhotographed.Checked && !funcName.Contains("拍照"))
  238. {
  239. continue;
  240. }
  241. else if (rdoFilmSelection.Checked && !funcName.Contains("选片"))
  242. {
  243. continue;
  244. }
  245. else if (rdoLookDesign.Checked && !funcName.Contains("看版"))
  246. {
  247. continue;
  248. }
  249. else if (rdoTotakePiece.Checked && !funcName.Contains("取件"))
  250. {
  251. continue;
  252. }
  253. else if (rdoSelectDress.Checked && !funcName.Contains("送礼服"))
  254. {
  255. continue;
  256. }
  257. if (string.IsNullOrEmpty(funcName))
  258. {
  259. continue;
  260. }
  261. cell = new DataGridViewTextBoxCell();
  262. dgvr.Cells.Add(cell);
  263. cell.Value = funcName;
  264. dgvUnarranged.Rows.Add(dgvr);
  265. }
  266. }
  267. private void BtnSearch_Click(object sender, EventArgs e)
  268. {
  269. PublicDataRows();
  270. }
  271. }
  272. }