FrmResponsibleStatistics.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. namespace LYFZ.Software.MainBusiness.StatisticalInquiry
  10. {
  11. public partial class FrmResponsibleStatistics : Software.UI.StatisticalInquiry.FrmResponsibleStatistics
  12. {
  13. LYFZ.BLL.BLL_ErpOrderDigital digitalBll = new BLL.BLL_ErpOrderDigital();
  14. public FrmResponsibleStatistics()
  15. {
  16. btnQuery.Click += btnQuery_Click;
  17. btnClose.Click += btnClose_Click;
  18. dgvStatistics.CellDoubleClick += dgvStatistics_CellContentDoubleClick;
  19. this.Load += FrmResponsibleStatistics_Load;
  20. }
  21. void dgvStatistics_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
  22. {
  23. FrmResponsiblePersonDetails detail = new FrmResponsiblePersonDetails();
  24. detail.employeeId = dgvStatistics.Rows[e.RowIndex].Tag.ToString();
  25. detail.startTime = dtpStart.DateValue;
  26. detail.endTime = dtpEnd.DateValue;
  27. string headerText = dgvStatistics.Columns[e.ColumnIndex].HeaderText;
  28. switch(headerText)
  29. {
  30. case "摄影师":
  31. detail.cbxPhotograph.Checked=true;
  32. break;
  33. case "摄影师助理":
  34. detail.cbxPhotographAssist.Checked=true;
  35. break;
  36. case "化妆师":
  37. detail.cbxMakeup.Checked=true;
  38. break;
  39. case "化妆师助理":
  40. detail.cbxMakeupAssist.Checked=true;
  41. break;
  42. case "引导师":
  43. detail.cbxBoot.Checked=true;
  44. break;
  45. case "引导师助理":
  46. detail.cbxBootAssist.Checked=true;
  47. break;
  48. default:
  49. detail.cbxPhotograph.Checked=true;
  50. detail.cbxPhotographAssist.Checked=true;
  51. detail.cbxMakeup.Checked=true;
  52. detail.cbxMakeupAssist.Checked=true;
  53. detail.cbxBoot.Checked=true;
  54. detail.cbxBootAssist.Checked=true;
  55. break;
  56. }
  57. detail.ShowDialog();
  58. }
  59. void FrmResponsibleStatistics_Load(object sender, EventArgs e)
  60. {
  61. dtpStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
  62. dtpEnd.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  63. GetUserDigitalOrderStatistics();
  64. }
  65. void btnClose_Click(object sender, EventArgs e)
  66. {
  67. this.Close();
  68. }
  69. void btnQuery_Click(object sender, EventArgs e)
  70. {
  71. GetUserDigitalOrderStatistics();
  72. }
  73. void GetUserDigitalOrderStatistics()
  74. {
  75. dgvStatistics.Rows.Clear();
  76. Dictionary<string, Dictionary<string, decimal>> dt = digitalBll.GetUserDigitalOrderStatistics(dtpStart.Value.ToString("yyyy-MM-dd"), dtpEnd.Value.ToString("yyyy-MM-dd"));
  77. foreach(string userName in dt.Keys)
  78. {
  79. int indx = dgvStatistics.Rows.Add();
  80. this.dgvStatistics.Rows[indx].Cells["责任人"].Value = userName;
  81. Dictionary<string, decimal> columKeys = dt[userName];
  82. foreach(string columKey in columKeys.Keys)
  83. {
  84. if (columKey!=("用户编号"))
  85. {
  86. this.dgvStatistics.Rows[indx].Cells[columKey].Value = columKeys[columKey];
  87. }
  88. }
  89. this.dgvStatistics.Rows[indx].Tag = columKeys["用户编号"].ToString();
  90. }
  91. }
  92. }
  93. }