using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; namespace LYFZ.Software.MainBusiness.StatisticalInquiry { public class FrmSliceStatisticsDetail : LYFZ.Software.UI.StatisticalInquiry.FrmSliceStatisticsDetail { BLL.BLL_ErpOrdersPhotography photographyBll = new BLL.BLL_ErpOrdersPhotography(); public string startTime = ""; public string endTime = ""; public string employeeId = ""; public string employeeKey = ""; public string employeeName = ""; public string employeeKeyName = ""; public string countData = ""; public string tempStrWhere = ""; public FrmSliceStatisticsDetail() { this.Load += FrmSliceStatisticsDetail_Load; } void FrmSliceStatisticsDetail_Load(object sender, EventArgs e) { this.btn_Export.Click += btn_Export_Click; SearchDataGridView(); } void btn_Export_Click(object sender, EventArgs e) { //throw new NotImplementedException(); this.dgvData.ExportDataTable(); } void SearchDataGridView() { this.dgvData.Rows.Clear(); string strWhere = ""; int totalCount = 0; strWhere = "( Ordpg_Photographer like '%" + employeeId + "%' or Ordpg_PhotographyAssistant like '%" + employeeId + "%' or Ordpg_MakeupArtist like '%" + employeeId + "%' or Ordpg_MakeupAssistant like '%" + employeeId + "%' or Ordpg_BootDivision like '%" + employeeId + "%' or Ordpg_BootDivisionAssistant like '%" + employeeId + "%' or Ordv_EarlyRepairName like '%" + employeeId + "%' or Ordv_RefinementName like '%" + employeeId + "%' or Ordv_FilmSelectionName like '%" + employeeId + "%' or Ordv_DesignerName like '%" + employeeId + "%' )"; if(!string.IsNullOrEmpty(employeeKey)) { strWhere = "( "+employeeKey+" = '" + employeeId + "' )"; } if(!string.IsNullOrEmpty(tempStrWhere)) { if(!string.IsNullOrEmpty(strWhere)) { strWhere += " and "; } strWhere += tempStrWhere; } DataTable selectionData = photographyBll.GetOrdersPhotographyDataBySelection( startTime, endTime, strWhere, true ); totalCount = selectionData.Rows.Count; List dicList = new List(); foreach(DataRow dr in selectionData.Rows) { if (dicList.IndexOf(dr["Ordpg_ViceNumber"].ToString()) == -1) { dicList.Add(dr["Ordpg_ViceNumber"].ToString()); } } if (dicList.Count > 0) { strWhere = " Ordpg_ViceNumber in ('" + string.Join("','", dicList.ToArray()) + "') "; selectionData = photographyBll.GetOrdersPhotographyDataBySelection( startTime, endTime, strWhere, true ); } string dRowNumber = ""; decimal totalValue = 0; decimal totalPickValue = 0; decimal totalPaymentValue = 0; foreach(DataRow dr in selectionData.Rows) { int rowIndex = this.dgvData.Rows.Add(); System.Windows.Forms.DataGridViewRow dgvRow = this.dgvData.Rows[rowIndex]; if(dRowNumber!=dr["ord_Number"].ToString()) { dRowNumber = dr["ord_Number"].ToString(); dgvRow.Cells["ord_Number"].Value = dr["ord_Number"].ToString(); dgvRow.Cells["ord_OrderClass"].Value = dr["ord_OrderClass"].ToString(); dgvRow.Cells["Ord_CustomerSource"].Value = dr["Ord_CustomerSource"].ToString(); dgvRow.Cells["Ord_SeriesName"].Value = dr["Ord_SeriesName"].ToString(); dgvRow.Cells["套系金额"].Value = dr["套系金额"].ToString(); dgvRow.Cells["加挑金额"].Value = dr["加挑金额"].ToString(); dgvRow.Cells["收款金额"].Value = dr["收款金额"].ToString(); dgvRow.Cells["Cus_Name"].Value = dr["Cus_Name"].ToString(); dgvRow.Cells["Cus_Telephone"].Value = dr["Cus_Telephone"].ToString(); totalValue += Convert.ToDecimal(dr["套系金额"].ToString()); totalPickValue += Convert.ToDecimal(dr["加挑金额"].ToString()); totalPaymentValue += Convert.ToDecimal(dr["收款金额"].ToString()); } dgvRow.Cells["Ordpg_Sights"].Value = dr["Ordpg_Sights"].ToString(); dgvRow.Cells["景点类型"].Value = dr["景点类型"].ToString(); dgvRow.Cells["景点等级"].Value = dr["景点等级"].ToString(); dgvRow.Cells["摄影师"].Value = dr["摄影师"].ToString(); dgvRow.Cells["摄影助理"].Value = dr["摄影助理"].ToString(); dgvRow.Cells["化妆师"].Value = dr["化妆师"].ToString(); dgvRow.Cells["化妆助理"].Value = dr["化妆助理"].ToString(); dgvRow.Cells["引导师"].Value = dr["引导师"].ToString(); dgvRow.Cells["引导助理"].Value = dr["引导助理"].ToString(); dgvRow.Cells["初修师"].Value = dr["初修师"].ToString(); dgvRow.Cells["精修师"].Value = dr["精修师"].ToString(); dgvRow.Cells["选片师"].Value = dr["选片师"].ToString(); dgvRow.Cells["设计师"].Value = dr["设计师"].ToString(); dgvRow.Cells["选片时间"].Value = dr["选片时间"].ToString(); } lab_Text.Text = employeeName + " "; if (!string.IsNullOrEmpty(employeeKeyName)) { lab_Text.Text += employeeKeyName + " " + totalCount + "次 "; } lab_Text.Text += "套系总金额:" + totalValue + " 加挑总金额:" + totalPickValue + " 收款总金额:" + totalPaymentValue; } } }