MyWorkRemindFormMain.cs 86 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963
  1. using LYFZ.ComponentLibrary;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. namespace LYFZ.Software.MainBusiness.CameraControlBook
  12. {
  13. public partial class MyWorkRemindFormMain : LYFZ.Software.UI.CameraControlBook.MyWorkRemindFormMain
  14. {
  15. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  16. string dataType = "";
  17. public MyWorkRemindFormMain()
  18. {
  19. this.Shown += MyWorkRemindFormMain_Shown;
  20. this.Load += MyWorkRemindFormMain_Load;
  21. this.numYear.KeyDown += numYear_KeyDown;
  22. this.numMonth.KeyDown += numMonth_KeyDown;
  23. this.numDay.KeyDown += numDay_KeyDown;
  24. this.numYear.ValueChanged += numYear_ValueChanged;
  25. this.numMonth.ValueChanged += numMonth_ValueChanged;
  26. this.numDay.ValueChanged += numDay_ValueChanged;
  27. this.chkCompletedOK.Click += chkCompletedOK_Click;
  28. this.chkCompletedNot.Click += chkCompletedNot_Click;
  29. this.chkCompletedTimeOut.Click += chkCompletedTimeOut_Click;
  30. this.panelDay.Click += panelDay_Click;
  31. this.lbl_Clothing.Click += lbl_Clothing_Click;
  32. this.lbl_Photography.Click += lbl_Photograph_Click;
  33. this.lbl_PhotographyAssistant.Click += lbl_Photograph_Click;
  34. this.lbl_Makeup.Click += lbl_Photograph_Click;
  35. this.lbl_MakeupAssistant.Click += lbl_Photograph_Click;
  36. this.lbl_BootDivision.Click += lbl_Photograph_Click;
  37. this.lbl_BootDivisionAssistant.Click += lbl_Photograph_Click;
  38. this.lbl_EarlyRepair.Click += lbl_EarlyRepair_Click;
  39. this.lbl_FilmSelection.Click += lbl_FilmSelection_Click;
  40. this.lbl_RefinedRepair.Click += lbl_RefinedRepair_Click;
  41. this.lbl_Design.Click += lbl_Design_Click;
  42. this.lbl_LookDesign.Click += lbl_BootDivision_Click;
  43. this.lbl_SendPhoto.Click += lbl_BootDivision_Click;//lbl_SendPhoto_Click ;
  44. this.lbl_Pickup.Click += lbl_BootDivision_Click;
  45. this.lbl_Service.Click += lbl_BootDivision_Click;
  46. this.lbl_ClientServiceTask.Click += lbl_ClientServiceTask_Click;
  47. this.lbl_TodayTrack.Click += lbl_TodayTrack_Click;
  48. this.lbl_MemorialDay.Click += lbl_Birthday_Click;
  49. this.lbl_Marriage.Click += lbl_Birthday_Click;
  50. this.lbl_HundredDay.Click += lbl_Birthday_Click;
  51. this.lbl_FullMoon.Click += lbl_Birthday_Click;
  52. this.lbl_Birthday.Click += lbl_Birthday_Click;
  53. this.dgvData.CellDoubleClick += dgvData_CellDoubleClick;
  54. //this.dgvData2.CellDoubleClick += dgvData2_CellDoubleClick;
  55. this.dgvData3.CellMouseDoubleClick += dgvData3_CellMouseDoubleClick;
  56. this.chkAllUserWork.Click += chkAllUserWork_Click;
  57. this.FormClosed += MyWorkRemindFormMain_FormClosed;
  58. this.tabControlEx1.SelectedIndexChanged += tabControlEx1_SelectedIndexChanged;
  59. this.lblMyTaskCount.Click += lblMyTaskCount_Click;
  60. this.dgvData.BindFilterColumnDataEvent += dgvData_DataBindingComplete;
  61. }
  62. private void lbl_SendPhoto_Click(object sender, EventArgs e)
  63. {
  64. LYFZ.Software.MainBusiness.DoorCityProcess.frmDigitalArrangement digitalForm = new DoorCityProcess.frmDigitalArrangement();
  65. digitalForm.labSendData.Checked = true;
  66. digitalForm.cbxMyJob.Checked = true;
  67. digitalForm.BindPostionSize();
  68. digitalForm.Show();
  69. this.Close();
  70. }
  71. void dgvData_DataBindingComplete()
  72. {
  73. //throw new NotImplementedException();
  74. if (dataType == "设计" || dataType == "精修" || dataType == "选片" || dataType == "选衣" || dataType == "初修")
  75. {
  76. string keyNumber = "";
  77. foreach (DataGridViewRow tempDgvr in dgvData.Rows)
  78. {
  79. if (keyNumber != tempDgvr.Cells["订单编号"].Value.ToString())
  80. {
  81. keyNumber = tempDgvr.Cells["订单编号"].Value.ToString();
  82. }
  83. else
  84. {
  85. tempDgvr.Cells["订单编号"].Value = "";
  86. tempDgvr.Cells["客户名称"].Value = "";
  87. tempDgvr.Cells["客户电话"].Value = "";
  88. tempDgvr.Cells["套系名称"].Value = "";
  89. tempDgvr.Cells["套系价格"].Value = "";
  90. }
  91. }
  92. }
  93. }
  94. private void lbl_Design_Click(object sender, EventArgs e)
  95. {
  96. //LYFZ.Software.MainBusiness.DoorCityProcess.frmDigitalArrangement digitalForm = new DoorCityProcess.frmDigitalArrangement();
  97. //digitalForm.labDesign.Checked = true;
  98. //digitalForm.cbxMyJob.Checked = true;
  99. //digitalForm.BindPostionSize();
  100. //digitalForm.Show();
  101. //this.Close();
  102. if (this.panelDay.Tag != null)
  103. {
  104. this.dgvData.Tag = null;
  105. this.dgvData.Rows.Clear();
  106. this.dgvData.Columns.Clear();
  107. //BindDataTableColumData();
  108. //this.dgvData2.Rows.Clear();
  109. LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender;
  110. string[] StrArray = lbl.Name.Trim().Split('_');
  111. Dictionary<string, DataTable> dictData = (Dictionary<string, DataTable>)this.panelDay.Tag;
  112. //DataTable dtData = (DataTable)dictData["dtOrder"];
  113. string StrDataTime = Convert.ToDateTime(this.numYear.Value + "-" + this.numMonth.Value + "-" + this.numDay.Value).ToYYYY_MM_dd();
  114. DataTable dtData;
  115. if (dictData.ContainsKey("dtDesignOrder"))
  116. {
  117. dtData = (DataTable)dictData["dtDesignOrder"];
  118. }
  119. else
  120. {
  121. string StrWhere = "";
  122. StrWhere = " Ordv_DesignerStatus in ('0', '1') And Ordv_ReservationDesignerTime is not null ";
  123. dtData = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayDesignWorkData(StrWhere);
  124. dictData["dtDesignOrder"] = dtData;
  125. }
  126. string strWhere = "";
  127. if (!chkAllUserWork.Checked)
  128. {
  129. //GetPhotographyByWhereData(StrArray[1], ref strKey, ref strContent);
  130. strWhere = " 设计师编号 = '" + StrUserID + "' and 完成期限 >='" + StrDataTime + " 00:00:00' and 完成期限 <='" + StrDataTime + " 23:59:59' ";
  131. }
  132. ///字段数据
  133. foreach (DataColumn dtColum in dtData.Columns)
  134. {
  135. DataGridViewTextBoxColumn textBoxColum = new DataGridViewTextBoxColumn();
  136. textBoxColum.DataPropertyName = dtColum.ColumnName;
  137. textBoxColum.Name = dtColum.ColumnName;
  138. textBoxColum.HeaderText = dtColum.ColumnName;
  139. if (dtColum.ColumnName.Equals("设计师编号"))
  140. {
  141. textBoxColum.Visible = false;
  142. }
  143. if (dtColum.ColumnName.Equals("订单号"))
  144. {
  145. textBoxColum.Visible = false;
  146. }
  147. dgvData.Columns.Add(textBoxColum);
  148. }
  149. ///工作内容
  150. DataGridViewTextBoxColumn tempTextBoxColum = new DataGridViewTextBoxColumn();
  151. tempTextBoxColum.Name = "工作内容";
  152. tempTextBoxColum.DataPropertyName = "工作内容";
  153. tempTextBoxColum.HeaderText = "工作内容";
  154. tempTextBoxColum.Visible = false;
  155. dgvData.Columns.Add(tempTextBoxColum);
  156. DataRow[] dtRows = dtData.Select(strWhere);
  157. string keyNumber = "";
  158. foreach (DataRow dtRow in dtRows)
  159. {
  160. DataGridViewRow tempDgvr = this.BindClothDataListByRow(dtRow, "设计");
  161. if (keyNumber != dtRow["订单编号"].ToString())
  162. {
  163. keyNumber = dtRow["订单编号"].ToString();
  164. }
  165. else
  166. {
  167. tempDgvr.Cells["订单编号"].Value = "";
  168. tempDgvr.Cells["客户名称"].Value = "";
  169. tempDgvr.Cells["客户电话"].Value = "";
  170. tempDgvr.Cells["套系名称"].Value = "";
  171. tempDgvr.Cells["套系价格"].Value = "";
  172. }
  173. }
  174. this.dgvData.ClearSelection();
  175. //this.dgvData2.ClearSelection();
  176. this.tabControlSelectedIndex();
  177. }
  178. }
  179. private void lbl_RefinedRepair_Click(object sender, EventArgs e)
  180. {
  181. //LYFZ.Software.MainBusiness.DoorCityProcess.frmDigitalArrangement digitalForm = new DoorCityProcess.frmDigitalArrangement();
  182. //digitalForm.labRefineRepair.Checked = true;
  183. //digitalForm.cbxMyJob.Checked = true;
  184. //digitalForm.BindPostionSize();
  185. //digitalForm.Show();
  186. //this.Close();
  187. if (this.panelDay.Tag != null)
  188. {
  189. this.dgvData.Tag = null;
  190. this.dgvData.Rows.Clear();
  191. this.dgvData.Columns.Clear();
  192. //BindDataTableColumData();
  193. //this.dgvData2.Rows.Clear();
  194. LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender;
  195. string[] StrArray = lbl.Name.Trim().Split('_');
  196. Dictionary<string, DataTable> dictData = (Dictionary<string, DataTable>)this.panelDay.Tag;
  197. //DataTable dtData = (DataTable)dictData["dtOrder"];
  198. string StrDataTime = Convert.ToDateTime(this.numYear.Value + "-" + this.numMonth.Value + "-" + this.numDay.Value).ToYYYY_MM_dd();
  199. DataTable dtData;
  200. if (dictData.ContainsKey("dtRefinedRepairOrder"))
  201. {
  202. dtData = (DataTable)dictData["dtRefinedRepairOrder"];
  203. }
  204. else
  205. {
  206. string StrWhere = "";
  207. StrWhere = " Ordv_RefinementStatus in ('0', '1') And Ordv_ReservationRefinementTime is not null ";
  208. dtData = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayRefinedRepairWorkData(StrWhere);
  209. dictData["dtRefinedRepairOrder"] = dtData;
  210. }
  211. string strWhere = "";
  212. if (!chkAllUserWork.Checked)
  213. {
  214. //GetPhotographyByWhereData(StrArray[1], ref strKey, ref strContent);
  215. strWhere = " 精修师编号 = '" + StrUserID + "' and 完成期限 >='" + StrDataTime + " 00:00:00' and 完成期限 <='" + StrDataTime + " 23:59:59' ";
  216. }
  217. ///字段数据
  218. foreach (DataColumn dtColum in dtData.Columns)
  219. {
  220. DataGridViewTextBoxColumn textBoxColum = new DataGridViewTextBoxColumn();
  221. textBoxColum.DataPropertyName = dtColum.ColumnName;
  222. textBoxColum.Name = dtColum.ColumnName;
  223. textBoxColum.HeaderText = dtColum.ColumnName;
  224. if (dtColum.ColumnName.Equals("精修师编号"))
  225. {
  226. textBoxColum.Visible = false;
  227. }
  228. if (dtColum.ColumnName.Equals("订单号"))
  229. {
  230. textBoxColum.Visible = false;
  231. }
  232. dgvData.Columns.Add(textBoxColum);
  233. }
  234. ///工作内容
  235. DataGridViewTextBoxColumn tempTextBoxColum = new DataGridViewTextBoxColumn();
  236. tempTextBoxColum.DataPropertyName = "工作内容";// dtColum.ColumnName;
  237. tempTextBoxColum.Name = "工作内容";
  238. tempTextBoxColum.HeaderText = "工作内容";
  239. tempTextBoxColum.Visible = false;
  240. dgvData.Columns.Add(tempTextBoxColum);
  241. DataRow[] dtRows = dtData.Select(strWhere);
  242. string keyNumber = "";
  243. foreach (DataRow dtRow in dtRows)
  244. {
  245. DataGridViewRow tempDgvr = this.BindClothDataListByRow(dtRow, "精修");
  246. if (keyNumber != dtRow["订单编号"].ToString())
  247. {
  248. keyNumber = dtRow["订单编号"].ToString();
  249. }
  250. else
  251. {
  252. tempDgvr.Cells["订单编号"].Value = "";
  253. tempDgvr.Cells["客户名称"].Value = "";
  254. tempDgvr.Cells["客户电话"].Value = "";
  255. tempDgvr.Cells["套系名称"].Value = "";
  256. tempDgvr.Cells["套系价格"].Value = "";
  257. }
  258. }
  259. this.dgvData.ClearSelection();
  260. //this.dgvData2.ClearSelection();
  261. this.tabControlSelectedIndex();
  262. }
  263. }
  264. private void lbl_FilmSelection_Click(object sender, EventArgs e)
  265. {
  266. if (this.panelDay.Tag != null)
  267. {
  268. this.dgvData.Tag = null;
  269. this.dgvData.Rows.Clear();
  270. this.dgvData.Columns.Clear();
  271. //BindDataTableColumData();
  272. //this.dgvData2.Rows.Clear();
  273. LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender;
  274. string[] StrArray = lbl.Name.Trim().Split('_');
  275. Dictionary<string, DataTable> dictData = (Dictionary<string, DataTable>)this.panelDay.Tag;
  276. //DataTable dtData = (DataTable)dictData["dtOrder"];
  277. string StrDataTime = Convert.ToDateTime(this.numYear.Value + "-" + this.numMonth.Value + "-" + this.numDay.Value).ToYYYY_MM_dd();
  278. DataTable dtData;
  279. if (dictData.ContainsKey("dtFilmSelectionOrder"))
  280. {
  281. dtData = (DataTable)dictData["dtFilmSelectionOrder"];
  282. }
  283. else
  284. {
  285. string StrWhere = "";
  286. if (chkCompletedOK.Checked)
  287. {
  288. StrWhere = " Ordv_FilmSelectionStatus in ('1') And Ordv_ReservationFilmSelectionTime is not null ";
  289. }
  290. else if (chkCompletedNot.Checked||chkCompletedTimeOut.Checked)
  291. {
  292. StrWhere = " Ordv_FilmSelectionStatus in ('0') And Ordv_ReservationFilmSelectionTime is not null ";
  293. }
  294. dtData = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayFilmSelectionWorkData(StrWhere);
  295. dictData["dtFilmSelectionOrder"] = dtData;
  296. }
  297. string strWhere = "";
  298. if (!chkAllUserWork.Checked)
  299. {
  300. //GetPhotographyByWhereData(StrArray[1], ref strKey, ref strContent);
  301. strWhere = " 选片师编号 = '" + StrUserID + "' ";
  302. }
  303. if(!string.IsNullOrEmpty(strWhere))
  304. {
  305. strWhere +=" and ";
  306. }
  307. if (chkCompletedOK.Checked || chkCompletedNot.Checked)
  308. {
  309. strWhere += " 选片时间 ='" + StrDataTime + "' ";
  310. }
  311. else
  312. {
  313. strWhere += " 选片时间 <'" + StrDataTime + "' ";
  314. }
  315. ///字段数据
  316. foreach (DataColumn dtColum in dtData.Columns)
  317. {
  318. DataGridViewTextBoxColumn textBoxColum = new DataGridViewTextBoxColumn();
  319. textBoxColum.DataPropertyName = dtColum.ColumnName;
  320. textBoxColum.Name = dtColum.ColumnName;
  321. textBoxColum.HeaderText = dtColum.ColumnName;
  322. if (dtColum.ColumnName.Equals("选片师编号"))
  323. {
  324. textBoxColum.Visible = false;
  325. }
  326. if (dtColum.ColumnName.Equals("订单号"))
  327. {
  328. textBoxColum.Visible = false;
  329. }
  330. dgvData.Columns.Add(textBoxColum);
  331. }
  332. ///工作内容
  333. DataGridViewTextBoxColumn tempTextBoxColum = new DataGridViewTextBoxColumn();
  334. tempTextBoxColum.DataPropertyName = "工作内容";
  335. tempTextBoxColum.Name = "工作内容";
  336. tempTextBoxColum.HeaderText = "工作内容";
  337. tempTextBoxColum.Visible = false;
  338. dgvData.Columns.Add(tempTextBoxColum);
  339. DataRow[] dtRows = dtData.Select(strWhere);
  340. string keyNumber = "";
  341. foreach (DataRow dtRow in dtRows)
  342. {
  343. DataGridViewRow tempDgvr = this.BindClothDataListByRow(dtRow, "选片");
  344. if (keyNumber != dtRow["订单编号"].ToString())
  345. {
  346. keyNumber = dtRow["订单编号"].ToString();
  347. }
  348. else
  349. {
  350. tempDgvr.Cells["订单编号"].Value = "";
  351. tempDgvr.Cells["客户名称"].Value = "";
  352. tempDgvr.Cells["客户电话"].Value = "";
  353. tempDgvr.Cells["套系名称"].Value = "";
  354. tempDgvr.Cells["套系价格"].Value = "";
  355. }
  356. }
  357. this.dgvData.ClearSelection();
  358. //this.dgvData2.ClearSelection();
  359. this.tabControlSelectedIndex();
  360. }
  361. }
  362. void chkAllUserWork_Click(object sender, EventArgs e)
  363. {
  364. PublicFunctionRows();
  365. }
  366. bool IsFrist = true;
  367. /// <summary>
  368. /// 影楼编号
  369. /// </summary>
  370. string StrCompanyID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
  371. /// <summary>
  372. /// 员工编号
  373. /// </summary>
  374. string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  375. /// <summary>
  376. /// 员工姓名
  377. /// </summary>
  378. string StrUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
  379. /// <summary>
  380. /// 获取类型
  381. /// </summary>
  382. /// <param name="StrTypeCode"></param>
  383. /// <returns></returns>
  384. string GetWorkContent(string StrTypeCode)
  385. {
  386. switch (StrTypeCode)
  387. {
  388. case "Clothing":
  389. return "选衣";
  390. case "Makeup":
  391. return "化妆";
  392. case "MakeupAssistant":
  393. return "化妆助理";
  394. case "Photography":
  395. return "拍摄";
  396. case "PhotographyAssistant":
  397. return "拍摄助理";
  398. case "BootDivision":
  399. return "引导";
  400. case "BootDivisionAssistant":
  401. return "引导助理";
  402. case "EarlyRepair":
  403. return "初修";
  404. case "FilmSelection":
  405. return "选片";
  406. case "RefinedRepair":
  407. return "精修";
  408. case "Design":
  409. return "设计";
  410. case "LookDesign":
  411. return "看设计";
  412. case "SendPhoto":
  413. return "发片";
  414. case "Pickup":
  415. return "取件";
  416. case "Service":
  417. return "服务人员";
  418. case "Marriage":
  419. return "婚期";
  420. case "MemorialDay":
  421. return "纪念日";
  422. case "Birthday":
  423. return "生日";
  424. case "FullMoon":
  425. return "满月";
  426. case "HundredDay":
  427. return "百天";
  428. }
  429. return "";
  430. }
  431. /// <summary>
  432. /// 获取类型编码
  433. /// </summary>
  434. /// <param name="StrTypeCode"></param>
  435. /// <returns></returns>
  436. string GetWorkContentCode(string StrTypeName)
  437. {
  438. switch (StrTypeName)
  439. {
  440. case "选衣":
  441. return "Clothing";
  442. case "化妆":
  443. return "Makeup";
  444. case "化妆助理":
  445. return "MakeupAssistant";
  446. case "拍摄":
  447. return "Photography";
  448. case "拍摄助理":
  449. return "PhotographyAssistant";
  450. case "引导":
  451. return "BootDivision";
  452. case "引导助理":
  453. return "BootDivisionAssistant";
  454. case "初修":
  455. return "EarlyRepair";
  456. case "选片":
  457. return "FilmSelection";
  458. case "精修":
  459. return "RefinedRepair";
  460. case "设计":
  461. return "Design";
  462. case "看设计":
  463. return "LookDesign";
  464. case "发片":
  465. return "SendPhoto";
  466. case "取件":
  467. return "Pickup";
  468. case "服务人员":
  469. return "Service";
  470. case "婚期":
  471. return "Marriage";
  472. case "纪念日":
  473. return "MemorialDay";
  474. case "生日":
  475. return "Birthday";
  476. case "满月":
  477. return "FullMoon";
  478. case "百天":
  479. return "HundredDay";
  480. }
  481. return "";
  482. }
  483. /// <summary>
  484. /// 窗体首次加载
  485. /// </summary>
  486. /// <param name="sender"></param>
  487. /// <param name="e"></param>
  488. void MyWorkRemindFormMain_Load(object sender, EventArgs e)
  489. {
  490. this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  491. this.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  492. this.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  493. string strColumn = "数码编号,订单号,订单类型,客户姓名,客户电话,工作内容,员工姓名,工作时间";
  494. this.dgvData.DataColumns(strColumn, "数码编号");
  495. //this.dgvData2.DataColumns(strColumn, "数码编号");
  496. this.dgvData3.DataColumns("ID,状态,级别,发布人,发布时间,任务内容,办理人,完成期限", strHideField: "ID");
  497. this.dgvData3.Columns["状态"].Width = 40;
  498. this.dgvData3.Columns["级别"].Width = 40;
  499. this.dgvData3.Columns["发布人"].Width = 70;
  500. this.dgvData3.Columns["办理人"].Width = 70;
  501. this.dgvData3.Columns["发布时间"].Width = 105;
  502. this.dgvData3.Columns["完成期限"].Width = 105;
  503. this.dgvData3.Columns["任务内容"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
  504. this.dgvData3.Columns["状态"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  505. this.dgvData3.Columns["级别"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  506. this.paneltitle.BackColor = UIBlueThemeResources.SightsSelectTableBorderColor;
  507. }
  508. /// <summary>
  509. /// 窗体首次加载
  510. /// </summary>
  511. /// <param name="sender"></param>
  512. /// <param name="e"></param>
  513. void MyWorkRemindFormMain_Shown(object sender, EventArgs e)
  514. {
  515. this.numDay.Maximum = System.Threading.Thread.CurrentThread.CurrentUICulture.Calendar.GetDaysInMonth(Convert.ToInt32(this.numYear.Value), Convert.ToInt32(this.numMonth.Value));
  516. this.numYear.Value = SDateTime.Now.Year;
  517. this.numMonth.Value = SDateTime.Now.Month;
  518. this.numDay.Value = SDateTime.Now.Day;
  519. this.numYear.Refresh();
  520. this.numMonth.Refresh();
  521. this.numDay.Refresh();
  522. this.IsFrist = false;
  523. this.ControlsLoad(true);
  524. //获取我的任务
  525. DataTable dtMyTask = LYFZ.BLL.BLL_ErpOrderView.GetData_MyTask(" And Agt_ManageName = '" + this.StrUserID + "'");
  526. this.dgvData3.Rows.Clear();
  527. if (dtMyTask.Rows.Count > 0)
  528. {
  529. #region
  530. DataGridViewRow dgvr = null;
  531. DataGridViewCell cell = null;
  532. foreach (DataRow dtRow in dtMyTask.Rows)
  533. {
  534. dgvr = new DataGridViewRow();
  535. cell = new DataGridViewTextBoxCell();
  536. cell.Value = dtRow["ID"].ToString().Trim();
  537. dgvr.Cells.Add(cell);
  538. cell = new DataGridViewTextBoxCell();
  539. cell.Value = "新";
  540. cell.Style.ForeColor = Color.Red;
  541. dgvr.Cells.Add(cell);
  542. cell = new DataGridViewTextBoxCell();
  543. switch (dtRow["级别"].ToString().Trim())
  544. {
  545. case "0":
  546. cell.Value = "高";
  547. break;
  548. case "1":
  549. cell.Value = "中";
  550. break;
  551. case "2":
  552. cell.Value = "低";
  553. break;
  554. }
  555. dgvr.Cells.Add(cell);
  556. cell = new DataGridViewTextBoxCell();
  557. cell.Value = LYFZ.BLL.BLL_ErpOrderView.GetUserName(dtRow["发布人"]);
  558. dgvr.Cells.Add(cell);
  559. cell = new DataGridViewTextBoxCell();
  560. cell.Value = LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["发布时间"]);
  561. dgvr.Cells.Add(cell);
  562. cell = new DataGridViewTextBoxCell();
  563. cell.Value = dtRow["任务内容"].ToString().Trim();
  564. dgvr.Cells.Add(cell);
  565. cell = new DataGridViewTextBoxCell();
  566. cell.Value = LYFZ.BLL.BLL_ErpOrderView.GetUserName(dtRow["办理人"]);
  567. dgvr.Cells.Add(cell);
  568. cell = new DataGridViewTextBoxCell();
  569. cell.Value = LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["完成期限"]);
  570. dgvr.Cells.Add(cell);
  571. this.dgvData3.Rows.Add(dgvr);
  572. //dgvr.Tag = BindDataTableRowColumn1(dgvr);
  573. }
  574. dgvData3.Tag = null;
  575. this.dgvData3.ClearSelection();
  576. this.lblMyTaskCount.Text = "( " + dtMyTask.Rows.Count + " )";
  577. this.lblMyTaskCount.Visible = true;
  578. #endregion
  579. }
  580. }
  581. /// <summary>
  582. /// 加载
  583. /// </summary>
  584. /// <param name="IsLoad"></param>
  585. void ControlsLoad(bool IsLoad = false)
  586. {
  587. foreach (Control control in this.panelDay.Controls)
  588. {
  589. if (control is LYFZ.ComponentLibrary.LabelEx)
  590. {
  591. string[] lblArray = control.Text.Split(':');
  592. control.Text = lblArray[0].Trim() + ": 0";
  593. }
  594. }
  595. string StrCompleteStatus = "Not";
  596. if (this.chkCompletedTimeOut.Checked)
  597. { StrCompleteStatus = "OuntNot"; }
  598. else if (this.chkCompletedOK.Checked)
  599. { StrCompleteStatus = "OK"; }
  600. this.Refresh();
  601. string StrDataTime = Convert.ToDateTime(this.numYear.Value + "-" + this.numMonth.Value + "-" + this.numDay.Value).ToYYYY_MM_dd();
  602. if (IsLoad)
  603. {
  604. System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(delegate()
  605. {
  606. this.GetDayData(StrCompleteStatus, StrDataTime);
  607. }));
  608. t.Start();
  609. }
  610. else
  611. {
  612. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
  613. {
  614. this.GetDayData(StrCompleteStatus, StrDataTime);
  615. });
  616. }
  617. }
  618. /// <summary>
  619. /// 获取每日数据
  620. /// </summary>
  621. void GetDayData(string StrCompleteStatus, string StrDataTime)
  622. {
  623. string strWhereOrder = "";
  624. string strWhereCLientServiceTask = "";
  625. DataTable dtOrder = new DataTable();
  626. if (StrCompleteStatus == "OuntNot" || StrCompleteStatus == "Not")
  627. {
  628. if (StrCompleteStatus == "Not")
  629. {
  630. strWhereOrder = LYFZ.BLL.OtherCommonModel.GetDateTime("工作时间", StrDataTime, StrDataTime);
  631. strWhereCLientServiceTask = " And Cst_CompletionIntStatus = 0" + LYFZ.BLL.OtherCommonModel.GetDateTime("Cst_TaskTermTime", StrDataTime, StrDataTime);
  632. //获取未完成
  633. dtOrder = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayWorkNot(strWhereOrder);
  634. }
  635. else
  636. {
  637. strWhereOrder = " And 工作时间 < '" + Convert.ToDateTime(StrDataTime).ToString("yyyy-MM-dd HH:mm:ss") + "'";
  638. strWhereCLientServiceTask = " And Cst_CompletionIntStatus = 0 And Cst_TaskTermTime < '" + Convert.ToDateTime(StrDataTime).ToString("yyyy-MM-dd HH:mm:ss") + "'";
  639. //获取超时未完成
  640. dtOrder = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayWorkNot(strWhereOrder);
  641. }
  642. }
  643. else if (StrCompleteStatus == "OK")
  644. {
  645. strWhereOrder = LYFZ.BLL.OtherCommonModel.GetDateTime("工作时间", StrDataTime, StrDataTime);
  646. strWhereCLientServiceTask = " And Cst_CompletionIntStatus = 1" + LYFZ.BLL.OtherCommonModel.GetDateTime("Cst_TaskTermTime", StrDataTime, StrDataTime);
  647. //获取已完成
  648. dtOrder = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayWorkOK(strWhereOrder);
  649. }
  650. //获取客服任务
  651. DataTable dtTaskData = LYFZ.BLL.BLL_ErpOrderView.GetData_ClientServiceTask(strWhereCLientServiceTask, IsShowCompletionRemark: false, IsReturnNewTable: false);
  652. //获取客户节日
  653. DataTable dtClient = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_ClientFestivals(StrDataTime);
  654. //获取客户节日
  655. DataTable dtTodayTrack = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_TodayTrack(StrDataTime);
  656. //今日跟踪(医院客户提醒)
  657. DataTable dtTodayHospital = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_TodayTrackHospital(StrDataTime);
  658. //今日跟踪(客户今日提醒)
  659. DataTable dtTodayClient = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_TodayTrackClient(StrDataTime);
  660. try
  661. {
  662. this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate()
  663. {
  664. Dictionary<string, DataTable> dictData = new Dictionary<string, DataTable>();
  665. dictData.Add("dtOrder", dtOrder);
  666. dictData.Add("dtTaskData", dtTaskData);
  667. dictData.Add("dtClient", dtClient);
  668. dictData.Add("dtTodayTrack", dtTodayTrack);
  669. dictData.Add("dtTodayHospital", dtTodayHospital);
  670. dictData.Add("dtTodayClient", dtTodayClient);
  671. this.panelDay.Tag = dictData;
  672. this.PublicFunctionRows();
  673. }));
  674. }
  675. catch { }
  676. }
  677. /// <summary>
  678. /// 全绑定
  679. /// </summary>
  680. void PublicFunctionRows()
  681. {
  682. this.dgvData.Rows.Clear();
  683. BindDataTableColumData();
  684. BindDayWorkData();
  685. //this.dgvData2.Rows.Clear();
  686. if (this.panelDay.Tag != null)
  687. {
  688. string[] tagList = new string[] {
  689. "Clothing", "Makeup","MakeupAssistant","Photography","PhotographyAssistant","BootDivision",
  690. "BootDivisionAssistant","EarlyRepair","FilmSelection","RefinedRepair","Design","LookDesign","SendPhoto","Pickup",
  691. "Service","Marriage","MemorialDay","Birthday","FullMoon","HundredDay"
  692. };
  693. foreach (var item in tagList)
  694. {
  695. string strCode = item;
  696. LYFZ.ComponentLibrary.LabelEx lbl = this.GetGroupBoxData(strCode);
  697. string[] StrArray = lbl.Text.Trim().Split(':');
  698. lbl.Text = StrArray[0] + ":0" ;
  699. }
  700. string strWhere = "";
  701. if(!chkAllUserWork.Checked)
  702. {
  703. strWhere = " 员工编号 = '" + StrUserID + "' ";
  704. }
  705. //订单流程
  706. Dictionary<string, DataTable> dictDataTable = (Dictionary<string, DataTable>)this.panelDay.Tag;
  707. DataRow[] dtRowsOrder = ((DataTable)dictDataTable["dtOrder"]).Select(strWhere);
  708. if (dtRowsOrder.Length > 0)
  709. {
  710. Dictionary<string, int> dictData = new Dictionary<string, int>();
  711. foreach (DataRow dtRow in dtRowsOrder)
  712. {
  713. if (dictData.ContainsKey(dtRow["工作内容"].ToString().Trim()))
  714. { dictData[dtRow["工作内容"].ToString().Trim()] = (Convert.ToInt32(dictData[dtRow["工作内容"].ToString().Trim()]) + 1); }
  715. else
  716. { dictData.Add(dtRow["工作内容"].ToString().Trim(), 1); }
  717. this.PublicOrderRows(dtRow);
  718. }
  719. foreach (var item in dictData)
  720. {
  721. string strCode = this.GetWorkContentCode(item.Key.Trim());
  722. LYFZ.ComponentLibrary.LabelEx lbl = this.GetGroupBoxData(strCode);
  723. string[] StrArray = lbl.Text.Trim().Split(':');
  724. lbl.Text = StrArray[0] + ": " + item.Value;
  725. }
  726. }
  727. if (!chkAllUserWork.Checked)
  728. {
  729. strWhere = " 员工姓名 = '" + this.StrUserName + "' ";
  730. }
  731. //客户节日
  732. DataRow[] dtRowsClient = ((DataTable)dictDataTable["dtClient"]).Select(strWhere);
  733. if (dtRowsClient.Length > 0)
  734. {
  735. Dictionary<string, int> dictData = new Dictionary<string, int>();
  736. foreach (DataRow dtRow in dtRowsClient)
  737. {
  738. if (dictData.ContainsKey(dtRow["工作内容"].ToString().Trim()))
  739. { dictData[dtRow["工作内容"].ToString().Trim()] = (Convert.ToInt32(dictData[dtRow["工作内容"].ToString().Trim()]) + 1); }
  740. else
  741. { dictData.Add(dtRow["工作内容"].ToString().Trim(), 1); }
  742. this.PublicClientRows(dtRow);
  743. }
  744. foreach (var item in dictData)
  745. {
  746. string strCode = this.GetWorkContentCode(item.Key.Trim());
  747. LYFZ.ComponentLibrary.LabelEx lbl = this.GetGroupBoxData(strCode);
  748. string[] StrArray = lbl.Text.Trim().Split(':');
  749. lbl.Text = StrArray[0] + ": " + item.Value;
  750. }
  751. }
  752. if (!chkAllUserWork.Checked)
  753. {
  754. strWhere = " Cst_ServicePerson = '" + this.StrUserID + "' ";
  755. }
  756. //客服任务
  757. DataRow[] dtRowsTask = ((DataTable)dictDataTable["dtTaskData"]).Select(strWhere);
  758. if (dtRowsTask.Length > 0)
  759. {
  760. foreach (DataRow dtRow in dtRowsTask)
  761. { this.PublicTaskRows(dtRow); }
  762. string[] StrArray = this.lbl_ClientServiceTask.Text.Trim().Split(':');
  763. this.lbl_ClientServiceTask.Text = StrArray[0] + ": " + dtRowsTask.Length;
  764. }
  765. if (!chkAllUserWork.Checked)
  766. {
  767. strWhere = " 员工编号 = '" + this.StrUserID + "' ";
  768. }
  769. int TodayTrackCount = 0;
  770. //今日跟踪
  771. DataRow[] dtTodayTrack = ((DataTable)dictDataTable["dtTodayTrack"]).Select(strWhere);
  772. if (dtTodayTrack.Length > 0)
  773. {
  774. foreach (DataRow dtRow in dtTodayTrack)
  775. { this.PublicOrderRows(dtRow); }
  776. TodayTrackCount += dtTodayTrack.Length;
  777. }
  778. if (!chkAllUserWork.Checked)
  779. {
  780. strWhere = " 员工姓名 = '" + this.StrUserName + "' ";
  781. }
  782. //今日跟踪(医院今日提醒)
  783. DataRow[] dtTodayHospital = ((DataTable)dictDataTable["dtTodayHospital"]).Select(strWhere);
  784. if (dtTodayHospital.Length > 0)
  785. {
  786. foreach (DataRow dtRow in dtTodayHospital)
  787. { this.PublicClientRows(dtRow); }
  788. TodayTrackCount += dtTodayHospital.Length;
  789. }
  790. if (!chkAllUserWork.Checked)
  791. {
  792. strWhere = " 员工姓名 = '" + this.StrUserName + "' ";
  793. }
  794. //今日跟踪(客户今日提醒)
  795. DataRow[] dtTodayClient = ((DataTable)dictDataTable["dtTodayClient"]).Select(strWhere);
  796. if (dtTodayClient.Length > 0)
  797. {
  798. foreach (DataRow dtRow in dtTodayClient)
  799. { this.PublicClientRows(dtRow); }
  800. TodayTrackCount += dtTodayClient.Length;
  801. }
  802. if (TodayTrackCount > 0)
  803. {
  804. string[] StrArray = this.lbl_TodayTrack.Text.Trim().Split(':');
  805. this.lbl_TodayTrack.Text = StrArray[0] + ": " + TodayTrackCount;
  806. }
  807. this.dgvData.ClearSelection();
  808. //this.dgvData2.ClearSelection();
  809. }
  810. }
  811. LYFZ.ComponentLibrary.LabelEx GetGroupBoxData( string strCode)
  812. {
  813. LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)this.groupBoxEx1.Controls["lbl_" + strCode];
  814. if(lbl==null)
  815. {
  816. lbl = (LYFZ.ComponentLibrary.LabelEx)this.groupBoxEx2.Controls["lbl_" + strCode];
  817. }
  818. if (lbl == null)
  819. {
  820. lbl = (LYFZ.ComponentLibrary.LabelEx)this.groupBoxEx3.Controls["lbl_" + strCode];
  821. }
  822. if (lbl == null)
  823. {
  824. lbl = (LYFZ.ComponentLibrary.LabelEx)this.groupBoxEx4.Controls["lbl_" + strCode];
  825. }
  826. return lbl;
  827. }
  828. void BindDataTableColumData(string strColumn = "数码编号,订单号,订单类型,客户姓名,客户电话,工作内容,员工姓名,工作时间", string hidColum = "数码编号")
  829. {
  830. this.dgvData.Columns.Clear();
  831. //string strColumn = "数码编号,订单号,订单类型,客户姓名,工作内容,员工姓名,工作时间";
  832. string[] columLists = strColumn.Split(',');
  833. foreach (string colum in columLists)
  834. {
  835. DataGridViewTextBoxColumn dataColum = new DataGridViewTextBoxColumn();
  836. //dataColum.Name = colum;
  837. //dataColum.HeaderText = colum;
  838. dataColum.Name = colum;
  839. dataColum.DataPropertyName = colum;
  840. dataColum.HeaderText = colum;
  841. dataColum.Resizable = DataGridViewTriState.True;
  842. if (hidColum.Equals(colum))
  843. {
  844. dataColum.Visible = false;
  845. }
  846. this.dgvData.Columns.Add(dataColum);
  847. }
  848. //this.dgvData.DataColumns(strColumn, "数码编号");
  849. }
  850. void BindDayWorkData()
  851. {
  852. foreach (Control control in this.panelDay.Controls)
  853. {
  854. if (control is LYFZ.ComponentLibrary.LabelEx)
  855. {
  856. string[] lblArray = control.Text.Split(':');
  857. control.Text = lblArray[0].Trim() + ": 0";
  858. }
  859. }
  860. }
  861. /// <summary>
  862. /// 绑定订单工作
  863. /// </summary>
  864. /// <param name="dtRow"></param>
  865. void PublicOrderRows(DataRow dtRow)
  866. {
  867. DataGridViewCell cell = null;
  868. DataGridViewRow dgvr = null;
  869. if (!chkAllUserWork.Checked)
  870. {
  871. if (dtRow["员工编号"].ToString() == this.StrUserID)
  872. {
  873. dgvr = new DataGridViewRow();
  874. cell = new DataGridViewTextBoxCell();
  875. cell.Value = dtRow["数码编号"].ToString();
  876. dgvr.Cells.Add(cell);
  877. cell = new DataGridViewTextBoxCell();
  878. cell.Value = dtRow["订单号"].ToString().Trim();
  879. dgvr.Cells.Add(cell);
  880. cell = new DataGridViewTextBoxCell();
  881. cell.Value = dtRow["订单类型"].ToString().Trim();
  882. dgvr.Cells.Add(cell);
  883. cell = new DataGridViewTextBoxCell();
  884. cell.Value = dtRow["客户姓名"].ToString().Trim();
  885. dgvr.Cells.Add(cell);
  886. cell = new DataGridViewTextBoxCell();
  887. cell.Value = dtRow["客户电话"].ToString().Trim();
  888. dgvr.Cells.Add(cell);
  889. cell = new DataGridViewTextBoxCell();
  890. cell.Value = dtRow["工作内容"].ToString().Trim();
  891. dgvr.Cells.Add(cell);
  892. cell = new DataGridViewTextBoxCell();
  893. cell.Value = dtRow["员工姓名"].ToString().Trim();
  894. dgvr.Cells.Add(cell);
  895. cell = new DataGridViewTextBoxCell();
  896. cell.Value = LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["工作时间"]);
  897. dgvr.Cells.Add(cell);
  898. this.dgvData.Rows.Add(dgvr);
  899. dgvr.Tag = BindDataTableRowColumn(dgvr);
  900. }
  901. }
  902. else
  903. {
  904. dgvr = new DataGridViewRow();
  905. cell = new DataGridViewTextBoxCell();
  906. cell.Value = dtRow["数码编号"].ToString();
  907. dgvr.Cells.Add(cell);
  908. cell = new DataGridViewTextBoxCell();
  909. cell.Value = dtRow["订单号"].ToString().Trim();
  910. dgvr.Cells.Add(cell);
  911. cell = new DataGridViewTextBoxCell();
  912. cell.Value = dtRow["订单类型"].ToString().Trim();
  913. dgvr.Cells.Add(cell);
  914. cell = new DataGridViewTextBoxCell();
  915. cell.Value = dtRow["客户姓名"].ToString().Trim();
  916. dgvr.Cells.Add(cell);
  917. cell = new DataGridViewTextBoxCell();
  918. cell.Value = dtRow["客户电话"].ToString().Trim();
  919. dgvr.Cells.Add(cell);
  920. cell = new DataGridViewTextBoxCell();
  921. cell.Value = dtRow["工作内容"].ToString().Trim();
  922. dgvr.Cells.Add(cell);
  923. cell = new DataGridViewTextBoxCell();
  924. cell.Value = dtRow["员工姓名"].ToString().Trim();
  925. dgvr.Cells.Add(cell);
  926. cell = new DataGridViewTextBoxCell();
  927. cell.Value = LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["工作时间"]);
  928. dgvr.Cells.Add(cell);
  929. this.dgvData.Rows.Add(dgvr);
  930. dgvr.Tag = BindDataTableRowColumn(dgvr);
  931. }
  932. dgvData.Tag = null;
  933. }
  934. DataRow BindDataTableRowColumn(DataGridViewRow dgvr)
  935. {
  936. DataTable dtTable = new DataTable();
  937. foreach (DataGridViewColumn culumn in this.dgvData.Columns)
  938. {
  939. dtTable.Columns.Add(new DataColumn(culumn.HeaderText));
  940. }
  941. DataRow dtRow = dtTable.NewRow();
  942. foreach (DataGridViewColumn culumn in this.dgvData.Columns)
  943. {
  944. if (this.dgvData.Columns.Contains(culumn.HeaderText))
  945. {
  946. dtRow[culumn.HeaderText] = dgvr.Cells[culumn.HeaderText].Value;
  947. }
  948. }
  949. return dtRow;
  950. }
  951. DataRow BindDataTableRowColumn1(DataGridViewRow dgvr)
  952. {
  953. DataTable dtTable = new DataTable();
  954. foreach (DataGridViewColumn culumn in this.dgvData.Columns)
  955. {
  956. dtTable.Columns.Add(new DataColumn(culumn.HeaderText));
  957. }
  958. DataRow dtRow = dtTable.NewRow();
  959. dtRow["工作内容"] = dgvr.Cells["任务内容"];
  960. dtRow["员工姓名"] = dgvr.Cells["办理人"];
  961. dtRow["工作时间"] = dgvr.Cells["发布时间"];
  962. return dtRow;
  963. }
  964. /// <summary>
  965. /// 绑定订单工作
  966. /// </summary>
  967. /// <param name="dtRow"></param>
  968. void PublicClientRows(DataRow dtRow)
  969. {
  970. DataGridViewCell cell = null;
  971. DataGridViewRow dgvr = null;
  972. if (!chkAllUserWork.Checked)
  973. {
  974. if (dtRow["员工姓名"].ToString() == this.StrUserName)
  975. {
  976. dgvr = new DataGridViewRow();
  977. cell = new DataGridViewTextBoxCell();
  978. cell.Value = dtRow["数码编号"].ToString();
  979. dgvr.Cells.Add(cell);
  980. cell = new DataGridViewTextBoxCell();
  981. cell.Value = dtRow["订单号"].ToString().Trim();
  982. dgvr.Cells.Add(cell);
  983. cell = new DataGridViewTextBoxCell();
  984. cell.Value = dtRow["订单类型"].ToString().Trim();
  985. dgvr.Cells.Add(cell);
  986. cell = new DataGridViewTextBoxCell();
  987. cell.Value = dtRow["客户姓名"].ToString().Trim();
  988. dgvr.Cells.Add(cell);
  989. cell = new DataGridViewTextBoxCell();
  990. cell.Value = dtRow["客户电话"].ToString().Trim();
  991. dgvr.Cells.Add(cell);
  992. cell = new DataGridViewTextBoxCell();
  993. cell.Value = dtRow["工作内容"].ToString().Trim();
  994. dgvr.Cells.Add(cell);
  995. cell = new DataGridViewTextBoxCell();
  996. cell.Value = dtRow["员工姓名"].ToString().Trim();
  997. dgvr.Cells.Add(cell);
  998. cell = new DataGridViewTextBoxCell();
  999. cell.Value = LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["工作时间"]);
  1000. dgvr.Cells.Add(cell);
  1001. this.dgvData.Rows.Add(dgvr);
  1002. dgvr.Tag = BindDataTableRowColumn(dgvr);
  1003. }
  1004. }
  1005. else
  1006. {
  1007. dgvr = new DataGridViewRow();
  1008. cell = new DataGridViewTextBoxCell();
  1009. cell.Value = dtRow["数码编号"].ToString();
  1010. dgvr.Cells.Add(cell);
  1011. cell = new DataGridViewTextBoxCell();
  1012. cell.Value = dtRow["订单号"].ToString().Trim();
  1013. dgvr.Cells.Add(cell);
  1014. cell = new DataGridViewTextBoxCell();
  1015. cell.Value = dtRow["订单类型"].ToString().Trim();
  1016. dgvr.Cells.Add(cell);
  1017. cell = new DataGridViewTextBoxCell();
  1018. cell.Value = dtRow["客户姓名"].ToString().Trim();
  1019. dgvr.Cells.Add(cell);
  1020. cell = new DataGridViewTextBoxCell();
  1021. cell.Value = dtRow["客户电话"].ToString().Trim();
  1022. dgvr.Cells.Add(cell);
  1023. cell = new DataGridViewTextBoxCell();
  1024. cell.Value = dtRow["工作内容"].ToString().Trim();
  1025. dgvr.Cells.Add(cell);
  1026. cell = new DataGridViewTextBoxCell();
  1027. cell.Value = dtRow["员工姓名"].ToString().Trim();
  1028. dgvr.Cells.Add(cell);
  1029. cell = new DataGridViewTextBoxCell();
  1030. cell.Value = LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["工作时间"]);
  1031. dgvr.Cells.Add(cell);
  1032. this.dgvData.Rows.Add(dgvr);
  1033. dgvr.Tag = BindDataTableRowColumn(dgvr);
  1034. }
  1035. dgvData.Tag = null;
  1036. }
  1037. /// <summary>
  1038. /// 绑定客户安排
  1039. /// </summary>
  1040. /// <param name="dtRow"></param>
  1041. void PublicTaskRows(DataRow dtRow)
  1042. {
  1043. DataGridViewCell cell = null;
  1044. DataGridViewRow dgvr = null;
  1045. if (!chkAllUserWork.Checked)
  1046. {
  1047. if (dtRow["Cst_ServicePerson"].ToString().Trim() == this.StrUserID)
  1048. {
  1049. dgvr = new DataGridViewRow();
  1050. cell = new DataGridViewTextBoxCell();
  1051. cell.Value = dtRow["Cst_ViceNumber"].ToString();
  1052. dgvr.Cells.Add(cell);
  1053. cell = new DataGridViewTextBoxCell();
  1054. cell.Value = dtRow["Cst_ShowOrderNumber"].ToString().Trim();
  1055. dgvr.Cells.Add(cell);
  1056. cell = new DataGridViewTextBoxCell();
  1057. cell.Value = "客户任务";
  1058. dgvr.Cells.Add(cell);
  1059. cell = new DataGridViewTextBoxCell();
  1060. cell.Value = dtRow["Cus_Name"].ToString().Trim();
  1061. dgvr.Cells.Add(cell);
  1062. cell = new DataGridViewTextBoxCell();
  1063. cell.Value = dtRow["Cus_Telephone"].ToString().Trim();
  1064. dgvr.Cells.Add(cell);
  1065. cell = new DataGridViewTextBoxCell();
  1066. cell.Value = dtRow["Cst_TaskItem"].ToString().Trim();
  1067. dgvr.Cells.Add(cell);
  1068. cell = new DataGridViewTextBoxCell();
  1069. cell.Value = LYFZ.BLL.BLL_ErpOrderView.GetUserName(dtRow["Cst_ServicePerson"]);
  1070. dgvr.Cells.Add(cell);
  1071. cell = new DataGridViewTextBoxCell();
  1072. cell.Value = Convert.ToDateTime(dtRow["Cst_TaskTermTime"]).ToString("yyyy-MM-dd");
  1073. dgvr.Cells.Add(cell);
  1074. this.dgvData.Rows.Add(dgvr);
  1075. dgvr.Tag = BindDataTableRowColumn(dgvr);
  1076. }
  1077. }
  1078. else
  1079. {
  1080. dgvr = new DataGridViewRow();
  1081. cell = new DataGridViewTextBoxCell();
  1082. cell.Value = dtRow["Cst_ViceNumber"].ToString();
  1083. dgvr.Cells.Add(cell);
  1084. cell = new DataGridViewTextBoxCell();
  1085. cell.Value = dtRow["Cst_ShowOrderNumber"].ToString().Trim();
  1086. dgvr.Cells.Add(cell);
  1087. cell = new DataGridViewTextBoxCell();
  1088. cell.Value = "客户任务";
  1089. dgvr.Cells.Add(cell);
  1090. cell = new DataGridViewTextBoxCell();
  1091. cell.Value = dtRow["Cus_Name"].ToString().Trim();
  1092. dgvr.Cells.Add(cell);
  1093. cell = new DataGridViewTextBoxCell();
  1094. cell.Value = dtRow["Cus_Telephone"].ToString().Trim();
  1095. dgvr.Cells.Add(cell);
  1096. cell = new DataGridViewTextBoxCell();
  1097. cell.Value = dtRow["Cst_TaskItem"].ToString().Trim();
  1098. dgvr.Cells.Add(cell);
  1099. cell = new DataGridViewTextBoxCell();
  1100. cell.Value = LYFZ.BLL.BLL_ErpOrderView.GetUserName(dtRow["Cst_ServicePerson"]);
  1101. dgvr.Cells.Add(cell);
  1102. cell = new DataGridViewTextBoxCell();
  1103. cell.Value = Convert.ToDateTime(dtRow["Cst_TaskTermTime"]).ToString("yyyy-MM-dd");
  1104. dgvr.Cells.Add(cell);
  1105. this.dgvData.Rows.Add(dgvr);
  1106. dgvr.Tag = BindDataTableRowColumn(dgvr);
  1107. }
  1108. dgvData.Tag = null;
  1109. }
  1110. /// <summary>
  1111. /// 年回车
  1112. /// </summary>
  1113. /// <param name="sender"></param>
  1114. /// <param name="e"></param>
  1115. void numYear_KeyDown(object sender, KeyEventArgs e)
  1116. {
  1117. this.numDay_KeyDown(this, e);
  1118. }
  1119. /// <summary>
  1120. /// 月回车
  1121. /// </summary>
  1122. /// <param name="sender"></param>
  1123. /// <param name="e"></param>
  1124. void numMonth_KeyDown(object sender, KeyEventArgs e)
  1125. {
  1126. this.numDay_KeyDown(this, e);
  1127. }
  1128. /// <summary>
  1129. /// 日回车
  1130. /// </summary>
  1131. /// <param name="sender"></param>
  1132. /// <param name="e"></param>
  1133. void numDay_KeyDown(object sender, KeyEventArgs e)
  1134. {
  1135. if (e.KeyCode == Keys.Enter)
  1136. { this.numDay_ValueChanged(this, null); }
  1137. }
  1138. /// <summary>
  1139. /// 年值变更
  1140. /// </summary>
  1141. /// <param name="sender"></param>
  1142. /// <param name="e"></param>
  1143. void numYear_ValueChanged(object sender, EventArgs e)
  1144. {
  1145. this.numDay_ValueChanged(this, null);
  1146. }
  1147. /// <summary>
  1148. /// 月值变更
  1149. /// </summary>
  1150. /// <param name="sender"></param>
  1151. /// <param name="e"></param>
  1152. void numMonth_ValueChanged(object sender, EventArgs e)
  1153. {
  1154. this.numDay.Maximum = System.Threading.Thread.CurrentThread.CurrentUICulture.Calendar.GetDaysInMonth(Convert.ToInt32(this.numYear.Value), Convert.ToInt32(this.numMonth.Value));
  1155. this.numDay_ValueChanged(this, null);
  1156. }
  1157. /// <summary>
  1158. /// 日值变更
  1159. /// </summary>
  1160. /// <param name="sender"></param>
  1161. /// <param name="e"></param>
  1162. void numDay_ValueChanged(object sender, EventArgs e)
  1163. {
  1164. this.lblLunarCalendar.Text = LYFZ.Command.Command_CalendarTurnLunar.GetLunarNewYearMonthDay(Convert.ToDateTime(numYear.Value + "-" + numMonth.Value + "-" + this.numDay.Value).ToString(), false);
  1165. this.lblWeek.Text = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.CaculateWeekDay(Convert.ToDateTime(Convert.ToDateTime(numYear.Value + "-" + numMonth.Value + "-" + this.numDay.Value)).DayOfWeek.ToString());
  1166. if (!this.IsFrist)
  1167. { this.ControlsLoad(); }
  1168. }
  1169. /// <summary>
  1170. /// 已完成
  1171. /// </summary>
  1172. /// <param name="sender"></param>
  1173. /// <param name="e"></param>
  1174. void chkCompletedOK_Click(object sender, EventArgs e)
  1175. {
  1176. this.chkCompletedOK.Checked = true;
  1177. this.chkCompletedNot.Checked = false;
  1178. this.chkCompletedTimeOut.Checked = false;
  1179. this.ControlsLoad();
  1180. }
  1181. /// <summary>
  1182. /// 未完成
  1183. /// </summary>
  1184. /// <param name="sender"></param>
  1185. /// <param name="e"></param>
  1186. void chkCompletedNot_Click(object sender, EventArgs e)
  1187. {
  1188. this.chkCompletedNot.Checked = true;
  1189. this.chkCompletedOK.Checked = false;
  1190. this.chkCompletedTimeOut.Checked = false;
  1191. this.ControlsLoad();
  1192. }
  1193. /// <summary>
  1194. /// 超时未完成
  1195. /// </summary>
  1196. /// <param name="sender"></param>
  1197. /// <param name="e"></param>
  1198. void chkCompletedTimeOut_Click(object sender, EventArgs e)
  1199. {
  1200. this.chkCompletedTimeOut.Checked = true;
  1201. this.chkCompletedOK.Checked = false;
  1202. this.chkCompletedNot.Checked = false;
  1203. this.ControlsLoad();
  1204. }
  1205. /// <summary>
  1206. /// 点击查看全部
  1207. /// </summary>
  1208. /// <param name="sender"></param>
  1209. /// <param name="e"></param>
  1210. void panelDay_Click(object sender, EventArgs e)
  1211. {
  1212. dataType = "";
  1213. if (this.panelDay.Tag != null)
  1214. {
  1215. this.PublicFunctionRows();
  1216. }
  1217. }
  1218. /// <summary>
  1219. /// 选衣服数据
  1220. /// </summary>
  1221. /// <param name="sender"></param>
  1222. /// <param name="e"></param>
  1223. void lbl_Clothing_Click(object sender, EventArgs e)
  1224. {
  1225. if (this.panelDay.Tag != null)
  1226. {
  1227. this.dgvData.Tag = null;
  1228. this.dgvData.Rows.Clear();
  1229. this.dgvData.Columns.Clear();
  1230. //this.dgvData2.Rows.Clear();
  1231. LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender;
  1232. string[] StrArray = lbl.Name.Trim().Split('_');
  1233. Dictionary<string, DataTable> dictData = (Dictionary<string, DataTable>)this.panelDay.Tag;
  1234. DataTable dtData;
  1235. //(DataTable)dictData["dtClothOrder"];
  1236. if(dictData.ContainsKey("dtClothOrder"))
  1237. {
  1238. dtData = (DataTable)dictData["dtClothOrder"];
  1239. }
  1240. else
  1241. {
  1242. string StrDataTime = Convert.ToDateTime(this.numYear.Value + "-" + this.numMonth.Value + "-" + this.numDay.Value).ToYYYY_MM_dd();
  1243. string StrWhere = LYFZ.BLL.OtherCommonModel.GetDateTime("Ordv_ReservationClothingTime", StrDataTime, StrDataTime);
  1244. if(chkCompletedTimeOut.Checked)
  1245. {
  1246. StrWhere = " and Ordv_ReservationClothingTime <='" + StrDataTime + "' ";
  1247. }
  1248. if (chkCompletedOK.Checked)
  1249. {
  1250. dtData = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayClothWorkData(LYFZ.BLL.OtherCommonModel.GetDateTime("Ordv_ClothingTime", StrDataTime, StrDataTime), "1");
  1251. }
  1252. else
  1253. {
  1254. dtData = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayClothWorkData(StrWhere);
  1255. }
  1256. dictData["dtClothOrder"] = dtData;
  1257. }
  1258. ///字段数据
  1259. foreach(DataColumn dtColum in dtData.Columns)
  1260. {
  1261. DataGridViewTextBoxColumn textBoxColum = new DataGridViewTextBoxColumn();
  1262. textBoxColum.DataPropertyName = dtColum.ColumnName;//"工作内容";
  1263. textBoxColum.Name = dtColum.ColumnName;
  1264. textBoxColum.HeaderText = dtColum.ColumnName;
  1265. dgvData.Columns.Add(textBoxColum);
  1266. }
  1267. ///工作内容
  1268. DataGridViewTextBoxColumn tempTextBoxColum = new DataGridViewTextBoxColumn();
  1269. tempTextBoxColum.DataPropertyName = "工作内容";
  1270. tempTextBoxColum.Name = "工作内容";
  1271. tempTextBoxColum.HeaderText = "工作内容";
  1272. tempTextBoxColum.Visible = false;
  1273. dgvData.Columns.Add(tempTextBoxColum);
  1274. string strKey = "";
  1275. if (!chkAllUserWork.Checked)
  1276. {
  1277. strKey = "安排人='" + this.StrUserName + "'";
  1278. }
  1279. DataRow[] dtRows = dtData.Select(strKey);
  1280. foreach (DataRow dtRow in dtRows)
  1281. { this.BindClothDataListByRow(dtRow, "选衣"); }
  1282. this.dgvData.ClearSelection();
  1283. //this.dgvData2.ClearSelection();
  1284. this.tabControlSelectedIndex();
  1285. }
  1286. }
  1287. /// <summary>
  1288. /// 选衣服数据
  1289. /// </summary>
  1290. /// <param name="sender"></param>
  1291. /// <param name="e"></param>
  1292. void lbl_Photograph_Click(object sender, EventArgs e)
  1293. {
  1294. if (this.panelDay.Tag != null)
  1295. {
  1296. this.dgvData.Tag = null;
  1297. this.dgvData.Rows.Clear();
  1298. this.dgvData.Columns.Clear();
  1299. //this.dgvData2.Rows.Clear();
  1300. LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender;
  1301. string[] StrArray = lbl.Name.Trim().Split('_');
  1302. Dictionary<string, DataTable> dictData = (Dictionary<string, DataTable>)this.panelDay.Tag;
  1303. DataTable dtData;
  1304. string strKey = "";
  1305. string strContent = "";
  1306. //(DataTable)dictData["dtClothOrder"];
  1307. if (dictData.ContainsKey("dtPhotographOrder"))
  1308. {
  1309. dtData = (DataTable)dictData["dtPhotographOrder"];
  1310. }
  1311. else
  1312. {
  1313. string StrDataTime = Convert.ToDateTime(this.numYear.Value + "-" + this.numMonth.Value + "-" + this.numDay.Value).ToYYYY_MM_dd();
  1314. string StrWhere = "";
  1315. if (chkCompletedNot.Checked)
  1316. {
  1317. StrWhere = " Ordpg_PhotographyStatus = '0' " + LYFZ.BLL.OtherCommonModel.GetDateTime("Ordpg_ReservationPhotographyTime", StrDataTime, StrDataTime);
  1318. }
  1319. if (chkCompletedOK.Checked)
  1320. {
  1321. StrWhere = " Ordpg_PhotographyStatus = '1' " + LYFZ.BLL.OtherCommonModel.GetDateTime("Ordpg_PhotographyTime", StrDataTime, StrDataTime);
  1322. }
  1323. if(chkCompletedTimeOut.Checked)
  1324. {
  1325. StrWhere = " Ordpg_PhotographyStatus = '0' and Ordpg_ReservationPhotographyTime < '" + StrDataTime + "' ";
  1326. }
  1327. dtData = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayPhotographyWorkData(StrWhere);
  1328. dictData["dtPhotographOrder"] = dtData;
  1329. }
  1330. if (!chkAllUserWork.Checked)
  1331. {
  1332. GetPhotographyByWhereData(StrArray[1], ref strKey, ref strContent);
  1333. }
  1334. ///字段数据
  1335. foreach (DataColumn dtColum in dtData.Columns)
  1336. {
  1337. DataGridViewTextBoxColumn textBoxColum = new DataGridViewTextBoxColumn();
  1338. textBoxColum.DataPropertyName = dtColum.ColumnName;// "工作内容";
  1339. textBoxColum.Name = dtColum.ColumnName;
  1340. textBoxColum.HeaderText = dtColum.ColumnName;
  1341. dgvData.Columns.Add(textBoxColum);
  1342. }
  1343. ///工作内容
  1344. DataGridViewTextBoxColumn tempTextBoxColum = new DataGridViewTextBoxColumn();
  1345. tempTextBoxColum.DataPropertyName = "工作内容";
  1346. tempTextBoxColum.Name = "工作内容";
  1347. tempTextBoxColum.HeaderText = "工作内容";
  1348. tempTextBoxColum.Visible = false;
  1349. dgvData.Columns.Add(tempTextBoxColum);
  1350. DataRow[] dtRows = { };
  1351. dtRows = dtData.Select(strKey);
  1352. foreach (DataRow dtRow in dtRows)
  1353. { this.BindClothDataListByRow(dtRow, strContent); }
  1354. this.dgvData.ClearSelection();
  1355. //this.dgvData2.ClearSelection();
  1356. this.tabControlSelectedIndex();
  1357. }
  1358. }
  1359. void GetPhotographyByWhereData(string type,ref string strKey,ref string strContent)
  1360. {
  1361. //strKey+"='" + this.StrUserName + "'"
  1362. switch(type)
  1363. {
  1364. case "Photography":
  1365. strContent = "拍摄";
  1366. strKey = "摄影师" + "='" + this.StrUserName + "'";
  1367. break;
  1368. case "PhotographyAssistant":
  1369. strContent = "拍摄助理";
  1370. strKey = "摄影助理" + "='" + this.StrUserName + "'";
  1371. break;
  1372. case "Makeup":
  1373. strContent = "化妆";
  1374. strKey = "化妆师" + "='" + this.StrUserName + "'";
  1375. break;
  1376. case "MakeupAssistant":
  1377. strContent = "化妆助理";
  1378. strKey = "化妆助理" + "='" + this.StrUserName + "'";
  1379. break;
  1380. case "BootDivision":
  1381. strContent = "引导";
  1382. strKey = "引导师" + "='" + this.StrUserName + "'";
  1383. break;
  1384. case "BootDivisionAssistant":
  1385. strContent = "引导助理";
  1386. strKey = "引导助理" + "='" + this.StrUserName + "'";
  1387. break;
  1388. }
  1389. }
  1390. DataGridViewRow BindClothDataListByRow(DataRow dtRow, string workContent)
  1391. {
  1392. dataType = workContent;
  1393. DataGridViewCell cell = null;
  1394. DataGridViewRow dgvr = null;
  1395. dgvr = new DataGridViewRow();
  1396. foreach (DataColumn colum in dtRow.Table.Columns)
  1397. {
  1398. cell = new DataGridViewTextBoxCell();
  1399. cell.Value = dtRow[colum.ColumnName].ToString();
  1400. dgvr.Cells.Add(cell);
  1401. }
  1402. cell = new DataGridViewTextBoxCell();
  1403. cell.Value = workContent;
  1404. dgvr.Cells.Add(cell);
  1405. this.dgvData.Rows.Add(dgvr);
  1406. dgvr.Tag = BindDataTableRowColumn(dgvr);
  1407. return dgvr;
  1408. }
  1409. /// <summary>
  1410. /// 订单流程点击
  1411. /// </summary>
  1412. /// <param name="sender"></param>
  1413. /// <param name="e"></param>
  1414. void lbl_BootDivision_Click(object sender, EventArgs e)
  1415. {
  1416. dataType = "";
  1417. if (this.panelDay.Tag != null)
  1418. {
  1419. this.dgvData.Tag = null;
  1420. this.dgvData.Rows.Clear();
  1421. BindDataTableColumData();
  1422. //this.dgvData2.Rows.Clear();
  1423. LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender;
  1424. string[] StrArray = lbl.Name.Trim().Split('_');
  1425. Dictionary<string, DataTable> dictData = (Dictionary<string, DataTable>)this.panelDay.Tag;
  1426. DataTable dtData = (DataTable)dictData["dtOrder"];
  1427. DataRow[] dtRows = dtData.Select("工作内容='" + this.GetWorkContent(StrArray[1]) + "'");
  1428. foreach (DataRow dtRow in dtRows)
  1429. { this.PublicOrderRows(dtRow); }
  1430. this.dgvData.ClearSelection();
  1431. //this.dgvData2.ClearSelection();
  1432. this.tabControlSelectedIndex();
  1433. }
  1434. }
  1435. /// <summary>
  1436. /// 订单流程点击
  1437. /// </summary>
  1438. /// <param name="sender"></param>
  1439. /// <param name="e"></param>
  1440. void lbl_EarlyRepair_Click(object sender, EventArgs e)
  1441. {
  1442. //LYFZ.Software.MainBusiness.DoorCityProcess.frmDigitalArrangement digitalForm = new DoorCityProcess.frmDigitalArrangement();
  1443. //digitalForm.labEarlyRepair.Checked = true;
  1444. //digitalForm.cbxMyJob.Checked = true;
  1445. //digitalForm.BindPostionSize();
  1446. //digitalForm.Show();
  1447. //this.Close();
  1448. if (this.panelDay.Tag != null)
  1449. {
  1450. this.dgvData.Tag = null;
  1451. this.dgvData.Rows.Clear();
  1452. this.dgvData.Columns.Clear();
  1453. //BindDataTableColumData();
  1454. //this.dgvData2.Rows.Clear();
  1455. LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender;
  1456. string[] StrArray = lbl.Name.Trim().Split('_');
  1457. Dictionary<string, DataTable> dictData = (Dictionary<string, DataTable>)this.panelDay.Tag;
  1458. //DataTable dtData = (DataTable)dictData["dtOrder"];
  1459. string StrDataTime = Convert.ToDateTime(this.numYear.Value + "-" + this.numMonth.Value + "-" + this.numDay.Value).ToYYYY_MM_dd();
  1460. DataTable dtData;
  1461. if (dictData.ContainsKey("dtEarlyRepairOrder"))
  1462. {
  1463. dtData = (DataTable)dictData["dtEarlyRepairOrder"];
  1464. }
  1465. else
  1466. {
  1467. string StrWhere = "";
  1468. StrWhere = " Ordv_EarlyRepairStatus in ('0', '1') And Ordv_ReservationEarlyRepairTime is not null ";
  1469. dtData = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayEarlyRepairWorkData(StrWhere);
  1470. dictData["dtEarlyRepairOrder"] = dtData;
  1471. }
  1472. string strWhere = "";
  1473. if (!chkAllUserWork.Checked)
  1474. {
  1475. //GetPhotographyByWhereData(StrArray[1], ref strKey, ref strContent);
  1476. strWhere = " 初修师编号 = '" + StrUserID + "' and 完成期限 >='" + StrDataTime + " 00:00:00' and 完成期限 <='" + StrDataTime + " 23:59:59' ";
  1477. }
  1478. ///字段数据
  1479. foreach (DataColumn dtColum in dtData.Columns)
  1480. {
  1481. DataGridViewTextBoxColumn textBoxColum = new DataGridViewTextBoxColumn();
  1482. textBoxColum.DataPropertyName = dtColum.ColumnName;//"工作内容";
  1483. textBoxColum.Name = dtColum.ColumnName;
  1484. textBoxColum.HeaderText = dtColum.ColumnName;
  1485. if (dtColum.ColumnName.Equals("初修师编号"))
  1486. {
  1487. textBoxColum.Visible = false;
  1488. }
  1489. if (dtColum.ColumnName.Equals("订单号"))
  1490. {
  1491. textBoxColum.Visible = false;
  1492. }
  1493. dgvData.Columns.Add(textBoxColum);
  1494. }
  1495. ///工作内容
  1496. DataGridViewTextBoxColumn tempTextBoxColum = new DataGridViewTextBoxColumn();
  1497. tempTextBoxColum.DataPropertyName = "工作内容";
  1498. tempTextBoxColum.Name = "工作内容";
  1499. tempTextBoxColum.HeaderText = "工作内容";
  1500. tempTextBoxColum.Visible = false;
  1501. dgvData.Columns.Add(tempTextBoxColum);
  1502. DataRow[] dtRows = dtData.Select(strWhere);
  1503. string keyNumber = "";
  1504. foreach (DataRow dtRow in dtRows)
  1505. {
  1506. DataGridViewRow tempDgvr = this.BindClothDataListByRow(dtRow, "初修");
  1507. if (keyNumber != dtRow["订单编号"].ToString())
  1508. {
  1509. keyNumber = dtRow["订单编号"].ToString();
  1510. }
  1511. else
  1512. {
  1513. tempDgvr.Cells["订单编号"].Value = "";
  1514. tempDgvr.Cells["客户名称"].Value = "";
  1515. tempDgvr.Cells["客户电话"].Value = "";
  1516. tempDgvr.Cells["套系名称"].Value = "";
  1517. tempDgvr.Cells["套系价格"].Value = "";
  1518. }
  1519. }
  1520. this.dgvData.ClearSelection();
  1521. //this.dgvData2.ClearSelection();
  1522. this.tabControlSelectedIndex();
  1523. }
  1524. }
  1525. /// <summary>
  1526. /// 客户任务
  1527. /// </summary>
  1528. /// <param name="sender"></param>
  1529. /// <param name="e"></param>
  1530. void lbl_ClientServiceTask_Click(object sender, EventArgs e)
  1531. {
  1532. if (this.panelDay.Tag != null)
  1533. {
  1534. this.dgvData.Rows.Clear();
  1535. //this.dgvData2.Rows.Clear();
  1536. Dictionary<string, DataTable> dictData = (Dictionary<string, DataTable>)this.panelDay.Tag;
  1537. DataTable dtData = (DataTable)dictData["dtTaskData"];
  1538. DataRow[] dtRows = dtData.Select("");
  1539. foreach (DataRow dtRow in dtRows)
  1540. { this.PublicTaskRows(dtRow); }
  1541. this.dgvData.ClearSelection();
  1542. //this.dgvData2.ClearSelection();
  1543. this.tabControlSelectedIndex();
  1544. }
  1545. }
  1546. /// <summary>
  1547. /// 今日跟踪点击
  1548. /// </summary>
  1549. /// <param name="sender"></param>
  1550. /// <param name="e"></param>
  1551. void lbl_TodayTrack_Click(object sender, EventArgs e)
  1552. {
  1553. if (this.panelDay.Tag != null)
  1554. {
  1555. this.dgvData.Rows.Clear();
  1556. this.dgvData.Columns.Clear();
  1557. string strColumn = "数码编号,订单号,订单类型,客户姓名,客户电话,工作内容,员工姓名,工作时间";
  1558. this.dgvData.DataColumns(strColumn, "数码编号");
  1559. //this.dgvData2.Rows.Clear();
  1560. Dictionary<string, DataTable> dictData = (Dictionary<string, DataTable>)this.panelDay.Tag;
  1561. DataTable dtDataTodayTrack = (DataTable)dictData["dtTodayTrack"];
  1562. DataRow[] dtTodayTrack = dtDataTodayTrack.Select("");
  1563. foreach (DataRow dtRow in dtTodayTrack)
  1564. { this.PublicOrderRows(dtRow); }
  1565. DataTable dtDataTodayHospital = (DataTable)dictData["dtTodayHospital"];
  1566. DataRow[] dtTodayHospital = dtDataTodayHospital.Select("");
  1567. foreach (DataRow dtRow in dtTodayHospital)
  1568. { this.PublicClientRows(dtRow); }
  1569. DataTable dtDataTodayClient = (DataTable)dictData["dtTodayClient"];
  1570. DataRow[] dtTodayClient = dtDataTodayClient.Select("");
  1571. foreach (DataRow dtRow in dtTodayClient)
  1572. { this.PublicClientRows(dtRow); }
  1573. this.dgvData.ClearSelection();
  1574. //this.dgvData2.ClearSelection();
  1575. this.tabControlSelectedIndex();
  1576. }
  1577. }
  1578. /// <summary>
  1579. /// 客户节日点击
  1580. /// </summary>
  1581. /// <param name="sender"></param>
  1582. /// <param name="e"></param>
  1583. void lbl_Birthday_Click(object sender, EventArgs e)
  1584. {
  1585. if (this.panelDay.Tag != null)
  1586. {
  1587. this.dgvData.Rows.Clear();
  1588. this.dgvData.Columns.Clear();
  1589. string strColumn = "数码编号,订单号,订单类型,客户姓名,客户电话,工作内容,员工姓名,工作时间";
  1590. this.dgvData.DataColumns(strColumn, "数码编号");
  1591. //this.dgvData2.Rows.Clear();
  1592. LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender;
  1593. string[] StrArray = lbl.Name.Trim().Split('_');
  1594. Dictionary<string, DataTable> dictData = (Dictionary<string, DataTable>)this.panelDay.Tag;
  1595. DataTable dtData = (DataTable)dictData["dtClient"];
  1596. DataRow[] dtTodayTrack = dtData.Select("工作内容='" + this.GetWorkContent(StrArray[1]) + "'");
  1597. foreach (DataRow dtRow in dtTodayTrack)
  1598. { this.PublicClientRows(dtRow); }
  1599. this.dgvData.ClearSelection();
  1600. //this.dgvData2.ClearSelection();
  1601. this.tabControlSelectedIndex();
  1602. }
  1603. }
  1604. void tabControlSelectedIndex()
  1605. {
  1606. if (this.dgvData.Rows.Count > 0)
  1607. { this.tabControlEx1.SelectedIndex = 0; }
  1608. //else if (this.dgvData2.Rows.Count > 0)
  1609. //{ this.tabControlEx1.SelectedIndex = 1; }
  1610. else
  1611. { this.tabControlEx1.SelectedIndex = 0; }
  1612. }
  1613. bool IsGoPages = false;
  1614. Form frmGoPages = null;
  1615. /// <summary>
  1616. /// 选择后去完成任务
  1617. /// </summary>
  1618. /// <param name="sender"></param>
  1619. /// <param name="e"></param>
  1620. void dgvData_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
  1621. { this.dgvCellDoubleClick(this.dgvData, e); }
  1622. /// <summary>
  1623. /// 选择后去完成任务
  1624. /// </summary>
  1625. /// <param name="sender"></param>
  1626. /// <param name="e"></param>
  1627. void dgvData2_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
  1628. {
  1629. //this.dgvCellDoubleClick(this.dgvData2, e);
  1630. }
  1631. /// <summary>
  1632. /// 我的任务双击事件
  1633. /// </summary>
  1634. /// <param name="sender"></param>
  1635. /// <param name="e"></param>
  1636. void dgvData3_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
  1637. {
  1638. if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
  1639. {
  1640. LYFZ.Software.MainBusiness.OAShopManagement.frmTeskView frm1 = new OAShopManagement.frmTeskView();
  1641. frm1.TeskRow = this.dgvData3.Rows[e.RowIndex];
  1642. frm1.Owner = this;
  1643. frm1.ShowDialog();
  1644. if (frm1.IsSaveed)
  1645. { }
  1646. }
  1647. }
  1648. /// <summary>
  1649. /// 选择后去完成任务
  1650. /// </summary>
  1651. /// <param name="dgv"></param>
  1652. void dgvCellDoubleClick(DataGridViewEc dgv, DataGridViewCellEventArgs e)
  1653. {
  1654. if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
  1655. {
  1656. if (dgv.Rows.Count > 0)
  1657. {
  1658. if (dgv.CurrentCell.ColumnIndex >= 0 && dgv.CurrentRow.Index >= 0)
  1659. {
  1660. if (!this.chkCompletedOK.Checked)
  1661. {
  1662. switch (dgv.CurrentRow.Cells["工作内容"].Value.ToString().Trim())
  1663. {
  1664. case "选礼服":
  1665. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.SelectDressConfirmSmallForm frm1 = new SmallForm.SelectDressConfirmSmallForm();
  1666. frm1.strViceNumber = dgv.CurrentRow.Cells["数码编号"].Value.ToString().Trim();
  1667. frm1.StartPosition = FormStartPosition.CenterScreen;
  1668. frm1.IsAnPai = true;
  1669. this.frmGoPages = frm1;
  1670. break;
  1671. case "化妆":
  1672. case "化妆助理":
  1673. case "拍摄":
  1674. case "拍摄助理":
  1675. case "引导师":
  1676. case "引导助理":
  1677. LYFZ.Software.MainBusiness.DoorCityProcess.PhotographedFormMain frm2 = new DoorCityProcess.PhotographedFormMain();
  1678. frm2.StrOrdNumber = dgv.CurrentRow.Cells["订单号"].Value.ToString().Trim();
  1679. frm2.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1680. frm2.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  1681. frm2.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  1682. this.frmGoPages = frm2;
  1683. break;
  1684. case "初修":
  1685. LYFZ.Software.MainBusiness.DoorCityProcess.RepairPieceFormMain frm3 = new DoorCityProcess.RepairPieceFormMain();
  1686. frm3.StrOrdNumber = dgv.CurrentRow.Cells["订单号"].Value.ToString().Trim();
  1687. frm3.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1688. frm3.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  1689. frm3.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  1690. this.frmGoPages = frm3;
  1691. break;
  1692. case "选片":
  1693. LYFZ.Software.MainBusiness.DoorCityProcess.FilmSelectionFormMain frm4 = new DoorCityProcess.FilmSelectionFormMain();
  1694. frm4.StrOrdNumber = dgv.CurrentRow.Cells["订单号"].Value.ToString().Trim();
  1695. frm4.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1696. frm4.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  1697. frm4.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  1698. this.frmGoPages = frm4;
  1699. break;
  1700. case "精修":
  1701. LYFZ.Software.MainBusiness.DoorCityProcess.RefinedRepairFormMain frm5 = new DoorCityProcess.RefinedRepairFormMain();
  1702. frm5.StrOrdNumber = dgv.CurrentRow.Cells["订单号"].Value.ToString().Trim();
  1703. frm5.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1704. frm5.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  1705. frm5.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  1706. this.frmGoPages = frm5;
  1707. break;
  1708. case "设计":
  1709. case "看设计":
  1710. LYFZ.Software.MainBusiness.DoorCityProcess.DesignFormMain frm6 = new DoorCityProcess.DesignFormMain();
  1711. frm6.StrOrdNumber = dgv.CurrentRow.Cells["订单号"].Value.ToString().Trim();
  1712. frm6.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1713. frm6.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  1714. frm6.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  1715. this.frmGoPages = frm6;
  1716. break;
  1717. case "发片师":
  1718. case "取件":
  1719. LYFZ.Software.MainBusiness.DoorCityProcess.TotakePieceFormMain frm7 = new DoorCityProcess.TotakePieceFormMain();
  1720. frm7.StrOrdNumber = dgv.CurrentRow.Cells["订单号"].Value.ToString().Trim();
  1721. frm7.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  1722. frm7.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  1723. frm7.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  1724. this.frmGoPages = frm7;
  1725. break;
  1726. case "服务人员":
  1727. LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.WeddingReservationSmallForm frm8 = new SmallForm.WeddingReservationSmallForm();
  1728. frm8.OrdNumber = dgv.CurrentRow.Cells["订单号"].Value.ToString().Trim();
  1729. this.frmGoPages = frm8;
  1730. break;
  1731. }
  1732. if (this.frmGoPages != null)
  1733. {
  1734. this.IsGoPages = true;
  1735. this.Close();
  1736. }
  1737. }
  1738. }
  1739. }
  1740. }
  1741. }
  1742. /// <summary>
  1743. /// 选项卡选择事件
  1744. /// </summary>
  1745. /// <param name="sender"></param>
  1746. /// <param name="e"></param>
  1747. void tabControlEx1_SelectedIndexChanged(object sender, EventArgs e)
  1748. {
  1749. switch (this.tabControlEx1.SelectedTab.Name.Trim())
  1750. {
  1751. case "tabPage1":
  1752. case "tabPage2":
  1753. this.chkAllUserWork.Visible = true;
  1754. this.chkCompletedTimeOut.Visible = true;
  1755. this.chkCompletedOK.Visible = true;
  1756. this.chkCompletedNot.Visible = true;
  1757. this.lblMyTaskCount.BackColor = System.Drawing.Color.FromArgb(220, 224, 253);
  1758. this.lblMyTaskCount.Location = new Point(this.lblMyTaskCount.Location.X, 51);
  1759. break;
  1760. case "tabPage3":
  1761. this.chkAllUserWork.Visible = false;
  1762. this.chkCompletedTimeOut.Visible = false;
  1763. this.chkCompletedOK.Visible = false;
  1764. this.chkCompletedNot.Visible = false;
  1765. this.lblMyTaskCount.BackColor = System.Drawing.Color.FromArgb(255, 255, 255);
  1766. this.lblMyTaskCount.Location = new Point(this.lblMyTaskCount.Location.X, 52);
  1767. break;
  1768. }
  1769. }
  1770. /// <summary>
  1771. /// 窗体关闭生事件
  1772. /// </summary>
  1773. /// <param name="sender"></param>
  1774. /// <param name="e"></param>
  1775. void MyWorkRemindFormMain_FormClosed(object sender, FormClosedEventArgs e)
  1776. {
  1777. if (this.IsGoPages)
  1778. { frmGoPages.Show(); }
  1779. }
  1780. /// <summary>
  1781. /// 点击我的任务数量
  1782. /// </summary>
  1783. /// <param name="sender"></param>
  1784. /// <param name="e"></param>
  1785. void lblMyTaskCount_Click(object sender, EventArgs e)
  1786. {
  1787. // this.tabControlEx1.SelectedIndex = 2;
  1788. }
  1789. }
  1790. }