A_EmployeeScheduleSmallForm.cs 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Globalization;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. namespace LYFZ.Software.MainBusiness.CameraControlBook.SmallForm
  12. {
  13. public partial class A_EmployeeScheduleSmallForm : LYFZ.Software.UI.CameraControlBook.SmallForm.A_EmployeeScheduleSmallForm
  14. {
  15. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  16. public A_EmployeeScheduleSmallForm()
  17. {
  18. this.Load += A_EmployeeScheduleSmallForm_Load;
  19. this.Shown += A_EmployeeScheduleSmallForm_Shown;
  20. this.btnLastWeek.Click += btnLastWeek_Click;
  21. this.btnNextWeek.Click += btnNextWeek_Click;
  22. this.btnQuery.Click += btnQuery_Click;
  23. this.btnClose.Click += btnClose_Click;
  24. this.dtpYearMonth.ClickChengedValue += dtpYearMonth_ClickChengedValue;
  25. this.dtpYearMonth.KeyDown += dtpYearMonth_KeyDown;
  26. this.chkWeekMode.Click += chkWeekMode_Click;
  27. this.cmbtreevDepartment.ComboBoxTree_NodeMouseClick += cmbtreevDepartment_ComboBoxTree_NodeMouseClick;
  28. this.dgvData.CellMouseDown += dgvData_CellMouseDown;
  29. this.dgvData.DataGridViewConMenu_ItemClicked += dgvData_DataGridViewConMenu_ItemClicked;
  30. this.dgvData.CellMouseDoubleClick += dgvData_CellMouseDoubleClick;
  31. }
  32. /// <summary>
  33. /// 分店数据
  34. /// </summary>
  35. DataTable dtStore = new DataTable();
  36. /// <summary>
  37. /// 部门数据
  38. /// </summary>
  39. DataTable dtDepartment = new DataTable();
  40. /// <summary>
  41. /// 周的开始
  42. /// </summary>
  43. DateTime WeekStartDate;
  44. /// <summary>
  45. /// 周的结束
  46. /// </summary>
  47. DateTime WeekEndDate;
  48. /// <summary>
  49. /// 有几个影楼的权限
  50. /// </summary>
  51. int StoreNameCount = 0;
  52. /// <summary>
  53. /// 窗体加载事件
  54. /// </summary>
  55. /// <param name="sender"></param>
  56. /// <param name="e"></param>
  57. void A_EmployeeScheduleSmallForm_Load(object sender, EventArgs e)
  58. {
  59. dtStore = orbll.GetView_Custom("tb_ErpCompanyInfo", StrWhere: "", ShowColumnName: "Company_DividedShop,Company_Name").Tables[0];
  60. dtStore.PrimaryKey = new DataColumn[] { dtStore.Columns["Company_DividedShop"] };
  61. dtDepartment = orbll.GetView_Custom("tb_ErpDepartment", StrWhere: "", ShowColumnName: "ID,Dt_Name").Tables[0];
  62. dtDepartment.PrimaryKey = new DataColumn[] { dtDepartment.Columns["ID"] };
  63. }
  64. /// <summary>
  65. /// 人员绑定
  66. /// </summary>
  67. void PublicPerson()
  68. {
  69. this.cmbtreevDepartment.Nodes.Clear();
  70. DataTable dtStoreName = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName("pb002", StrGroupKeyCode: "st064");
  71. DataTable dtDepartment = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.Tbl_Department;
  72. DataTable dtUser = LYFZ.Software.MainBusiness.DoorCityProcess.PublicGetVersionDataTable.GetUserTable(IsShowResign: false, IsShowAdmin: false);
  73. this.StoreNameCount = dtStoreName.Rows.Count;
  74. for (int k = 0; k < dtStoreName.Rows.Count; k++)
  75. {
  76. TreeNode rootStore = null;
  77. if (dtStoreName.Rows.Count == 1 && k == 0)
  78. {
  79. TreeNode rootNull = new TreeNode();
  80. rootNull.Text = " ";
  81. rootNull.Tag = "";
  82. rootNull.Name = "";
  83. this.cmbtreevDepartment.Nodes.Add(rootNull);
  84. }
  85. else
  86. {
  87. rootStore = new TreeNode();
  88. rootStore.Text = dtStoreName.Rows[k]["Company_Name"].ToString().Trim();
  89. rootStore.Tag = dtStoreName.Rows[k]["Company_DividedShop"].ToString().Trim();
  90. rootStore.Name = "StoreName";
  91. }
  92. for (int i = 0; i < dtDepartment.Rows.Count; i++)
  93. {
  94. DataRow[] dtRow = dtUser.Select("User_Department='" + dtDepartment.Rows[i]["ID"].ToString().Trim() + "' And User_DividedShop = '" + dtStoreName.Rows[k]["Company_DividedShop"].ToString().Trim() + "'");
  95. if (dtRow.Length <= 0)
  96. { continue; }
  97. TreeNode nodes = new TreeNode();
  98. nodes.Text = dtDepartment.Rows[i]["Dt_Name"].ToString();
  99. nodes.Tag = dtDepartment.Rows[i]["ID"].ToString().Trim();
  100. nodes.Name = "Department";
  101. TreeNode node;
  102. for (int j = 0; j < dtRow.Length; j++)
  103. {
  104. node = new TreeNode();
  105. node.Text = dtRow[j]["User_Name"].ToString();
  106. node.Tag = dtRow[j]["User_EmployeeID"].ToString();
  107. node.Name = "User";
  108. nodes.Nodes.Add(node);
  109. }
  110. if (rootStore == null)
  111. { this.cmbtreevDepartment.TreeView.Nodes.Add(nodes); }
  112. else
  113. { rootStore.Nodes.Add(nodes); }
  114. }
  115. if (rootStore != null)
  116. { this.cmbtreevDepartment.TreeView.Nodes.Add(rootStore); }
  117. }
  118. this.cmbtreevDepartment.Nodes[0].Expand();
  119. this.cmbtreevDepartment.TextFindTag(this.cmbtreevDepartment.Nodes[0].Text.Trim());
  120. //this.cmbtreevDepartment.SelectedNode = this.cmbtreevDepartment.GetNodeItem_TextToTag(this.cmbtreevDepartment.Nodes[0].Text.Trim());
  121. }
  122. /// <summary>
  123. /// 窗体加载事件
  124. /// </summary>
  125. /// <param name="sender"></param>
  126. /// <param name="e"></param>
  127. void A_EmployeeScheduleSmallForm_Shown(object sender, EventArgs e)
  128. {
  129. this.dtpYearMonth.StrDateValue = SDateTime.Now.ToString("yyyy-MM");
  130. this.PublicPerson();
  131. this.chkWeekMode_Click(null, null);
  132. bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(
  133. LYFZ.Software.MainBusiness.VersionControl.VersionFunctionEnum.员工考勤员工档期);
  134. if (!b)
  135. {
  136. this.Close();
  137. }
  138. }
  139. /// <summary>
  140. /// 上星期
  141. /// </summary>
  142. /// <param name="sender"></param>
  143. /// <param name="e"></param>
  144. void btnLastWeek_Click(object sender, EventArgs e)
  145. {
  146. this.WeekStartDate = this.WeekStartDate.AddDays(-7);
  147. this.WeekEndDate = this.WeekEndDate.AddDays(-7);
  148. this.lblWhichWeek.Text = "第" + new GregorianCalendar().GetWeekOfYear(this.WeekStartDate, CalendarWeekRule.FirstDay, DayOfWeek.Monday) + "周";
  149. this.PublicFunctionRows1();
  150. }
  151. /// <summary>
  152. /// 下星期
  153. /// </summary>
  154. /// <param name="sender"></param>
  155. /// <param name="e"></param>
  156. void btnNextWeek_Click(object sender, EventArgs e)
  157. {
  158. this.WeekStartDate = this.WeekStartDate.AddDays(7);
  159. this.WeekEndDate = this.WeekEndDate.AddDays(7);
  160. this.lblWhichWeek.Text = "第" + new GregorianCalendar().GetWeekOfYear(this.WeekStartDate, CalendarWeekRule.FirstDay, DayOfWeek.Monday) + "周";
  161. this.PublicFunctionRows1();
  162. }
  163. /// <summary>
  164. /// 查询
  165. /// </summary>
  166. /// <param name="sender"></param>
  167. /// <param name="e"></param>
  168. void btnQuery_Click(object sender, EventArgs e)
  169. {
  170. if (this.chkWeekMode.Checked == true)
  171. { PublicFunctionRows1(); }
  172. else
  173. { PublicFunctionRows(); }
  174. }
  175. /// <summary>
  176. /// 关闭
  177. /// </summary>
  178. /// <param name="sender"></param>
  179. /// <param name="e"></param>
  180. void btnClose_Click(object sender, EventArgs e)
  181. {
  182. this.Close();
  183. }
  184. /// <summary>
  185. /// 选择Value值更改事件
  186. /// </summary>
  187. /// <param name="SelectValue"></param>
  188. void dtpYearMonth_ClickChengedValue(string SelectValue)
  189. {
  190. PublicFunctionRows();
  191. }
  192. /// <summary>
  193. /// 回车事件
  194. /// </summary>
  195. void dtpYearMonth_KeyDown()
  196. {
  197. PublicFunctionRows();
  198. }
  199. /// <summary>
  200. /// 周月选择
  201. /// </summary>
  202. /// <param name="sender"></param>
  203. /// <param name="e"></param>
  204. void chkWeekMode_Click(object sender, EventArgs e)
  205. {
  206. if (this.chkWeekMode.Checked == true)
  207. {
  208. this.panelLastNextWeek.Visible = true;
  209. this.dtpYearMonth.Visible = false;
  210. this.lblWhichWeek.Visible = true;
  211. this.WeekStartDate = DateTime.Now.AddDays((-1) * Convert.ToInt32(DateTime.Now.DayOfWeek));
  212. this.WeekEndDate = WeekStartDate.AddDays(6);
  213. this.lblWhichWeek.Text = "第" + new GregorianCalendar().GetWeekOfYear(WeekStartDate, CalendarWeekRule.FirstDay, DayOfWeek.Monday) + "周";
  214. this.PublicFunctionRows1();
  215. }
  216. else
  217. {
  218. this.panelLastNextWeek.Visible = false;
  219. this.dtpYearMonth.Visible = true;
  220. this.lblWhichWeek.Visible = false;
  221. this.PublicFunctionRows();
  222. }
  223. }
  224. /// <summary>
  225. /// 部门下拉框
  226. /// </summary>
  227. /// <param name="sender"></param>
  228. /// <param name="e"></param>
  229. void cmbtreevDepartment_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
  230. {
  231. //this.btnQuery_Click(this, null);
  232. }
  233. /// <summary>
  234. /// 右键弹出菜单
  235. /// </summary>
  236. /// <param name="sender"></param>
  237. /// <param name="e"></param>
  238. void dgvData_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
  239. {
  240. if (e.Button == MouseButtons.Right)
  241. {
  242. ToolStripMenuItem item = null;
  243. if (e.ColumnIndex != this.dgvData.Columns["影楼名称"].Index && e.ColumnIndex != this.dgvData.Columns["部门"].Index && e.ColumnIndex != this.dgvData.Columns["姓名"].Index)
  244. {
  245. if (this.dgvData.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString().Trim() != "休息!")
  246. {
  247. this.dgvData.conMenu.Items.Clear();
  248. item = new ToolStripMenuItem();
  249. item.Height = item.Height * 2;
  250. item.Text = "安排拍照\r\n";
  251. item.Tag = "0";
  252. this.dgvData.conMenu.Items.Add(item);
  253. item = new ToolStripMenuItem();
  254. item.Height = item.Height * 2;
  255. item.Text = "安排选片\r\n";
  256. item.Tag = "1";
  257. this.dgvData.conMenu.Items.Add(item);
  258. item = new ToolStripMenuItem();
  259. item.Height = item.Height * 2;
  260. item.Text = "安排看设计\r\n";
  261. item.Tag = "2";
  262. this.dgvData.conMenu.Items.Add(item);
  263. item = new ToolStripMenuItem();
  264. item.Height = item.Height * 2;
  265. item.Text = "安排取件\r\n";
  266. item.Tag = "3";
  267. this.dgvData.conMenu.Items.Add(item);
  268. item = new ToolStripMenuItem();
  269. item.Height = item.Height * 2;
  270. item.Text = "安排服务\r\n";
  271. item.Tag = "4";
  272. this.dgvData.conMenu.Items.Add(item);
  273. item = new ToolStripMenuItem();
  274. item.Height = item.Height * 2;
  275. item.Text = "安排选礼服\r\n";
  276. item.Tag = "5";
  277. this.dgvData.conMenu.Items.Add(item);
  278. }
  279. }
  280. }
  281. }
  282. /// <summary>
  283. /// 右键菜单选择项事件
  284. /// </summary>
  285. /// <param name="sender"></param>
  286. /// <param name="e"></param>
  287. void dgvData_DataGridViewConMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  288. {
  289. ToolStripItem item = e.ClickedItem;
  290. if (LYFZ.Software.MainBusiness.CameraControlBook.PublicClass.LoadForm(item.Tag.ToString().Trim()))
  291. { this.btnQuery_Click(this, null); }
  292. }
  293. /// <summary>
  294. /// 单元格双击事件
  295. /// </summary>
  296. /// <param name="sender"></param>
  297. /// <param name="e"></param>
  298. void dgvData_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
  299. {
  300. if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
  301. {
  302. if (e.ColumnIndex >= 4)
  303. {
  304. if (string.IsNullOrEmpty(this.dgvData.CurrentCell.Value.ToString().Trim()))
  305. { MessageBoxCustom.Show("该员工当前尚未安排!"); return; }
  306. if (this.dgvData.CurrentCell.Value.ToString().Trim() == "休息!")
  307. { MessageBoxCustom.Show("该员工当天休息!"); return; }
  308. Hashtable htData = (Hashtable)this.dgvData.CurrentCell.Tag;
  309. LYFZ.Software.MainBusiness.TimeAndAttendance.A_EmployeeScheduleSmallFlighting frm = new TimeAndAttendance.A_EmployeeScheduleSmallFlighting();
  310. frm.StrJobsID = htData["StrJobsID"].ToString().Trim();
  311. frm.StrJobsText = htData["StrJobsText"].ToString().Trim();
  312. frm.StrDateTime = htData["StrDateDay"].ToString().Trim();
  313. frm.StrShowText = dgvData.CurrentRow.Cells[1].Value.ToString() + "" + dgvData.CurrentRow.Cells[2].Value.ToString() + " " + dgvData.CurrentRow.Cells[3].Value.ToString();
  314. frm.Show();
  315. }
  316. }
  317. }
  318. /// <summary>
  319. /// 获取查询条件
  320. /// </summary>
  321. /// <param name="StrWherePerson">查询条件</param>
  322. /// <returns></returns>
  323. Hashtable GetSelectQueryWhere(ref string StrWherePerson)
  324. {
  325. Hashtable htData = new Hashtable();
  326. if (this.cmbtreevDepartment.StrGetName.Trim() == "User")
  327. {
  328. StrWherePerson += " And 员工编号 = '" + this.cmbtreevDepartment.Tag.ToString().Trim() + "'";
  329. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(this.cmbtreevDepartment.Tag.ToString().Trim());
  330. if (dtRow != null)
  331. { htData[dtRow["User_EmployeeID"].ToString().Trim() + "|" + dtRow["User_Name"].ToString().Trim() + "|" + dtStore.Rows.Find(dtRow["User_DividedShop"].ToString().Trim())["Company_Name"].ToString().Trim()] = this.cmbtreevDepartment.SelectedNode.Parent.Text.Trim(); }
  332. }
  333. else if (this.cmbtreevDepartment.StrGetName.Trim() == "Department")
  334. {
  335. string StrPerson = "";
  336. for (int i = 0; i < this.cmbtreevDepartment.SelectedNode.Nodes.Count; i++)
  337. {
  338. StrPerson += "'" + this.cmbtreevDepartment.SelectedNode.Nodes[i].Tag.ToString().Trim() + "',";
  339. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(this.cmbtreevDepartment.SelectedNode.Nodes[i].Tag.ToString().Trim());
  340. if (dtRow != null)
  341. { htData[dtRow["User_EmployeeID"].ToString().Trim() + "|" + dtRow["User_Name"].ToString().Trim() + "|" + dtStore.Rows.Find(dtRow["User_DividedShop"].ToString().Trim())["Company_Name"].ToString().Trim()] = this.cmbtreevDepartment.SelectedNode.Text.Trim(); }
  342. }
  343. if (!string.IsNullOrEmpty(StrPerson))
  344. { StrWherePerson += " And 员工编号 in (" + StrPerson.TrimEnd(',') + ")"; }
  345. }
  346. else if (this.cmbtreevDepartment.StrGetName.Trim() == "StoreName")
  347. {
  348. string StrPerson = "";
  349. for (int i = 0; i < this.cmbtreevDepartment.SelectedNode.Nodes.Count; i++)
  350. {
  351. if (this.cmbtreevDepartment.SelectedNode.Nodes[i].Name.Trim() == "Department")
  352. {
  353. for (int j = 0; j < this.cmbtreevDepartment.SelectedNode.Nodes[i].Nodes.Count; j++)
  354. {
  355. if (this.cmbtreevDepartment.SelectedNode.Nodes[i].Nodes[j].Name.Trim() == "User")
  356. {
  357. StrPerson += "'" + this.cmbtreevDepartment.SelectedNode.Nodes[i].Nodes[j].Tag.ToString().Trim() + "',";
  358. DataRow dtRow = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(this.cmbtreevDepartment.SelectedNode.Nodes[i].Nodes[j].Tag.ToString().Trim());
  359. if (dtRow != null)
  360. { htData[dtRow["User_EmployeeID"].ToString().Trim() + "|" + dtRow["User_Name"].ToString().Trim() + "|" + dtStore.Rows.Find(dtRow["User_DividedShop"].ToString().Trim())["Company_Name"].ToString().Trim()] = this.cmbtreevDepartment.SelectedNode.Nodes[i].Text.Trim(); }
  361. }
  362. }
  363. }
  364. }
  365. if (!string.IsNullOrEmpty(StrPerson))
  366. { StrWherePerson += " And 员工编号 in (" + StrPerson.TrimEnd(',') + ")"; }
  367. }
  368. else
  369. {
  370. DataRow[] dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Select("User_Status <> '离职'");
  371. string StrPerson = "";
  372. for (int i = 0; i < dtRows.Length; i++)
  373. {
  374. StrPerson += "'" + dtRows[i]["User_EmployeeID"].ToString().Trim() + "',";
  375. DataRow dtRow = dtDepartment.Rows.Find(dtRows[i]["User_Department"].ToString().Trim());
  376. if (dtRow != null)
  377. {
  378. htData[dtRows[i]["User_EmployeeID"].ToString().Trim() + "|" + dtRows[i]["User_Name"].ToString().Trim() + "|" + dtStore.Rows.Find(dtRows[i]["User_DividedShop"].ToString().Trim())["Company_Name"].ToString().Trim()] = dtRow["Dt_Name"].ToString().Trim();
  379. }
  380. }
  381. if (!string.IsNullOrEmpty(StrPerson))
  382. { StrWherePerson += " And 员工编号 in (" + StrPerson.TrimEnd(',') + ")"; }
  383. }
  384. return htData;
  385. }
  386. /// <summary>
  387. /// 获取工作数据
  388. /// </summary>
  389. /// <param name="StrWherePerson"></param>
  390. /// <param name="StrWhere2"></param>
  391. /// <returns></returns>
  392. DataSet GetDataSetData(string StrWherePerson, string StrWhere2)
  393. {
  394. string GetColumn = "员工姓名,员工编号,工作时间,ID";
  395. DataSet dtSet = new DataSet();
  396. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, System.ComponentModel.BackgroundWorker backgroundWorker)
  397. {
  398. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql("BView_MyWorkClothing_No", StrWhere: StrWherePerson, ShowColumnName: GetColumn);
  399. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("BView_MyWorkMakeupArtist_No", StrWhere: StrWherePerson, ShowColumnName: GetColumn);
  400. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("BView_MyWorkMakeupAssistant_No", StrWhere: StrWherePerson, ShowColumnName: GetColumn);
  401. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("BView_MyWorkPhotographyName_No", StrWhere: StrWherePerson, ShowColumnName: GetColumn);
  402. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("BView_MyWorkPhotographyAssistant_No", StrWhere: StrWherePerson, ShowColumnName: GetColumn);
  403. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("BView_MyWorkBootDivision_No", StrWhere: StrWherePerson, ShowColumnName: GetColumn);
  404. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("BView_MyWorkEarlyRepairName_No", StrWhere: StrWherePerson, ShowColumnName: GetColumn);
  405. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("BView_MyWorkFilmSelection_No", StrWhere: StrWherePerson, ShowColumnName: GetColumn);
  406. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("BView_MyWorkRefinement_No", StrWhere: StrWherePerson, ShowColumnName: GetColumn);
  407. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("BView_MyWorkDesigner_No", StrWhere: StrWherePerson, ShowColumnName: GetColumn);
  408. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("BView_MyWorkLookDesign_No", StrWhere: StrWherePerson, ShowColumnName: GetColumn);
  409. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("BView_MyWorkPickup_No", StrWhere: StrWherePerson, ShowColumnName: GetColumn);
  410. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("BView_MyWorkService_No", StrWhere: StrWherePerson, ShowColumnName: GetColumn);
  411. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("BView_MyWorkSendPhoto_No", StrWhere: StrWherePerson, ShowColumnName: GetColumn);
  412. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("loninbansets", StrWhere: StrWhere2, ShowColumnName: "User_ID,Time,fixed");
  413. dtSet = orbll.GetView_Custom(ExecuteSql);
  414. });
  415. return dtSet;
  416. }
  417. /// <summary>
  418. /// 周查询
  419. /// </summary>
  420. void PublicFunctionRows1()
  421. {
  422. this.dgvData.Rows.Clear();
  423. DateTime CurrentDateValue = Convert.ToDateTime(LYFZ.Command.Command_Validate.DateTimeToString(WeekStartDate, "yyyy-MM-dd"));
  424. string StrWherePerson = "(工作时间查询 between '" + LYFZ.Command.Command_Validate.DateTimeToString(CurrentDateValue, "yyyy-MM-dd HH:mm:ss") + "' and '" + LYFZ.Command.Command_Validate.DateTimeToString(WeekEndDate, "yyyy-MM-dd HH:mm:ss") + "')";
  425. string StrWhere2 = "(Time between '" + LYFZ.Command.Command_Validate.DateTimeToString(CurrentDateValue, "yyyy-MM-dd HH:mm:ss") + "' and '" + LYFZ.Command.Command_Validate.DateTimeToString(WeekEndDate, "yyyy-MM-dd HH:mm:ss") + "')";
  426. Hashtable htData = this.GetSelectQueryWhere(ref StrWherePerson);
  427. DataSet dtSet = this.GetDataSetData(StrWherePerson, StrWhere2);
  428. DataTable newTable = new DataTable();
  429. newTable.Columns.Add("员工编号", typeof(string));
  430. newTable.Columns.Add("影楼名称", typeof(string));
  431. newTable.Columns.Add("部门", typeof(string));
  432. newTable.Columns.Add("姓名", typeof(string));
  433. for (int i = 1; i < 8; i++)
  434. { newTable.Columns.Add(i + "日", typeof(object)); }
  435. foreach (DictionaryEntry items in htData)
  436. {
  437. string[] StrArray = items.Key.ToString().Trim().Split('|');
  438. DataRow newRow = newTable.NewRow();
  439. newRow["员工编号"] = StrArray[0].Trim();
  440. newRow["影楼名称"] = StrArray[2].Trim();
  441. newRow["部门"] = items.Value.ToString().Trim();
  442. newRow["姓名"] = StrArray[1].Trim();
  443. #region 获取日期数据
  444. for (int i = 0; i < 7; i++)
  445. {
  446. string StrDateDay = LYFZ.Command.Command_Validate.DateTimeToString(WeekStartDate.AddDays(i));
  447. DataRow[] dtRows = dtSet.Tables[14].Select("User_ID = '" + StrArray[0].Trim() + "' and Time = '" + StrDateDay + "'");
  448. string StrShowText = "";
  449. string StrToolTipText = "";
  450. string StrJobsID = "";
  451. string StrJobsText = "";
  452. if (dtRows.Length > 0)
  453. {
  454. if (dtRows[0]["fixed"].ToString().Trim() == "休息")
  455. { StrShowText = "休息!"; }
  456. }
  457. if (string.IsNullOrEmpty(StrShowText))
  458. {
  459. string StrdtRowWhere = "员工编号 = '" + StrArray[0].Trim() + "' and 工作时间 = '" + StrDateDay + "'";
  460. DataRow[] dtRow0 = dtSet.Tables[0].Select(StrdtRowWhere);
  461. DataRow[] dtRow1 = dtSet.Tables[1].Select(StrdtRowWhere);
  462. DataRow[] dtRow2 = dtSet.Tables[2].Select(StrdtRowWhere);
  463. DataRow[] dtRow3 = dtSet.Tables[3].Select(StrdtRowWhere);
  464. DataRow[] dtRow4 = dtSet.Tables[4].Select(StrdtRowWhere);
  465. DataRow[] dtRow5 = dtSet.Tables[5].Select(StrdtRowWhere);
  466. DataRow[] dtRow6 = dtSet.Tables[6].Select(StrdtRowWhere);
  467. DataRow[] dtRow7 = dtSet.Tables[7].Select(StrdtRowWhere);
  468. DataRow[] dtRow8 = dtSet.Tables[8].Select(StrdtRowWhere);
  469. DataRow[] dtRow9 = dtSet.Tables[9].Select(StrdtRowWhere);
  470. DataRow[] dtRow10 = dtSet.Tables[10].Select(StrdtRowWhere);
  471. DataRow[] dtRow11 = dtSet.Tables[11].Select(StrdtRowWhere);
  472. DataRow[] dtRow12 = dtSet.Tables[12].Select(StrdtRowWhere);
  473. DataRow[] dtRow13 = dtSet.Tables[13].Select(StrdtRowWhere);
  474. int GroupCount = 0;
  475. if (dtRow0.Length > 0)
  476. {
  477. GroupCount += dtRow0.Length;
  478. StrToolTipText += "选衣:" + dtRow0.Length + "组\r\n";
  479. for (int y = 0; y < dtRow0.Length; y++)
  480. {
  481. StrJobsID += dtRow0[y][3].ToString().Trim() + ",";
  482. StrJobsText += "选衣,";
  483. }
  484. }
  485. if (dtRow1.Length > 0)
  486. {
  487. GroupCount += dtRow1.Length;
  488. StrToolTipText += "化妆师:" + dtRow1.Length + "组\r\n";
  489. for (int y = 0; y < dtRow1.Length; y++)
  490. {
  491. StrJobsID += dtRow1[y][3].ToString().Trim() + ",";
  492. StrJobsText += "化妆师,";
  493. }
  494. }
  495. if (dtRow2.Length > 0)
  496. {
  497. GroupCount += dtRow2.Length;
  498. StrToolTipText += "化妆助理:" + dtRow2.Length + "组\r\n";
  499. for (int y = 0; y < dtRow2.Length; y++)
  500. {
  501. StrJobsID += dtRow2[y][3].ToString().Trim() + ",";
  502. StrJobsText += "化妆助理,";
  503. }
  504. }
  505. if (dtRow3.Length > 0)
  506. {
  507. GroupCount += dtRow3.Length;
  508. StrToolTipText += "摄影师:" + dtRow3.Length + "组\r\n";
  509. for (int y = 0; y < dtRow3.Length; y++)
  510. {
  511. StrJobsID += dtRow3[y][3].ToString().Trim() + ",";
  512. StrJobsText += "摄影师,";
  513. }
  514. }
  515. if (dtRow4.Length > 0)
  516. {
  517. GroupCount += dtRow4.Length;
  518. StrToolTipText += "摄影助理:" + dtRow4.Length + "组\r\n";
  519. for (int y = 0; y < dtRow4.Length; y++)
  520. {
  521. StrJobsID += dtRow4[y][3].ToString().Trim() + ",";
  522. StrJobsText += "摄影助理,";
  523. }
  524. }
  525. if (dtRow5.Length > 0)
  526. {
  527. GroupCount += dtRow5.Length;
  528. StrToolTipText += "引导:" + dtRow5.Length + "组\r\n";
  529. for (int y = 0; y < dtRow5.Length; y++)
  530. {
  531. StrJobsID += dtRow5[y][3].ToString().Trim() + ",";
  532. StrJobsText += "引导,";
  533. }
  534. }
  535. if (dtRow6.Length > 0)
  536. {
  537. GroupCount += dtRow6.Length;
  538. StrToolTipText += "初修:" + dtRow6.Length + "组\r\n";
  539. for (int y = 0; y < dtRow6.Length; y++)
  540. {
  541. StrJobsID += dtRow6[y][3].ToString().Trim() + ",";
  542. StrJobsText += "初修,";
  543. }
  544. }
  545. if (dtRow7.Length > 0)
  546. {
  547. GroupCount += dtRow7.Length;
  548. StrToolTipText += "选片:" + dtRow7.Length + "组\r\n";
  549. for (int y = 0; y < dtRow7.Length; y++)
  550. {
  551. StrJobsID += dtRow7[y][3].ToString().Trim() + ",";
  552. StrJobsText += "选片,";
  553. }
  554. }
  555. if (dtRow8.Length > 0)
  556. {
  557. GroupCount += dtRow8.Length;
  558. StrToolTipText += "精修:" + dtRow8.Length + "组\r\n";
  559. for (int y = 0; y < dtRow8.Length; y++)
  560. {
  561. StrJobsID += dtRow8[y][3].ToString().Trim() + ",";
  562. StrJobsText += "精修,";
  563. }
  564. }
  565. if (dtRow9.Length > 0)
  566. {
  567. GroupCount += dtRow9.Length;
  568. StrToolTipText += "设计:" + dtRow9.Length + "组\r\n";
  569. for (int y = 0; y < dtRow9.Length; y++)
  570. {
  571. StrJobsID += dtRow9[y][3].ToString().Trim() + ",";
  572. StrJobsText += "设计,";
  573. }
  574. }
  575. if (dtRow10.Length > 0)
  576. {
  577. GroupCount += dtRow10.Length;
  578. StrToolTipText += "看设计:" + dtRow10.Length + "组\r\n";
  579. for (int y = 0; y < dtRow10.Length; y++)
  580. {
  581. StrJobsID += dtRow10[y][3].ToString().Trim() + ",";
  582. StrJobsText += "看设计,";
  583. }
  584. }
  585. if (dtRow11.Length > 0)
  586. {
  587. GroupCount += dtRow11.Length;
  588. StrToolTipText += "取件:" + dtRow11.Length + "组\r\n";
  589. for (int y = 0; y < dtRow11.Length; y++)
  590. {
  591. StrJobsID += dtRow11[y][3].ToString().Trim() + ",";
  592. StrJobsText += "取件,";
  593. }
  594. }
  595. if (dtRow12.Length > 0)
  596. {
  597. GroupCount += dtRow12.Length;
  598. StrToolTipText += "服务:" + dtRow12.Length + "组\r\n";
  599. for (int y = 0; y < dtRow12.Length; y++)
  600. {
  601. StrJobsID += dtRow12[y][3].ToString().Trim() + ",";
  602. StrJobsText += "服务,";
  603. }
  604. }
  605. if (dtRow13.Length > 0)
  606. {
  607. GroupCount += dtRow13.Length;
  608. StrToolTipText += "发片:" + dtRow13.Length + "组\r\n";
  609. for (int y = 0; y < dtRow13.Length; y++)
  610. {
  611. StrJobsID += dtRow13[y][3].ToString().Trim() + ",";
  612. StrJobsText += "发片,";
  613. }
  614. }
  615. if (GroupCount > 0)
  616. { StrShowText = GroupCount + "组"; }
  617. }
  618. Hashtable htdataDay = new Hashtable();
  619. htdataDay["StrShowText"] = StrShowText.TrimEnd(',');
  620. htdataDay["StrToolTipText"] = StrToolTipText.TrimEnd(',');
  621. htdataDay["StrDateDay"] = StrDateDay.TrimEnd(',');
  622. htdataDay["StrJobsID"] = StrJobsID.TrimEnd(',');
  623. htdataDay["StrJobsText"] = StrJobsText.TrimEnd(',');
  624. newRow[(i + 1) + "日"] = htdataDay;
  625. }
  626. #endregion
  627. newTable.Rows.Add(newRow);
  628. }
  629. string strColumn = "员工编号,影楼名称,部门,姓名";
  630. for (int i = 0; i < 7; i++)
  631. { strColumn += "," + this.WeekStartDate.AddDays(i).ToString("dddd") + "\r\n" + this.WeekStartDate.AddDays(i).ToString("MM月dd日") + ""; }
  632. string strHideField = "员工编号";
  633. if (this.StoreNameCount <= 1)
  634. { strHideField += ",影楼名称"; }
  635. this.dgvData.DataColumns(strColumn, strHideField: strHideField);
  636. this.dgvData.dgvColumnHeadersHeight = 45;
  637. this.dgvData.Columns["姓名"].Frozen = true;
  638. int IntdgvDataColumnsCount = this.dgvData.Columns.GetColumnCount(DataGridViewElementStates.Visible);
  639. int intThisWidth = this.dgvData.Width - 50;
  640. if (this.StoreNameCount <= 1)
  641. {
  642. IntdgvDataColumnsCount--;
  643. intThisWidth -= 150;
  644. }
  645. int intdgvDataWidth = intThisWidth / IntdgvDataColumnsCount;
  646. for (int i = 0; i < this.dgvData.Columns.Count; i++)
  647. {
  648. if (this.dgvData.Columns[i].Name.Trim() == "影楼名称")
  649. { this.dgvData.Columns[i].Width = 150; }
  650. else
  651. { this.dgvData.Columns[i].Width = intdgvDataWidth; }
  652. }
  653. DataGridViewRow dgvr = null;
  654. DataGridViewCell cell = null;
  655. for (int i = 0; i < newTable.Rows.Count; i++)
  656. {
  657. dgvr = new DataGridViewRow();
  658. for (int j = 0; j < newTable.Columns.Count; j++)
  659. {
  660. if (j > 3)
  661. {
  662. Hashtable htDataRow = (Hashtable)newTable.Rows[i][j];
  663. cell = new DataGridViewTextBoxCell();
  664. cell.Value = htDataRow["StrShowText"].ToString().Trim();
  665. cell.ToolTipText = htDataRow["StrToolTipText"].ToString().Trim();
  666. cell.Tag = htDataRow;
  667. dgvr.Cells.Add(cell);
  668. }
  669. else
  670. {
  671. cell = new DataGridViewTextBoxCell();
  672. cell.Value = newTable.Rows[i][j].ToString().Trim();
  673. dgvr.Cells.Add(cell);
  674. }
  675. }
  676. this.dgvData.Rows.Add(dgvr);
  677. }
  678. }
  679. /// <summary>
  680. /// 月查询
  681. /// </summary>
  682. void PublicFunctionRows()
  683. {
  684. this.dgvData.Rows.Clear();
  685. int intDayCount = System.Threading.Thread.CurrentThread.CurrentUICulture.Calendar.GetDaysInMonth(this.dtpYearMonth.StrYear, this.dtpYearMonth.StrMonth);
  686. string StrYearMonnth = this.dtpYearMonth.StrDateValue.Trim();
  687. DateTime CurrentDateValue = Convert.ToDateTime(StrYearMonnth + "-01");
  688. string StrWherePerson = "(工作时间查询 between '" + CurrentDateValue.ToString("yyyy-MM-dd HH:mm:ss") + "' and '" + CurrentDateValue.AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss") + "')";
  689. string StrWhere2 = "(Time between '" + CurrentDateValue.ToString("yyyy-MM-dd HH:mm:ss") + "' and '" + CurrentDateValue.AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss") + "')";
  690. Hashtable htData = this.GetSelectQueryWhere(ref StrWherePerson);
  691. DataSet dtSet = this.GetDataSetData(StrWherePerson, StrWhere2);
  692. DataTable newTable = new DataTable();
  693. newTable.Columns.Add("员工编号", typeof(string));
  694. newTable.Columns.Add("影楼名称", typeof(string));
  695. newTable.Columns.Add("部门", typeof(string));
  696. newTable.Columns.Add("姓名", typeof(string));
  697. for (int i = 1; i <= intDayCount; i++)
  698. { newTable.Columns.Add(i + "日", typeof(object)); }
  699. foreach (DictionaryEntry items in htData)
  700. {
  701. string[] StrArray = items.Key.ToString().Trim().Split('|');
  702. DataRow newRow = newTable.NewRow();
  703. newRow["员工编号"] = StrArray[0].Trim();
  704. newRow["影楼名称"] = StrArray[2].Trim();
  705. newRow["部门"] = items.Value.ToString().Trim();
  706. newRow["姓名"] = StrArray[1].Trim();
  707. #region 获取日期数据
  708. for (int i = 0; i < intDayCount; i++)
  709. {
  710. string StrDateDay = StrYearMonnth + "-" + (i + 1).ToString("d2");
  711. DataRow[] dtRows = dtSet.Tables[14].Select("User_ID = '" + StrArray[0].Trim() + "' and Time = '" + StrDateDay + "'");
  712. string StrShowText = "";
  713. string StrToolTipText = "";
  714. string StrJobsID = "";
  715. string StrJobsText = "";
  716. if (dtRows.Length > 0)
  717. {
  718. if (dtRows[0]["fixed"].ToString().Trim() == "休息")
  719. { StrShowText = "休息!"; }
  720. }
  721. if (string.IsNullOrEmpty(StrShowText))
  722. {
  723. string StrdtRowWhere = "员工编号 = '" + StrArray[0].Trim() + "' and 工作时间 = '" + StrDateDay + "'";
  724. DataRow[] dtRow0 = dtSet.Tables[0].Select(StrdtRowWhere);
  725. DataRow[] dtRow1 = dtSet.Tables[1].Select(StrdtRowWhere);
  726. DataRow[] dtRow2 = dtSet.Tables[2].Select(StrdtRowWhere);
  727. DataRow[] dtRow3 = dtSet.Tables[3].Select(StrdtRowWhere);
  728. DataRow[] dtRow4 = dtSet.Tables[4].Select(StrdtRowWhere);
  729. DataRow[] dtRow5 = dtSet.Tables[5].Select(StrdtRowWhere);
  730. DataRow[] dtRow6 = dtSet.Tables[6].Select(StrdtRowWhere);
  731. DataRow[] dtRow7 = dtSet.Tables[7].Select(StrdtRowWhere);
  732. DataRow[] dtRow8 = dtSet.Tables[8].Select(StrdtRowWhere);
  733. DataRow[] dtRow9 = dtSet.Tables[9].Select(StrdtRowWhere);
  734. DataRow[] dtRow10 = dtSet.Tables[10].Select(StrdtRowWhere);
  735. DataRow[] dtRow11 = dtSet.Tables[11].Select(StrdtRowWhere);
  736. DataRow[] dtRow12 = dtSet.Tables[12].Select(StrdtRowWhere);
  737. DataRow[] dtRow13 = dtSet.Tables[13].Select(StrdtRowWhere);
  738. int GroupCount = 0;
  739. if (dtRow0.Length > 0)
  740. {
  741. GroupCount += dtRow0.Length;
  742. StrToolTipText += "选衣:" + dtRow0.Length + "组\r\n";
  743. for (int y = 0; y < dtRow0.Length; y++)
  744. {
  745. StrJobsID += dtRow0[y][3].ToString().Trim() + ",";
  746. StrJobsText += "选衣,";
  747. }
  748. }
  749. if (dtRow1.Length > 0)
  750. {
  751. GroupCount += dtRow1.Length;
  752. StrToolTipText += "化妆师:" + dtRow1.Length + "组\r\n";
  753. for (int y = 0; y < dtRow1.Length; y++)
  754. {
  755. StrJobsID += dtRow1[y][3].ToString().Trim() + ",";
  756. StrJobsText += "化妆师,";
  757. }
  758. }
  759. if (dtRow2.Length > 0)
  760. {
  761. GroupCount += dtRow2.Length;
  762. StrToolTipText += "化妆助理:" + dtRow2.Length + "组\r\n";
  763. for (int y = 0; y < dtRow2.Length; y++)
  764. {
  765. StrJobsID += dtRow2[y][3].ToString().Trim() + ",";
  766. StrJobsText += "化妆助理,";
  767. }
  768. }
  769. if (dtRow3.Length > 0)
  770. {
  771. GroupCount += dtRow3.Length;
  772. StrToolTipText += "摄影师:" + dtRow3.Length + "组\r\n";
  773. for (int y = 0; y < dtRow3.Length; y++)
  774. {
  775. StrJobsID += dtRow3[y][3].ToString().Trim() + ",";
  776. StrJobsText += "摄影师,";
  777. }
  778. }
  779. if (dtRow4.Length > 0)
  780. {
  781. GroupCount += dtRow4.Length;
  782. StrToolTipText += "摄影助理:" + dtRow4.Length + "组\r\n";
  783. for (int y = 0; y < dtRow4.Length; y++)
  784. {
  785. StrJobsID += dtRow4[y][3].ToString().Trim() + ",";
  786. StrJobsText += "摄影助理,";
  787. }
  788. }
  789. if (dtRow5.Length > 0)
  790. {
  791. GroupCount += dtRow5.Length;
  792. StrToolTipText += "引导:" + dtRow5.Length + "组\r\n";
  793. for (int y = 0; y < dtRow5.Length; y++)
  794. {
  795. StrJobsID += dtRow5[y][3].ToString().Trim() + ",";
  796. StrJobsText += "引导,";
  797. }
  798. }
  799. if (dtRow6.Length > 0)
  800. {
  801. GroupCount += dtRow6.Length;
  802. StrToolTipText += "初修:" + dtRow6.Length + "组\r\n";
  803. for (int y = 0; y < dtRow6.Length; y++)
  804. {
  805. StrJobsID += dtRow6[y][3].ToString().Trim() + ",";
  806. StrJobsText += "初修,";
  807. }
  808. }
  809. if (dtRow7.Length > 0)
  810. {
  811. GroupCount += dtRow7.Length;
  812. StrToolTipText += "选片:" + dtRow7.Length + "组\r\n";
  813. for (int y = 0; y < dtRow7.Length; y++)
  814. {
  815. StrJobsID += dtRow7[y][3].ToString().Trim() + ",";
  816. StrJobsText += "选片,";
  817. }
  818. }
  819. if (dtRow8.Length > 0)
  820. {
  821. GroupCount += dtRow8.Length;
  822. StrToolTipText += "精修:" + dtRow8.Length + "组\r\n";
  823. for (int y = 0; y < dtRow8.Length; y++)
  824. {
  825. StrJobsID += dtRow8[y][3].ToString().Trim() + ",";
  826. StrJobsText += "精修,";
  827. }
  828. }
  829. if (dtRow9.Length > 0)
  830. {
  831. GroupCount += dtRow9.Length;
  832. StrToolTipText += "设计:" + dtRow9.Length + "组\r\n";
  833. for (int y = 0; y < dtRow9.Length; y++)
  834. {
  835. StrJobsID += dtRow9[y][3].ToString().Trim() + ",";
  836. StrJobsText += "设计,";
  837. }
  838. }
  839. if (dtRow10.Length > 0)
  840. {
  841. GroupCount += dtRow10.Length;
  842. StrToolTipText += "看设计:" + dtRow10.Length + "组\r\n";
  843. for (int y = 0; y < dtRow10.Length; y++)
  844. {
  845. StrJobsID += dtRow10[y][3].ToString().Trim() + ",";
  846. StrJobsText += "看设计,";
  847. }
  848. }
  849. if (dtRow11.Length > 0)
  850. {
  851. GroupCount += dtRow11.Length;
  852. StrToolTipText += "取件:" + dtRow11.Length + "组\r\n";
  853. for (int y = 0; y < dtRow11.Length; y++)
  854. {
  855. StrJobsID += dtRow11[y][3].ToString().Trim() + ",";
  856. StrJobsText += "取件,";
  857. }
  858. }
  859. if (dtRow12.Length > 0)
  860. {
  861. GroupCount += dtRow12.Length;
  862. StrToolTipText += "服务:" + dtRow12.Length + "组\r\n";
  863. for (int y = 0; y < dtRow12.Length; y++)
  864. {
  865. StrJobsID += dtRow12[y][3].ToString().Trim() + ",";
  866. StrJobsText += "服务,";
  867. }
  868. }
  869. if (dtRow13.Length > 0)
  870. {
  871. GroupCount += dtRow13.Length;
  872. StrToolTipText += "发片:" + dtRow13.Length + "组\r\n";
  873. for (int y = 0; y < dtRow13.Length; y++)
  874. {
  875. StrJobsID += dtRow13[y][3].ToString().Trim() + ",";
  876. StrJobsText += "发片,";
  877. }
  878. }
  879. if (GroupCount > 0)
  880. { StrShowText = GroupCount + "组"; }
  881. }
  882. Hashtable htdataDay = new Hashtable();
  883. htdataDay["StrShowText"] = StrShowText.TrimEnd(',');
  884. htdataDay["StrToolTipText"] = StrToolTipText.TrimEnd(',');
  885. htdataDay["StrDateDay"] = StrDateDay.TrimEnd(',');
  886. htdataDay["StrJobsID"] = StrJobsID.TrimEnd(',');
  887. htdataDay["StrJobsText"] = StrJobsText.TrimEnd(',');
  888. newRow[(i + 1) + "日"] = htdataDay;
  889. }
  890. #endregion
  891. newTable.Rows.Add(newRow);
  892. }
  893. this.dgvData.Columns.Clear();
  894. string strColumn = "员工编号,影楼名称,部门,姓名";
  895. for (int i = 1; i <= intDayCount; i++)
  896. { strColumn += "," + i.ToString() + "日\r\n" + Convert.ToDateTime(CurrentDateValue).AddDays(i - 1).ToString("dddd"); } string strHideField = "员工编号";
  897. if (this.StoreNameCount <= 1)
  898. { strHideField += ",影楼名称"; }
  899. this.dgvData.DataColumns(strColumn, strHideField: strHideField);
  900. this.dgvData.dgvColumnHeadersHeight = 45;
  901. this.dgvData.Columns["姓名"].Frozen = true;
  902. for (int i = 0; i < this.dgvData.Columns.Count; i++)
  903. {
  904. switch (this.dgvData.Columns[i].Name.Trim())
  905. {
  906. case "影楼名称":
  907. this.dgvData.Columns[i].Width = 150;
  908. break;
  909. case "姓名":
  910. case "部门":
  911. this.dgvData.Columns[i].Width = 80;
  912. break;
  913. default:
  914. this.dgvData.Columns[i].Width = 60;
  915. break;
  916. }
  917. }
  918. DataGridViewRow dgvr = null;
  919. DataGridViewCell cell = null;
  920. for (int i = 0; i < newTable.Rows.Count; i++)
  921. {
  922. dgvr = new DataGridViewRow();
  923. for (int j = 0; j < newTable.Columns.Count; j++)
  924. {
  925. if (j > 3)
  926. {
  927. Hashtable htDataRow = (Hashtable)newTable.Rows[i][j];
  928. cell = new DataGridViewTextBoxCell();
  929. cell.Value = htDataRow["StrShowText"].ToString().Trim();
  930. cell.ToolTipText = htDataRow["StrToolTipText"].ToString().Trim();
  931. cell.Tag = htDataRow;
  932. dgvr.Cells.Add(cell);
  933. }
  934. else
  935. {
  936. cell = new DataGridViewTextBoxCell();
  937. cell.Value = newTable.Rows[i][j].ToString().Trim();
  938. dgvr.Cells.Add(cell);
  939. }
  940. }
  941. this.dgvData.Rows.Add(dgvr);
  942. }
  943. }
  944. }
  945. }