123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.StatisticalInquiry
- {
- public partial class FrmResponsibleStatistics : Software.UI.StatisticalInquiry.FrmResponsibleStatistics
- {
- LYFZ.BLL.BLL_ErpOrderDigital digitalBll = new BLL.BLL_ErpOrderDigital();
-
- public FrmResponsibleStatistics()
- {
- btnQuery.Click += btnQuery_Click;
- btnClose.Click += btnClose_Click;
- dgvStatistics.CellDoubleClick += dgvStatistics_CellContentDoubleClick;
- this.Load += FrmResponsibleStatistics_Load;
- }
- void dgvStatistics_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
- {
- FrmResponsiblePersonDetails detail = new FrmResponsiblePersonDetails();
- detail.employeeId = dgvStatistics.Rows[e.RowIndex].Tag.ToString();
- detail.startTime = dtpStart.DateValue;
- detail.endTime = dtpEnd.DateValue;
- string headerText = dgvStatistics.Columns[e.ColumnIndex].HeaderText;
- switch(headerText)
- {
- case "摄影师":
- detail.cbxPhotograph.Checked=true;
- break;
- case "摄影师助理":
- detail.cbxPhotographAssist.Checked=true;
- break;
- case "化妆师":
- detail.cbxMakeup.Checked=true;
- break;
- case "化妆师助理":
- detail.cbxMakeupAssist.Checked=true;
- break;
- case "引导师":
- detail.cbxBoot.Checked=true;
- break;
- case "引导师助理":
- detail.cbxBootAssist.Checked=true;
- break;
- default:
- detail.cbxPhotograph.Checked=true;
- detail.cbxPhotographAssist.Checked=true;
- detail.cbxMakeup.Checked=true;
- detail.cbxMakeupAssist.Checked=true;
- detail.cbxBoot.Checked=true;
- detail.cbxBootAssist.Checked=true;
- break;
- }
-
- detail.ShowDialog();
- }
- void FrmResponsibleStatistics_Load(object sender, EventArgs e)
- {
- dtpStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
- dtpEnd.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
- GetUserDigitalOrderStatistics();
- }
- void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- void btnQuery_Click(object sender, EventArgs e)
- {
- GetUserDigitalOrderStatistics();
- }
- void GetUserDigitalOrderStatistics()
- {
- dgvStatistics.Rows.Clear();
- Dictionary<string, Dictionary<string, decimal>> dt = digitalBll.GetUserDigitalOrderStatistics(dtpStart.Value.ToString("yyyy-MM-dd"), dtpEnd.Value.ToString("yyyy-MM-dd"));
- foreach(string userName in dt.Keys)
- {
- int indx = dgvStatistics.Rows.Add();
- this.dgvStatistics.Rows[indx].Cells["责任人"].Value = userName;
- Dictionary<string, decimal> columKeys = dt[userName];
- foreach(string columKey in columKeys.Keys)
- {
- if (columKey!=("用户编号"))
- {
- this.dgvStatistics.Rows[indx].Cells[columKey].Value = columKeys[columKey];
- }
- }
- this.dgvStatistics.Rows[indx].Tag = columKeys["用户编号"].ToString();
- }
- }
-
- }
- }
|