frmDigitalArrangement.cs 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Dynamic;
  6. using System.Linq;
  7. using System.Text;
  8. namespace LYFZ.Software.MainBusiness.DoorCityProcess
  9. {
  10. public class frmDigitalArrangement : LYFZ.Software.UI.DoorCityProcess.frmDigitalArrangement
  11. {
  12. /// <summary>
  13. /// 是否首次运行
  14. /// </summary>
  15. bool IsFirstRun = true;
  16. /// <summary>
  17. /// 查询条件
  18. /// </summary>
  19. private Dictionary<string, string> DictData = new Dictionary<string, string>();
  20. /// <summary>
  21. /// 员工编号
  22. /// </summary>
  23. string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  24. Hashtable htData;
  25. Dictionary<string, string> dictColumns;
  26. List<string> earlyRepairColumns = new List<string>();
  27. List<string> refinementColumns = new List<string>();
  28. List<string> designColumns = new List<string>();
  29. List<string> sendColumns = new List<string>();
  30. LYFZ.Model.Model_ErpOrderDigital vmodel=null;
  31. LYFZ.Model.Model_ErpOrder model = null;
  32. System.Windows.Forms.DataGridViewRow selectRow;
  33. string StrSightsName = "";
  34. BLL.BLL_ErpOrdersPhotography bllPhotography = new BLL.BLL_ErpOrdersPhotography();
  35. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  36. LYFZ.BLL.BLL_ErpOrderDigital orvbll = new BLL.BLL_ErpOrderDigital();
  37. LYFZ.BLL.BLL_ErpOrderDigitalStatus orsbll = new BLL.BLL_ErpOrderDigitalStatus();
  38. /// <summary>
  39. /// 显示相片集合
  40. /// </summary>
  41. System.Windows.Forms.ImageList ImageList1 = new System.Windows.Forms.ImageList();
  42. public frmDigitalArrangement()
  43. {
  44. this.Shown += frmDigitalArrangement_Shown;
  45. this.Load += frmDigitalArrangement_Load;
  46. this.cbxDropDownList.ComboBoxTreeViewEx_TextChanged += cbxDropDownList_ComboBoxTreeViewEx_TextChanged;
  47. //this.PublicFunctionRights();
  48. //this.PublicFunctionRows();
  49. cbxPhotoType.SelectedIndex = 0;
  50. labDesign.Click += labDesign_Click;
  51. labEarlyRepair.Click += labDesign_Click;
  52. labRefineRepair.Click += labDesign_Click;
  53. labSendData.Click += labDesign_Click;
  54. this.dgvOrderList.CellDoubleClick += dgvOrderList_CellContentDoubleClick;
  55. this.dgvOrderList.MouseDoubleClick += dgvOrderList_MouseDoubleClick;
  56. /// 查看工作安排
  57. this.btn_ArrangeWork.Click += btn_ArrangeWork_Click;
  58. /// 安排工作
  59. this.btn_ViewPai.Click += btn_ViewPai_Click;
  60. ///导入原片
  61. this.btnImportOriginalFilm.Click += btnImportOriginalFilm_Click;
  62. ///导出原片
  63. this.btnExportOriginalFilm.Click += btnExportOriginalFilm_Click;
  64. ///分片
  65. this.btnSlice.Click += btnSlice_Click;
  66. ///导出初修
  67. this.btnExportRepair.Click +=btnExportRepair_Click;
  68. ///导入初修
  69. this.btnImportRepairFilm.Click += btnImportRepairFilm_Click;
  70. ///外发初修
  71. this.btnSendOutRepair.Click += btnSendOutRepair_Click;
  72. ///导出选好的片
  73. this.btnExportSelectFilm.Click += btnExportSelectFilm_Click;
  74. ///导入精修
  75. this.btnImportRefine.Click += btnImportRefine_Click;
  76. ///导出精修
  77. this.btnExportRefine.Click += btnExportRefine_Click;
  78. ///外发精修
  79. this.btnSendOutRefine.Click += btnSendOutRefine_Click;
  80. ///导出设计
  81. this.btnExportDesign.Click += btnExportDesign_Click;
  82. ///导入设计
  83. this.btnImportDesign.Click += btnImportDesign_Click;
  84. ///外发统计
  85. this.btnOutDesignStatistics.Click += btnOutDesignStatistics_Click;
  86. ///外发设计
  87. this.btnOutDesign.Click += btnOutDesign_Click;
  88. this.cbxMyJob.Click += cbxMyJob_Click;
  89. this.btn_Query.Click += btn_Query_Click;
  90. }
  91. void btn_Query_Click(object sender, EventArgs e)
  92. {
  93. labDesign_Click(null, null);
  94. }
  95. public void BindPostionSize()
  96. {
  97. this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  98. this.Location = new System.Drawing.Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  99. this.Size = new System.Drawing.Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  100. }
  101. void cbxMyJob_Click(object sender, EventArgs e)
  102. {
  103. this.PublicFunctionRights();
  104. this.PublicFunctionRows();
  105. }
  106. ///外发设计
  107. void btnOutDesign_Click(object sender, EventArgs e)
  108. {
  109. if (this.dgvOrderList.Rows.Count > 0)
  110. {
  111. if (this.dgvOrderList.SelectedRows.Count > 0)
  112. {
  113. string StrViceNumber = this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  114. if (!LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword(StrViceNumber))
  115. { return; }
  116. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.OutSendDesignSingleSmallForm frm = new SetSmallForm.OutSendDesignSingleSmallForm();
  117. frm.StrOrdNumber = this.dgvOrderList.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  118. frm.StrOrdViceNumber = this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  119. frm.ShowDialog();
  120. if (frm.IsSaveed)
  121. { this.PublicFunctionRows(); }
  122. }
  123. else
  124. { MessageBoxCustom.Show("请选择你要操作的订单"); return; }
  125. }
  126. }
  127. ///外发统计
  128. void btnOutDesignStatistics_Click(object sender, EventArgs e)
  129. {
  130. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.OutSendDesignStatisticSmallForm frm = new SetSmallForm.OutSendDesignStatisticSmallForm();
  131. frm.ShowDialog();
  132. }
  133. ///导入设计
  134. void btnImportDesign_Click(object sender, EventArgs e)
  135. {
  136. if (this.dgvOrderList.Rows.Count > 0)
  137. {
  138. if (this.dgvOrderList.SelectedRows.Count > 0)
  139. {
  140. string ViceName = "";
  141. if (this.dgvOrderList.CurrentRow.Cells["订单类型"].Value.ToString().Trim() == Convert.ToInt32(LYFZ.EnumPublic.OrderType.儿童订单).ToString().Trim())
  142. {
  143. if (this.dgvOrderList.Columns["拍摄名称"] != null)
  144. {
  145. ViceName = this.dgvOrderList.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim();
  146. }
  147. }
  148. if (BLL.BLL_N8ClientConfig.N8ViewGoEnable)
  149. {
  150. if (LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ImportN8UserPiece(
  151. this.dgvOrderList.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(),
  152. this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(), ViceName)
  153. )
  154. {
  155. this.PublicFunctionRows();
  156. }
  157. }
  158. else
  159. {
  160. if (this.dgvOrderList.CurrentRow.Cells["取件状态"].Value.ToString().Trim() == "OK")
  161. {
  162. MessageBoxCustom.Show("已取件,不能导片!");
  163. }
  164. LYFZ.Model.Model_ErpOrderDigital _modelDigital = null;
  165. if (LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ImportDesignPiece(
  166. this.dgvOrderList.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(),
  167. this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(),
  168. ViceName,ref _modelDigital,
  169. this.dgvOrderList.CurrentRow.Cells["取件状态"].Value.ToString().Trim()))
  170. {
  171. this.PublicFunctionRows();
  172. }
  173. }
  174. }
  175. else
  176. {
  177. MessageBoxCustom.Show("请选择要导入的订单"); return;
  178. }
  179. }
  180. }
  181. ///导出设计
  182. void btnExportDesign_Click(object sender, EventArgs e)
  183. {
  184. if (this.dgvOrderList.Rows.Count > 0)
  185. {
  186. if (this.dgvOrderList.SelectedRows.Count > 0)
  187. {
  188. string SightsName = "";
  189. if (this.dgvOrderList.CurrentRow.Cells["订单类型"].Value.ToString().Trim() == Convert.ToInt32(LYFZ.EnumPublic.OrderType.儿童订单).ToString().Trim())
  190. {
  191. if (this.dgvOrderList.Columns["拍摄名称"] != null)
  192. {
  193. SightsName = this.dgvOrderList.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim();
  194. }
  195. }
  196. if (BLL.BLL_N8ClientConfig.N8ViewGoEnable)
  197. {
  198. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ExportN8Piece(
  199. this.dgvOrderList.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(),
  200. this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(), SightsName
  201. );
  202. }
  203. else
  204. {
  205. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ExportDesignPiece(
  206. this.dgvOrderList.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(),
  207. this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(), SightsName
  208. );
  209. }
  210. }
  211. else
  212. {
  213. MessageBoxCustom.Show("请选择要导出的订单");
  214. return;
  215. }
  216. }
  217. }
  218. ///外发精修
  219. void btnSendOutRefine_Click(object sender, EventArgs e)
  220. {
  221. if (MessageBoxCustom.Show("你确定要外发精修片吗?", "温馨提示", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
  222. {
  223. string StrOrdNumber = this.dgvOrderList.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  224. string StrOrdViceNumber = this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  225. if (!LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword(StrOrdViceNumber))
  226. { return; }
  227. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.ChooseNameSuperSmallForm frm = new SuperSmallForm.ChooseNameSuperSmallForm();
  228. frm.StrOrdNumber = StrOrdNumber;
  229. frm.StrOrdViceNumber = StrOrdViceNumber;
  230. frm.orderProcess = EnumPublic.OrderProcessEnum.精修;
  231. frm.ShowDialog();
  232. if (frm.IsSaveed)
  233. {
  234. DateTime strTime = SDateTime.Now;
  235. List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
  236. DataTable dt = orbll.GetView_Custom("tb_ErpOrderDigitalStatus", StrWhere: "Ords_OrdNumber = '" + StrOrdNumber + "' And Ords_ViceNumber = '" + StrOrdViceNumber + "'", ShowColumnName: "*").Tables[0];
  237. LYFZ.Model.Model_ErpOrderDigitalStatus modelStatus = null;
  238. if (dt.Rows.Count > 0)
  239. {
  240. modelStatus = orsbll.DataRowToModel(dt.Rows[0]);
  241. modelStatus.Ords_OutSendRefineRepairName = this.StrUserID;
  242. modelStatus.Ords_OutSendRefineRepairStatus = "已发";
  243. modelStatus.Ords_OutSendRefineRepairTime = strTime;
  244. modelStatus.Ords_OutSendRefineRepairVendor = frm.htData["StrVendor"].ToString().Trim();
  245. modelStatus.Ords_OutSendRefineRepairVendorQQ = frm.htData["StrQQ"].ToString().Trim();
  246. clist.Add(orsbll.GetUpdateCommandInfo(modelStatus));
  247. }
  248. if (clist.Count > 0)
  249. {
  250. if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
  251. {
  252. if (Convert.ToBoolean(frm.htData["StrIsOutSend"]) && frm.htData["StrQQ"].ToString().Trim().Length > 0)
  253. { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.QQCall(frm.htData["StrQQ"].ToString().Trim()); }
  254. }
  255. else
  256. { MessageBoxCustom.Show("操作选择供应商发出失败!"); }
  257. }
  258. else
  259. { MessageBoxCustom.Show("外发失败,可能数码状态表不存在!"); }
  260. }
  261. }
  262. }
  263. ///导出精修
  264. void btnExportRefine_Click(object sender, EventArgs e)
  265. {
  266. if (this.dgvOrderList.Rows.Count > 0)
  267. {
  268. if (this.dgvOrderList.SelectedRows.Count > 0)
  269. {
  270. string ViceName = "";
  271. if (this.dgvOrderList.CurrentRow.Cells["订单类型"].Value.ToString().Trim() == Convert.ToInt32(LYFZ.EnumPublic.OrderType.儿童订单).ToString().Trim())
  272. {
  273. if (this.dgvOrderList.Columns["拍摄名称"] != null)
  274. { ViceName = this.dgvOrderList.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim(); }
  275. }
  276. string ViceOrderNumber = this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  277. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ExportRefinedRepairPiece(this.dgvOrderList.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(), ViceOrderNumber, ViceName);
  278. }
  279. else { MessageBoxCustom.Show("请选择订单"); return; }
  280. }
  281. }
  282. ///导入精修
  283. void btnImportRefine_Click(object sender, EventArgs e)
  284. {
  285. if (this.dgvOrderList.Rows.Count > 0)
  286. {
  287. if (this.dgvOrderList.SelectedRows.Count > 0)
  288. {
  289. string SightsName = "";
  290. if (this.dgvOrderList.CurrentRow.Cells["订单类型"].Value.ToString().Trim() == Convert.ToInt32(LYFZ.EnumPublic.OrderType.儿童订单).ToString().Trim())
  291. {
  292. if (this.dgvOrderList.Columns["拍摄名称"] != null)
  293. { SightsName = this.dgvOrderList.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim(); }
  294. }
  295. if (this.dgvOrderList.CurrentRow.Cells["取件状态"].Value.ToString().Trim() == "OK")
  296. {
  297. MessageBoxCustom.Show("已取件,不能导片!");
  298. }
  299. LYFZ.Model.Model_ErpOrderDigital _modelDigital=null;
  300. if (LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ImportRefinedRepairPiece(
  301. this.dgvOrderList.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(),
  302. this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(),
  303. SightsName,ref _modelDigital,
  304. this.dgvOrderList.CurrentRow.Cells["取件状态"].Value.ToString().Trim()))
  305. { this.PublicFunctionRows(); }
  306. }
  307. else
  308. { MessageBoxCustom.Show("请选择订单"); return; }
  309. }
  310. }
  311. void btnExportSelectFilm_Click(object sender, EventArgs e)
  312. {
  313. if (this.dgvOrderList.Rows.Count > 0)
  314. {
  315. if (this.dgvOrderList.SelectedRows.Count > 0)
  316. {
  317. string ViceOrderNumber = this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  318. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ExportSelectionPiece(this.dgvOrderList.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(), ViceOrderNumber);
  319. }
  320. else
  321. { MessageBoxCustom.Show("请选择订单"); return; }
  322. }
  323. }
  324. void btnSendOutRepair_Click(object sender, EventArgs e)
  325. {
  326. if (this.dgvOrderList.Rows.Count > 0)
  327. {
  328. if (this.dgvOrderList.SelectedRows.Count > 0)
  329. {
  330. string StrOrdViceNumber = this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  331. if (!LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword(StrOrdViceNumber))
  332. { return; }
  333. if (MessageBoxCustom.Show("你确定要外发初修片吗?", "温馨提示", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
  334. {
  335. string StrOrdNumber = this.dgvOrderList.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  336. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.ChooseNameSuperSmallForm frm = new SuperSmallForm.ChooseNameSuperSmallForm();
  337. frm.StrOrdNumber = StrOrdNumber;
  338. frm.StrOrdViceNumber = StrOrdViceNumber;
  339. frm.orderProcess = EnumPublic.OrderProcessEnum.初修;
  340. frm.ShowDialog();
  341. if (frm.IsSaveed)
  342. {
  343. DateTime strTime = SDateTime.Now;
  344. List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
  345. DataTable dt = orbll.GetView_Custom("tb_ErpOrderDigitalStatus", StrWhere: "Ords_OrdNumber = '" + StrOrdNumber + "' And Ords_ViceNumber = '" + StrOrdViceNumber + "'", ShowColumnName: "*").Tables[0];
  346. LYFZ.Model.Model_ErpOrderDigitalStatus modelStatus = null;
  347. if (dt.Rows.Count > 0)
  348. {
  349. modelStatus = orsbll.DataRowToModel(dt.Rows[0]);
  350. modelStatus.Ords_OutSendEarlyRepairName = this.StrUserID;
  351. modelStatus.Ords_OutSendEarlyRepairStatus = "已发";
  352. modelStatus.Ords_OutSendEarlyRepairTime = strTime;
  353. modelStatus.Ords_OutSendEarlyRepairVendor = frm.htData["StrVendor"].ToString().Trim();
  354. modelStatus.Ords_OutSendEarlyRepairVendorQQ = frm.htData["StrQQ"].ToString().Trim();
  355. clist.Add(orsbll.GetUpdateCommandInfo(modelStatus));
  356. }
  357. if (clist.Count > 0)
  358. {
  359. if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
  360. {
  361. if (Convert.ToBoolean(frm.htData["StrIsOutSend"]) && frm.htData["StrQQ"].ToString().Trim().Length > 0)
  362. { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.QQCall(frm.htData["StrQQ"].ToString().Trim()); }
  363. }
  364. else
  365. { MessageBoxCustom.Show("操作选择供应商发出失败!"); }
  366. }
  367. else
  368. { MessageBoxCustom.Show("外发失败,可能数码状态表不存在!"); }
  369. }
  370. }
  371. }
  372. }
  373. }
  374. void btnImportRepairFilm_Click(object sender, EventArgs e)
  375. {
  376. if (this.dgvOrderList.Rows.Count > 0)
  377. {
  378. if (this.dgvOrderList.SelectedRows.Count > 0)
  379. {
  380. string SightsName = "";
  381. if (this.dgvOrderList.CurrentRow.Cells["订单类型"].Value.ToString().Trim() == Convert.ToInt32(LYFZ.EnumPublic.OrderType.儿童订单).ToString().Trim())
  382. {
  383. if (this.dgvOrderList.Columns["拍摄名称"] != null)
  384. { SightsName = this.dgvOrderList.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim(); }
  385. }
  386. if (this.dgvOrderList.CurrentRow.Cells["取件状态"].Value.ToString().Trim() == "OK")
  387. {
  388. MessageBoxCustom.Show("已取件,不能导片!");
  389. }
  390. LYFZ.Model.Model_ErpOrderDigital _modelDigital = null;
  391. if (LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ImportRepairPiece(
  392. this.dgvOrderList.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(),
  393. this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(),
  394. SightsName,
  395. ref _modelDigital,
  396. this.dgvOrderList.CurrentRow.Cells["取件状态"].Value.ToString().Trim()))
  397. { this.PublicFunctionRows(); }
  398. }
  399. else
  400. { MessageBoxCustom.Show("请选择订单"); return; }
  401. }
  402. }
  403. /// <summary>
  404. /// 熬出修片
  405. /// </summary>
  406. /// <param name="sender"></param>
  407. /// <param name="e"></param>
  408. private void btnExportRepair_Click(object sender, EventArgs e)
  409. {
  410. if (this.dgvOrderList.Rows.Count > 0)
  411. {
  412. if (this.dgvOrderList.SelectedRows.Count > 0)
  413. {
  414. try
  415. {
  416. System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog();
  417. string ViceOrderNumber = this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//数码编号
  418. LYFZ.Model.Model_ErpOrder ord_model = orbll.GetModel("Ord_Number", this.dgvOrderList.CurrentRow.Cells["Ord_Number"].Value);
  419. LYFZ.Model.Model_ErpOrderDigital vmodel = orvbll.GetModel("Ordv_ViceNumber", ViceOrderNumber);//
  420. LYFZ.BLL.SelectPhotoHandling sPh = new BLL.SelectPhotoHandling(ord_model, vmodel);
  421. string ViceName = "";
  422. if (this.dgvOrderList.CurrentRow.Cells["订单类型"].Value.ToString().Trim() == Convert.ToInt32(LYFZ.EnumPublic.OrderType.儿童订单).ToString().Trim())
  423. {
  424. try
  425. { ViceName = this.dgvOrderList.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim(); }
  426. catch { }
  427. }
  428. List<string> sPhotoList = sPh.GetSpecifyTypePhotoList(Model.Model_ErpOrder.DirectoryType.EarlyRetouch, BLL.SelectPhotoHandling.PhotoType.Original, ViceName);
  429. if (sPhotoList.Count == 0)
  430. { MessageBoxCustom.Show("此单未导片"); return; }
  431. if (!LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword(ViceOrderNumber))
  432. { return; }
  433. //显示对话框
  434. if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  435. {
  436. bool IsImp = false;
  437. LYFZ.ComponentLibrary.FrmLoadHandling.ExecutionDoWorkMethod(delegate(object obj, System.ComponentModel.BackgroundWorker backgroundWorker)
  438. {
  439. LYFZ.PhotoSelectSystem.PhotoImportExport pe = new PhotoSelectSystem.PhotoImportExport(ord_model, vmodel);
  440. IsImp = pe.ExportEarlyRetouchFilm(fbd.SelectedPath.ToString().Trim(), backgroundWorker);
  441. }, width: 500);
  442. if (!IsImp)
  443. { return; }
  444. else { MessageBoxCustom.Show("导出完毕"); return; }
  445. }
  446. }
  447. catch { MessageBoxCustom.Show("导片出错"); }
  448. }
  449. else { MessageBoxCustom.Show("请选择订单"); return; }
  450. }
  451. }
  452. /// <summary>
  453. /// 分片
  454. /// </summary>
  455. /// <param name="sender"></param>
  456. /// <param name="e"></param>
  457. void btnSlice_Click(object sender, EventArgs e)
  458. {
  459. if (this.dgvOrderList.Rows.Count > 0)
  460. {
  461. if (this.dgvOrderList.SelectedRows.Count > 0)
  462. {
  463. string ViceOrderNumber = this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//数码编号
  464. if (!LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.IsEnterPassword(ViceOrderNumber))
  465. { return; }
  466. LYFZ.Model.Model_ErpOrder model = orbll.GetModel("Ord_Number", this.dgvOrderList.CurrentRow.Cells["Ord_Number"].Value);
  467. LYFZ.Model.Model_ErpOrderDigital vmodel = orvbll.GetModel("Ordv_ViceNumber", ViceOrderNumber);//
  468. LYFZ.PhotoSelectSystem.PhotoCategory frm = new PhotoSelectSystem.PhotoCategory(model, vmodel);
  469. if (!frm.IsDisposed)
  470. { frm.ShowDialog(); }
  471. }
  472. }
  473. else { MessageBoxCustom.Show("请选择订单"); }
  474. }
  475. ///导出初修
  476. void btnExportOriginalFilm_Click(object sender, EventArgs e)
  477. {
  478. if (this.dgvOrderList.Rows.Count > 0)
  479. {
  480. if (this.dgvOrderList.SelectedRows.Count > 0)
  481. {
  482. string StrSightsName = "";
  483. string ViceOrderNumber = this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();
  484. if (this.dgvOrderList.CurrentRow.Cells["订单类型"].Value.ToString().Trim() == Convert.ToInt32(LYFZ.EnumPublic.OrderType.儿童订单).ToString().Trim())
  485. {
  486. if (this.dgvOrderList.Columns["拍摄名称"] != null)
  487. { StrSightsName = this.dgvOrderList.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim(); }
  488. }
  489. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ExportOriginalPiece(this.dgvOrderList.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim(), ViceOrderNumber, StrSightsName);
  490. }
  491. else
  492. { MessageBoxCustom.Show("请选择订单"); return; }
  493. }
  494. }
  495. ///导入原片
  496. void btnImportOriginalFilm_Click(object sender, EventArgs e)
  497. {
  498. if (this.dgvOrderList.Rows.Count > 0)
  499. {
  500. string JID = "";
  501. string MainOrderNumber = this.dgvOrderList.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();//主订单号
  502. string ViceOrderNumber = this.dgvOrderList.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim();//副订单号
  503. DataTable photographyDt = bllPhotography.GetPhotographySightByViceNumber(ViceOrderNumber);
  504. if (photographyDt.Rows.Count>0)
  505. {
  506. JID = photographyDt.Rows[0]["ID"].ToString_s();
  507. }
  508. #region 抓数据
  509. if (this.dgvOrderList.SelectedRows.Count <= 0)
  510. { MessageBoxCustom.Show("请选择要导入的景点"); return; }
  511. if (string.IsNullOrEmpty(JID))
  512. { MessageBoxCustom.Show("此单无景点,不能导片!"); return; }
  513. #endregion
  514. //选择拍摄相关人员
  515. LYFZ.Software.MainBusiness.DoorCityProcess.SuperSmallForm.OfficersConfirmSuperSmallForm frm = new SuperSmallForm.OfficersConfirmSuperSmallForm();
  516. frm.OrdNumber = MainOrderNumber;
  517. frm.OrdViceNumber = ViceOrderNumber;
  518. frm.JID = JID;
  519. frm.SightsName = this.dgvOrderList.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim();
  520. if (this.dgvOrderList.CurrentRow.Cells["取件状态"].Value.ToString().Trim() == "OK")
  521. {
  522. MessageBoxCustom.Show("已取件,不能导片!");
  523. frm.rdoYes1.Enabled = false;
  524. frm.rdoNo1.Checked = true;
  525. }
  526. frm.ShowDialog();
  527. this.PublicFunctionRows();
  528. }
  529. }
  530. /// <summary>
  531. /// 查看工作安排
  532. /// </summary>
  533. /// <param name="sender"></param>
  534. /// <param name="e"></param>
  535. void btn_ViewPai_Click(object sender, EventArgs e)
  536. {
  537. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.AnPaiWorkDigitalSmallForm frm = new SetSmallForm.AnPaiWorkDigitalSmallForm();
  538. frm.Text = "数码部工作安排";
  539. frm.ShowDialog();
  540. }
  541. /// <summary>
  542. /// 安排工作
  543. /// </summary>
  544. /// <param name="sender"></param>
  545. /// <param name="e"></param>
  546. void btn_ArrangeWork_Click(object sender, EventArgs e)
  547. {
  548. if (this.dgvOrderList.Rows.Count > 0)
  549. {
  550. if (dgvOrderList.SelectedRows.Count > 0)
  551. {
  552. try
  553. {
  554. if (this.dgvOrderList.CurrentRow.Cells["拍摄状态"].Value.ToString().Trim() != "OK")
  555. { MessageBoxCustom.Show("拍照流程未完成"); return; }
  556. }
  557. catch { }
  558. string strVid = "";
  559. for (int i = 0; i < dgvOrderList.SelectedRows.Count; i++)
  560. {
  561. if (i == 0) { strVid += "'" + dgvOrderList.SelectedRows[i].Cells["Ordv_ViceNumber"].Value.ToString().Trim() + "'"; }
  562. else
  563. { strVid += ",'" + dgvOrderList.SelectedRows[i].Cells["Ordv_ViceNumber"].Value.ToString().Trim() + "'"; }
  564. }
  565. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.AnPaiWorkSmallForm frm = new SetSmallForm.AnPaiWorkSmallForm();
  566. frm.StrViceNumber = strVid;
  567. frm.ShowDialog();
  568. if (frm.IsSave == true)
  569. { this.PublicFunctionRows(); }
  570. }
  571. else { MessageBoxCustom.Show("请选择订单"); }
  572. }
  573. }
  574. void dgvOrderList_MouseDoubleClick(object sender, System.Windows.Forms.MouseEventArgs e)
  575. {
  576. System.Drawing.Point hit = this.dgvOrderList.PointToClient(System.Windows.Forms.Cursor.Position);
  577. System.Windows.Forms.DataGridView.HitTestInfo hitTest = this.dgvOrderList.HitTest(hit.X, hit.Y);
  578. if (hitTest.RowIndex < 0 && hitTest.ColumnIndex < 0)
  579. {
  580. if (!string.IsNullOrEmpty(LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber))
  581. {
  582. LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber = "";
  583. PublicFunctionRows();
  584. }
  585. }
  586. }
  587. void frmDigitalArrangement_Load(object sender, EventArgs e)
  588. {
  589. this.ImageList1.Images.Clear();
  590. this.ImageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
  591. this.ImageList1.ImageSize = new System.Drawing.Size(95, 100);
  592. this.ImageList1.Images.Add(LYFZ.PhotoSelectSystem.MainPhotoSelect.ImageJPGE);
  593. this.PhotoListView.LargeImageList = ImageList1;
  594. this.PhotoListView.View = System.Windows.Forms.View.LargeIcon;
  595. this.cbxPhotoType.SelectedIndexChanged += cbxPhotoType_SelectedIndexChanged;
  596. gbDesign.Enabled = true;
  597. gbPhoto.Enabled = true;
  598. gbRefine.Enabled = true;
  599. gbRepair.Enabled = true;
  600. //this.dgvOrderList.VirtualMode = true;
  601. //this.dgvOrderList.CellValueNeeded += dgvOrderList_CellValueNeeded;
  602. }
  603. void dgvOrderList_CellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
  604. {
  605. //throw new NotImplementedException();
  606. }
  607. void cbxPhotoType_SelectedIndexChanged(object sender, EventArgs e)
  608. {
  609. SelectPhotoTypeGetPhotoData();
  610. }
  611. void dgvOrderList_CellContentDoubleClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
  612. {
  613. if(e.RowIndex<0)
  614. {
  615. return;
  616. }
  617. string ViceOrderNumber = this.dgvOrderList.Rows[e.RowIndex].Cells["Ordv_ViceNumber"].Value.ToString();
  618. string MainOrderNumber = this.dgvOrderList.Rows[e.RowIndex].Cells["Ord_Number"].Value.ToString();
  619. StrSightsName = this.dgvOrderList.Rows[e.RowIndex].Cells["拍摄名称"].Value.ToString();
  620. selectRow = this.dgvOrderList.Rows[e.RowIndex];
  621. LYFZ.PhotoSelectSystem.EventSelectPhotoPrint eventSelectPhotoPrint = null;
  622. LYFZ.BLL.BLL_ErpOrderDigital mydbll = new LYFZ.BLL.BLL_ErpOrderDigital();
  623. LYFZ.BLL.BLL_ErpOrder obll = new BLL.BLL_ErpOrder();
  624. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, System.ComponentModel.BackgroundWorker backgroundWorker)
  625. {
  626. backgroundWorker.ReportProgress(0, "正在获取相应数据....");
  627. vmodel = mydbll.GetModel("Ordv_ViceNumber", ViceOrderNumber);
  628. model = obll.GetModel("Ord_Number", MainOrderNumber);
  629. eventSelectPhotoPrint = LYFZ.PhotoSelectSystem.frmSaveSelectPhotoInfo.GetStaticSelectPhotoPrint(model, vmodel);
  630. });
  631. this.dgvPackage.Rows.Clear();
  632. List<LYFZ.PhotoSelectSystem.MakingProduct> ptlist = eventSelectPhotoPrint.MakingProductList;
  633. if (ptlist.Count > 0)
  634. {
  635. for (int i = 0; i < ptlist.Count; i++)
  636. {
  637. LYFZ.PhotoSelectSystem.MakingProduct mpdt = ptlist[i];
  638. LYFZ.Model.Model_ErpOrderProductList mdl = mpdt.OrderProduct;
  639. System.Windows.Forms.DataGridViewRow row = new System.Windows.Forms.DataGridViewRow();
  640. System.Windows.Forms.DataGridViewTextBoxCell cell = new System.Windows.Forms.DataGridViewTextBoxCell();
  641. cell.Value = mdl.OPlist_ProdName;
  642. row.Cells.Add(cell);
  643. cell = new System.Windows.Forms.DataGridViewTextBoxCell();
  644. cell.Value = mdl.OPlist_Batch.ToString().Trim();
  645. row.Cells.Add(cell);
  646. cell = new System.Windows.Forms.DataGridViewTextBoxCell();
  647. cell.Value = mdl.OPlist_ProdQuantity.ToString().Trim();
  648. row.Cells.Add(cell);
  649. cell = new System.Windows.Forms.DataGridViewTextBoxCell();
  650. cell.Value = mdl.OPlist_IsExpedited ? "加急件" : "普通件"; ;
  651. row.Cells.Add(cell);
  652. cell = new System.Windows.Forms.DataGridViewTextBoxCell();
  653. cell.Value = mdl.OPlist_PickupTime == null ? "" : mdl.OPlist_PickupTime.Value.ToString("yyyy-MM-dd");
  654. row.Cells.Add(cell);
  655. cell = new System.Windows.Forms.DataGridViewTextBoxCell();
  656. cell.Value = mdl.OPlist_PickUpType;
  657. row.Cells.Add(cell);
  658. cell = new System.Windows.Forms.DataGridViewTextBoxCell();
  659. cell.Value = mdl.OPlist_Remark;
  660. row.Cells.Add(cell);
  661. int photoCount = 0;
  662. string StrPhoto = eventSelectPhotoPrint.GetSelectProductPhotoNameString(mdl.OPlist_UniquelyIdentity.ToString(), ref photoCount);//所用照片
  663. cell = new System.Windows.Forms.DataGridViewTextBoxCell();
  664. cell.Value = StrPhoto;
  665. row.Cells.Add(cell);
  666. this.dgvPackage.Rows.Add(row);
  667. }
  668. }
  669. SelectPhotoTypeGetPhotoData();
  670. //SetFunctionButton();
  671. }
  672. void SetFunctionButton()
  673. {
  674. if(!selectRow.Cells["拍照状态"].Value.ToString().Contains("OK"))
  675. {
  676. this.gbPhoto.Enabled = true;
  677. }
  678. else
  679. {
  680. this.gbPhoto.Enabled = false;
  681. }
  682. if (!selectRow.Cells["初修状态"].Value.ToString().Contains("OK"))
  683. {
  684. this.gbRepair.Enabled = true;
  685. }
  686. else
  687. {
  688. this.gbRepair.Enabled = false;
  689. }
  690. if (!selectRow.Cells["精修状态"].Value.ToString().Contains("OK"))
  691. {
  692. this.gbRefine.Enabled = true;
  693. }
  694. else
  695. {
  696. this.gbRefine.Enabled = false;
  697. }
  698. if (!selectRow.Cells["设计状态"].Value.ToString().Contains("OK"))
  699. {
  700. this.gbDesign.Enabled = true;
  701. }
  702. else
  703. {
  704. this.gbDesign.Enabled = false;
  705. }
  706. }
  707. public void SelectPhotoTypeGetPhotoData()
  708. {
  709. this.ImageList1.Images.Clear();
  710. this.PhotoListView.Items.Clear();
  711. LYFZ.Model.Model_ErpOrder.DirectoryType _dirType = Model.Model_ErpOrder.DirectoryType.PrimitivePicture;
  712. switch (cbxPhotoType.Text.Replace(" ",""))
  713. {
  714. case "原片":
  715. _dirType = Model.Model_ErpOrder.DirectoryType.PrimitivePicture;
  716. break;
  717. case "初修":
  718. _dirType = Model.Model_ErpOrder.DirectoryType.EarlyRetouch;
  719. break;
  720. case "精修":
  721. _dirType = Model.Model_ErpOrder.DirectoryType.FineRetouch;
  722. break;
  723. case "设计":
  724. _dirType = Model.Model_ErpOrder.DirectoryType.DesignPiece;
  725. break;
  726. }
  727. if(vmodel!=null&&model!=null)
  728. {
  729. GetPhotoData(model, vmodel, _dirType, StrSightsName);
  730. }
  731. }
  732. public void GetPhotoData(LYFZ.Model.Model_ErpOrder _model, LYFZ.Model.Model_ErpOrderDigital _vmodel, LYFZ.Model.Model_ErpOrder.DirectoryType _dirType, string _StrSightsName)
  733. {
  734. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, System.ComponentModel.BackgroundWorker backgroundWorker)
  735. {
  736. backgroundWorker.ReportProgress(0, "正在获取照片信息....");
  737. LYFZ.BLL.SelectPhotoHandling sPh = new BLL.SelectPhotoHandling(_model, _vmodel);
  738. if (model.Ord_Type != "1")
  739. {
  740. StrSightsName = "";
  741. }
  742. List<string> photoList = sPh.GetSpecifyTypePhotoList(_dirType, BLL.SelectPhotoHandling.PhotoType.Small, _StrSightsName);
  743. for (int i = 0; i < photoList.Count; i++)
  744. {
  745. string PhotoPath = photoList[i].Trim();
  746. string PreviewPath = LYFZ.BLL.SelectPhotoHandling.SmallPathToPreviewPath(PhotoPath);
  747. if (!this.ImageList1.Images.ContainsKey(PreviewPath))
  748. {
  749. System.Drawing.Image smallImage = LYFZ.ImageFunction.ImageOperation.GetNewBitmap(PhotoPath);
  750. this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
  751. {
  752. this.ImageList1.Images.Add(PreviewPath, smallImage);
  753. this.PhotoListView.Items.Add(System.IO.Path.GetFileName(PreviewPath).Replace("Preview_", ""), i);
  754. //RefreshShowPhotoImageList();
  755. }));
  756. }
  757. }
  758. });
  759. }
  760. void labDesign_Click(object sender, EventArgs e)
  761. {
  762. //Dictionary<string, string> tempColumns = new Dictionary<string, string>();
  763. List<DataRow> drList = new List<DataRow>();
  764. DataTable orderDataList = htData["DTable"] as DataTable;
  765. List<string> tempOrdValue = new List<string>();
  766. if(labSendData.Checked)
  767. {
  768. //DataRow[] tempDrList = orderDataList.Select(" Ord_Number in ('" + string.Join("','", sendColumns.Keys.ToArray()) + "') ");
  769. //foreach(string key in sendColumns)
  770. //{
  771. // if(!tempColumns.ContainsKey(key))
  772. // {
  773. // tempColumns.Add(key,"");
  774. // }
  775. //}
  776. if (sendColumns.Count == 0)
  777. {
  778. tempOrdValue.Add("-1");
  779. }
  780. else
  781. {
  782. tempOrdValue.AddRange(sendColumns);
  783. }
  784. //drList.AddRange(tempDrList);
  785. }
  786. if (labDesign.Checked)
  787. {
  788. //DataRow[] tempDrList = orderDataList.Select(" Ord_Number in ('" + string.Join("','", designColumns.Keys.ToArray()) + "') ");
  789. //drList.AddRange(tempDrList);
  790. //foreach (string key in designColumns)
  791. //{
  792. // if (!tempColumns.ContainsKey(key))
  793. // {
  794. // tempColumns.Add(key, "");
  795. // }
  796. //}
  797. if (designColumns.Count == 0)
  798. {
  799. tempOrdValue.Add("-1");
  800. }
  801. else
  802. {
  803. tempOrdValue.AddRange(designColumns);
  804. }
  805. }
  806. if (this.labRefineRepair.Checked)
  807. {
  808. //DataRow[] tempDrList = orderDataList.Select(" Ord_Number in ('" + string.Join("','", refinementColumns.Keys.ToArray()) + "') ");
  809. //drList.AddRange(tempDrList);
  810. //foreach (string key in refinementColumns)
  811. //{
  812. // if (!tempColumns.ContainsKey(key))
  813. // {
  814. // tempColumns.Add(key, "");
  815. // }
  816. //}
  817. //if (tempColumns.Count == 0)
  818. //{
  819. // tempColumns.Add("-1", "");
  820. //}
  821. if (refinementColumns.Count == 0)
  822. {
  823. tempOrdValue.Add("-1");
  824. }
  825. else
  826. {
  827. tempOrdValue.AddRange(refinementColumns);
  828. }
  829. }
  830. if (labEarlyRepair.Checked)
  831. {
  832. //DataRow[] tempDrList = orderDataList.Select(" Ord_Number in ('" + string.Join("','", earlyRepairColumns.Keys.ToArray()) + "') ");
  833. //drList.AddRange(tempDrList);
  834. //foreach (string key in earlyRepairColumns)
  835. //{
  836. // if (!tempColumns.ContainsKey(key))
  837. // {
  838. // tempColumns.Add(key, "");
  839. // }
  840. //}
  841. //if (tempColumns.Count == 0)
  842. //{
  843. // tempColumns.Add("-1", "");
  844. //}
  845. if (earlyRepairColumns.Count == 0)
  846. {
  847. tempOrdValue.Add("-1");
  848. }
  849. else
  850. {
  851. tempOrdValue.AddRange(earlyRepairColumns);
  852. }
  853. }
  854. tempOrdValue = tempOrdValue.GroupBy(t => t).Select(t => t.First()).ToList();
  855. if (orderDataList.Rows.Count > 0 && (tempOrdValue.Count > 0 || !string.IsNullOrEmpty(txt_QueryText.Text)))
  856. {
  857. DataTable dtList = new DataTable();
  858. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, System.ComponentModel.BackgroundWorker backgroundWorker)
  859. {
  860. //DataRow[] tempDrList = orderDataList.Select(" Ord_Number in ('" + string.Join("','", tempColumns.Keys.ToArray()) + "') ");
  861. if (tempOrdValue.Count > 0 && string.IsNullOrEmpty(txt_QueryText.Text))
  862. {
  863. dtList = orderDataList.AsEnumerable().Where(p => tempOrdValue.Contains(p.Field<string>("Ord_Number"))).CopyToDataTable<DataRow>();
  864. }
  865. else
  866. {
  867. dtList = orderDataList.AsEnumerable().Where(p => (p.Field<string>("Ord_Number") == txt_QueryText.Text || p.Field<string>("客户电话").IndexOf(txt_QueryText.Text) != -1 || p.Field<string>("客户姓名").IndexOf(txt_QueryText.Text) != -1)).CopyToDataTable<DataRow>();
  868. }
  869. });
  870. if (dtList.Rows.Count > 0)
  871. {
  872. //foreach (DataColumn colum in tempDrList[0].Table.Columns)
  873. //{
  874. // dtList.Columns.Add(colum.ColumnName);
  875. //}
  876. //foreach (DataRow dr in tempDrList)
  877. //{
  878. // DataRow tempDr = dtList.NewRow();
  879. // foreach (DataColumn colum in dtList.Columns)
  880. // {
  881. // tempDr[colum.ColumnName] = dr[colum.ColumnName];
  882. // }
  883. // dtList.Rows.Add(tempDr);
  884. //}
  885. LYFZ.ComponentLibrary.DataGridOrderView.GetData_ReplaceDigitalArrange(dgvOrderList, dictColumns, dtList, dtList.Rows.Count);
  886. }
  887. else
  888. {
  889. dgvOrderList.Rows.Clear();
  890. }
  891. }
  892. else
  893. {
  894. LYFZ.ComponentLibrary.DataGridOrderView.GetData_ReplaceDigitalArrange(dgvOrderList, dictColumns, orderDataList, orderDataList.Rows.Count);
  895. }
  896. }
  897. void cbxDropDownList_ComboBoxTreeViewEx_TextChanged(object sender, System.Windows.Forms.TreeViewEventArgs e)
  898. {
  899. this.PublicFunctionRights();
  900. this.PublicFunctionRows();
  901. }
  902. void frmDigitalArrangement_Shown(object sender, EventArgs e)
  903. {
  904. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName(this.cbxDropDownList, StrGroupKeyCode: "retailProcess", StrKeyCode: "st014");
  905. PublicFunctionRights();
  906. this.PublicFunctionRows();
  907. }
  908. /// <summary>
  909. /// 选择分店获取权限
  910. /// </summary>
  911. void PublicFunctionRights()
  912. {
  913. ///我的工作权限
  914. this.btn_ArrangeWork.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cbxDropDownList, "StoresDigital", LYFZ.CustomAttributes.OperatingAuthority.AnPaiWork);
  915. this.btn_ViewPai.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cbxDropDownList, "StoresDigital", LYFZ.CustomAttributes.OperatingAuthority.SeeAnPaiWork);
  916. ///设计权限
  917. this.btnImportDesign.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cbxDropDownList, "StoresDesign", LYFZ.CustomAttributes.OperatingAuthority.PhotoImport);
  918. this.btnExportDesign.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cbxDropDownList, "StoresDesign", LYFZ.CustomAttributes.OperatingAuthority.PhotoExport);
  919. ///拍照
  920. this.btnImportOriginalFilm.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cbxDropDownList, "StoresPhotograph", LYFZ.CustomAttributes.OperatingAuthority.PhotoImport);
  921. ///初修
  922. this.btnExportOriginalFilm.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cbxDropDownList, "StoresPhotograph", LYFZ.CustomAttributes.OperatingAuthority.PhotoExport);
  923. this.btnImportRepairFilm.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cbxDropDownList, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.PhotoImport);
  924. this.btnExportRepair.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cbxDropDownList, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.PhotoExport);
  925. //this.btnViewRepairedPiece.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cbxDropDownList, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.PhotoView);
  926. this.btnSlice.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cbxDropDownList, "StoresRepairPiece", LYFZ.CustomAttributes.OperatingAuthority.RepairPieceSeparatePhoto);
  927. ///精修
  928. this.btnExportSelectFilm.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cbxDropDownList, "StoresFilmSelection", LYFZ.CustomAttributes.OperatingAuthority.PhotoExport);
  929. this.btnImportRefine.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cbxDropDownList, "StoresRefinedRepair", LYFZ.CustomAttributes.OperatingAuthority.PhotoImport);
  930. this.btnExportRefine.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cbxDropDownList, "StoresRefinedRepair", LYFZ.CustomAttributes.OperatingAuthority.PhotoExport);
  931. //this.btnViewRefinedPiece.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cbxDropDownList, "StoresRefinedRepair", LYFZ.CustomAttributes.OperatingAuthority.PhotoView);
  932. }
  933. /// <summary>
  934. /// 当前点击的字段
  935. /// </summary>
  936. string StrCurrentClickField = "";
  937. /// <summary>
  938. /// 排序字段
  939. /// </summary>
  940. string StrSortField = "Ord_CreateDateTime DESC,Ordv_DigitalNumber";
  941. /// <summary>
  942. /// 排序顺序
  943. /// </summary>
  944. string StrSortOrder = "DESC";
  945. /// <summary>
  946. /// 创建行
  947. /// </summary>
  948. void PublicFunctionRows()
  949. {
  950. this.dgvOrderList.Rows.Clear();
  951. this.dgvPackage.Rows.Clear();
  952. this.ImageList1.Images.Clear();
  953. this.PhotoListView.Items.Clear();
  954. this.dgvOrderList.dgvCurrentColumnOriginalSet = "Ord_Number,Ordv_ViceNumber,Ordv_EarlyRepairStatus,Ordv_RefinementStatus,Ordv_DesignerStatus,订单号,客户姓名,客户性别,客户电话,婚期,订单类型,接单人,套系名称,套系价格,加急,加急日期,拍摄名称,拍照状态,初修状态,初修日期,选片状态,选片日期,精修状态,精修日期,设计状态,设计日期,看版状态,看版日期,取件状态,会员卡号,发片状态";
  955. string StrGuidName = "";
  956. if ((LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.MemberCardShowHide))
  957. {
  958. this.dgvOrderList.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,会员卡号,发片状态,Ordv_EarlyRepairStatus,Ordv_RefinementStatus,Ordv_DesignerStatus";
  959. }
  960. else
  961. {
  962. this.dgvOrderList.dgvFixedHideColumn = "Ord_Number,Ordv_ViceNumber,发片状态,Ordv_EarlyRepairStatus,Ordv_RefinementStatus,Ordv_DesignerStatus";
  963. }
  964. this.dgvOrderList.dgvGuidName = StrGuidName;
  965. this.dgvOrderList.dgvUserEmployeeID = this.StrUserID;
  966. this.dgvOrderList.StrValueNullColumn = "订单号,客户姓名,客户性别,客户电话,婚期,订单类型,接单人,套系名称,套系价格,加急,加急日期,会员卡号";
  967. this.dgvOrderList.DataColumns(this.dgvOrderList.dgvCurrentColumnOriginalSet, strHideField: this.dgvOrderList.dgvFixedHideColumn);
  968. dictColumns = LYFZ.DAL.DAL_GridViewDisplayIndex.GetGridViewShowColumns(this.StrUserID, StrGuidName, this.dgvOrderList.dgvCurrentColumnOriginalSet);
  969. this.dgvOrderList.dictShowColumName = dictColumns;
  970. string StrQueryCondition = "";
  971. LYFZ.ComponentLibrary.CheckBoxEx checkBox = new ComponentLibrary.CheckBoxEx() { Checked = false };
  972. if (IsFirstRun && !string.IsNullOrEmpty(LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber))
  973. {
  974. string StrWhere = " Where (Ords_PhotographIntStatus in (1,2)) And Ord_Class = '1' And Ord_SinceOrderNumber = '" + LYFZ.BLL.BLL_ErpOrder.CurrentSelectedOrderNumber + "'" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL(checkBox, checkBox, checkBox, StrOrdType: "0,1,2");
  975. StrQueryCondition = StrWhere + (this.cbxDropDownList.Tag.ToString()==""?"": LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryOrderClickWhere(this.cbxDropDownList, "Ord_DividedShop"));
  976. }
  977. else
  978. { StrQueryCondition = this.GetWhereStr(); }
  979. int intTopCount =10000;
  980. htData = LYFZ.ComponentLibrary.DataGridOrderView.GetData_OrderDigitalArrange(this.dgvOrderList, dictColumns, StrQueryCondition, intTopCount, StrSortField,1);
  981. BindPublicFunction();
  982. }
  983. void BindPublicFunction()
  984. {
  985. int earlyRepairCount = 0;
  986. int refinementCount = 0;
  987. int designCount = 0;
  988. int sendCount = 0;
  989. earlyRepairColumns.Clear();
  990. refinementColumns.Clear();
  991. designColumns.Clear();
  992. sendColumns.Clear();
  993. this.tempPanelEx1.Visible = true;
  994. System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(delegate(object obj)
  995. {
  996. DataTable orderDataList = htData["DTable"] as DataTable;
  997. earlyRepairColumns = orderDataList.AsEnumerable().Where(p => p.Field<string>("Ordv_EarlyRepairStatus") == "0" || p.Field<string>("Ordv_EarlyRepairStatus") == "1").Select(p => p.Field<string>("Ord_Number")).ToList<string>();
  998. refinementColumns = orderDataList.AsEnumerable().Where(p => p.Field<string>("Ordv_RefinementStatus") == "0" || p.Field<string>("Ordv_RefinementStatus") == "1").Select(p => p.Field<string>("Ord_Number")).ToList<string>();
  999. designColumns = orderDataList.AsEnumerable().Where(p => p.Field<string>("Ordv_DesignerStatus") == "0" || p.Field<string>("Ordv_DesignerStatus") == "1").Select(p => p.Field<string>("Ord_Number")).ToList<string>();
  1000. sendColumns = orderDataList.AsEnumerable().Where(p => p.Field<int>("发片状态") == 1).Select(p => p.Field<string>("Ord_Number")).ToList<string>();
  1001. //foreach (DataRow dr in orderDataList.Rows)
  1002. //{
  1003. // string ordNumber = dr["Ord_Number"].ToString_s();
  1004. // if (!earlyRepairColumns.ContainsKey(ordNumber))
  1005. // {
  1006. // DataRow[] dtList = orderDataList.Select(" Ord_Number = '" + ordNumber + "' and Ordv_EarlyRepairStatus in ('0','1') ");
  1007. // if (dtList.Length > 0)
  1008. // {
  1009. // if (!earlyRepairColumns.ContainsKey(ordNumber))
  1010. // {
  1011. // earlyRepairColumns.Add(ordNumber, "1");
  1012. // }
  1013. // }
  1014. // }
  1015. // if (!refinementColumns.ContainsKey(ordNumber))
  1016. // {
  1017. // DataRow[] dtList = orderDataList.Select(" Ord_Number = '" + ordNumber + "' and Ordv_RefinementStatus in ('0','1') ");
  1018. // if (dtList.Length > 0)
  1019. // {
  1020. // if (!refinementColumns.ContainsKey(ordNumber))
  1021. // {
  1022. // refinementColumns.Add(ordNumber, "1");
  1023. // }
  1024. // }
  1025. // }
  1026. // if (!designColumns.ContainsKey(ordNumber))
  1027. // {
  1028. // DataRow[] dtList = orderDataList.Select(" Ord_Number = '" + ordNumber + "' and Ordv_DesignerStatus in ('0','1') ");
  1029. // if (dtList.Length > 0)
  1030. // {
  1031. // if (!designColumns.ContainsKey(ordNumber))
  1032. // {
  1033. // designColumns.Add(ordNumber, "1");
  1034. // }
  1035. // }
  1036. // }
  1037. // if (!sendColumns.ContainsKey(ordNumber))
  1038. // {
  1039. // DataRow[] dtList = orderDataList.Select(" Ord_Number = '" + ordNumber + "' and 发片状态 in ('1') ");
  1040. // if (dtList.Length > 0)
  1041. // {
  1042. // if (!sendColumns.ContainsKey(ordNumber))
  1043. // {
  1044. // sendColumns.Add(ordNumber, "1");
  1045. // }
  1046. // }
  1047. // }
  1048. //}
  1049. labEarlyRepair.Text = "初修(" + earlyRepairColumns.Count + ")";
  1050. labDesign.Text = "设计(" + designColumns.Count + ")";
  1051. labRefineRepair.Text = "精修(" + refinementColumns.Count + ")";
  1052. labSendData.Text = "发片(" + sendColumns.Count + ")";
  1053. }));
  1054. thread.Start();
  1055. }
  1056. /// <summary>
  1057. /// 返回要操作的条件
  1058. /// </summary>
  1059. /// <returns></returns>
  1060. string GetWhereStr()
  1061. {
  1062. LYFZ.ComponentLibrary.CheckBoxEx checkBox = new ComponentLibrary.CheckBoxEx() { Checked = false };
  1063. string StrWhere = " Where (Ords_PhotographIntStatus in (1,2) or Ordv_EarlyRepairStatus in ('1','2')) And Ord_Class = '1' " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cbxDropDownList, "Ord_DividedShop");
  1064. if (DictData.ContainsKey("PhotographyStatus") && DictData["PhotographyStatus"].Trim().Length > 0)
  1065. { StrWhere += " and Ords_PhotographStatus = '" + DictData["PhotographyStatus"].Trim() + "'"; }
  1066. if (DictData.ContainsKey("EarlyRepairStatus") && DictData["EarlyRepairStatus"].Trim().Length > 0)
  1067. { StrWhere += " and Ordv_EarlyRepairStatus = '" + DictData["EarlyRepairStatus"].Trim() + "'"; }
  1068. if (DictData.ContainsKey("FilmSelectionStatus") && DictData["FilmSelectionStatus"].Trim().Length > 0)
  1069. { StrWhere += " and Ordv_FilmSelectionStatus = '" + DictData["FilmSelectionStatus"].Trim() + "'"; }
  1070. if (DictData.ContainsKey("RefinementStatus") && DictData["RefinementStatus"].Trim().Length > 0)
  1071. { StrWhere += " and Ordv_RefinementStatus = '" + DictData["RefinementStatus"].Trim() + "'"; }
  1072. if (DictData.ContainsKey("DesignStatus") && DictData["DesignStatus"].Trim().Length > 0)
  1073. { StrWhere += " and Ordv_DesignerStatus = '" + DictData["DesignStatus"].Trim() + "'"; }
  1074. if (DictData.ContainsKey("LookDesignStatus") && DictData["LookDesignStatus"].Trim().Length > 0)
  1075. { StrWhere += " and Ordv_LookDesignStatus = '" + DictData["LookDesignStatus"].Trim() + "'"; }
  1076. StrWhere += " And Ords_ProductPickupIntStatus in (0,1)";
  1077. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetVersionQuerySQL(
  1078. checkBox,
  1079. checkBox,
  1080. checkBox, StrOrdType: "0,1,2");
  1081. if (DictData.ContainsKey("FilmSelectionStartDateTime") && DictData["FilmSelectionStartDateTime"].Length > 0 && DictData.ContainsKey("FilmSelectionEndDateTime") && DictData["FilmSelectionEndDateTime"].Length > 0)
  1082. { StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("isnull(Ordv_FilmSelectionTime,Ordv_ReservationFilmSelectionTime)", DictData["FilmSelectionStartDateTime"], DictData["FilmSelectionEndDateTime"]); }
  1083. if (DictData.ContainsKey("LookDesignStartDateTime") && DictData["LookDesignStartDateTime"].Length > 0 && DictData.ContainsKey("LookDesignEndDateTime") && DictData["LookDesignEndDateTime"].Length > 0)
  1084. { StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("isnull(Ordv_LookDesignTime,Ordv_ReservationLookDesignTime)", DictData["LookDesignStartDateTime"].Trim(), DictData["LookDesignEndDateTime"].Trim()); }
  1085. if (cbxMyJob.Checked)
  1086. {
  1087. string tempStrWhere = "";
  1088. if (!labEarlyRepair.Checked && !labRefineRepair.Checked && !labDesign.Checked && !labSendData.Checked)
  1089. {
  1090. tempStrWhere += " Ordv_ReservationEarlyRepairName = '" + StrUserID + "' ";
  1091. tempStrWhere += " or ";
  1092. tempStrWhere += " Ordv_ReservationRefinementName = '" + StrUserID + "' ";
  1093. tempStrWhere += " or ";
  1094. tempStrWhere += " Ordv_ReservationDesignerName = '" + StrUserID + "' ";
  1095. tempStrWhere += " or ";
  1096. tempStrWhere += " Ordv_ReservationSendPhotoName = '" + StrUserID + "' ";
  1097. }
  1098. if (labEarlyRepair.Checked)
  1099. {
  1100. if (!string.IsNullOrEmpty(tempStrWhere))
  1101. {
  1102. tempStrWhere += " or ";
  1103. }
  1104. tempStrWhere += " Ordv_ReservationEarlyRepairName = '" + StrUserID + "' ";
  1105. }
  1106. if (labRefineRepair.Checked)
  1107. {
  1108. if (!string.IsNullOrEmpty(tempStrWhere))
  1109. {
  1110. tempStrWhere += " or ";
  1111. }
  1112. tempStrWhere += " Ordv_ReservationRefinementName = '" + StrUserID + "' ";
  1113. }
  1114. if (labDesign.Checked)
  1115. {
  1116. if (!string.IsNullOrEmpty(tempStrWhere))
  1117. {
  1118. tempStrWhere += " or ";
  1119. }
  1120. tempStrWhere += " Ordv_ReservationDesignerName = '" + StrUserID + "' ";
  1121. }
  1122. if(labSendData.Checked)
  1123. {
  1124. if (!string.IsNullOrEmpty(tempStrWhere))
  1125. {
  1126. tempStrWhere += " or ";
  1127. }
  1128. tempStrWhere += " Ordv_ReservationSendPhotoName = '" + StrUserID + "' ";
  1129. }
  1130. if (!string.IsNullOrEmpty(tempStrWhere))
  1131. {
  1132. if (!string.IsNullOrEmpty(StrWhere))
  1133. {
  1134. StrWhere += " and ";
  1135. }
  1136. StrWhere += "( " + tempStrWhere + " )";
  1137. }
  1138. }
  1139. return StrWhere;
  1140. }
  1141. }
  1142. }