using LYFZ.ComponentLibrary; using System; using System.Collections; 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.CameraControlBook { public partial class MyWorkRemindFormMain : LYFZ.Software.UI.CameraControlBook.MyWorkRemindFormMain { LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder(); string dataType = ""; public MyWorkRemindFormMain() { this.Shown += MyWorkRemindFormMain_Shown; this.Load += MyWorkRemindFormMain_Load; this.numYear.KeyDown += numYear_KeyDown; this.numMonth.KeyDown += numMonth_KeyDown; this.numDay.KeyDown += numDay_KeyDown; this.numYear.ValueChanged += numYear_ValueChanged; this.numMonth.ValueChanged += numMonth_ValueChanged; this.numDay.ValueChanged += numDay_ValueChanged; this.chkCompletedOK.Click += chkCompletedOK_Click; this.chkCompletedNot.Click += chkCompletedNot_Click; this.chkCompletedTimeOut.Click += chkCompletedTimeOut_Click; this.panelDay.Click += panelDay_Click; this.lbl_Clothing.Click += lbl_Clothing_Click; this.lbl_Photography.Click += lbl_Photograph_Click; this.lbl_PhotographyAssistant.Click += lbl_Photograph_Click; this.lbl_Makeup.Click += lbl_Photograph_Click; this.lbl_MakeupAssistant.Click += lbl_Photograph_Click; this.lbl_BootDivision.Click += lbl_Photograph_Click; this.lbl_BootDivisionAssistant.Click += lbl_Photograph_Click; this.lbl_EarlyRepair.Click += lbl_EarlyRepair_Click; this.lbl_FilmSelection.Click += lbl_FilmSelection_Click; this.lbl_RefinedRepair.Click += lbl_RefinedRepair_Click; this.lbl_Design.Click += lbl_Design_Click; this.lbl_LookDesign.Click += lbl_BootDivision_Click; this.lbl_SendPhoto.Click += lbl_BootDivision_Click;//lbl_SendPhoto_Click ; this.lbl_Pickup.Click += lbl_BootDivision_Click; this.lbl_Service.Click += lbl_BootDivision_Click; this.lbl_ClientServiceTask.Click += lbl_ClientServiceTask_Click; this.lbl_TodayTrack.Click += lbl_TodayTrack_Click; this.lbl_MemorialDay.Click += lbl_Birthday_Click; this.lbl_Marriage.Click += lbl_Birthday_Click; this.lbl_HundredDay.Click += lbl_Birthday_Click; this.lbl_FullMoon.Click += lbl_Birthday_Click; this.lbl_Birthday.Click += lbl_Birthday_Click; this.dgvData.CellDoubleClick += dgvData_CellDoubleClick; //this.dgvData2.CellDoubleClick += dgvData2_CellDoubleClick; this.dgvData3.CellMouseDoubleClick += dgvData3_CellMouseDoubleClick; this.chkAllUserWork.Click += chkAllUserWork_Click; this.FormClosed += MyWorkRemindFormMain_FormClosed; this.tabControlEx1.SelectedIndexChanged += tabControlEx1_SelectedIndexChanged; this.lblMyTaskCount.Click += lblMyTaskCount_Click; this.dgvData.BindFilterColumnDataEvent += dgvData_DataBindingComplete; } private void lbl_SendPhoto_Click(object sender, EventArgs e) { LYFZ.Software.MainBusiness.DoorCityProcess.frmDigitalArrangement digitalForm = new DoorCityProcess.frmDigitalArrangement(); digitalForm.labSendData.Checked = true; digitalForm.cbxMyJob.Checked = true; digitalForm.BindPostionSize(); digitalForm.Show(); this.Close(); } void dgvData_DataBindingComplete() { //throw new NotImplementedException(); if (dataType == "设计" || dataType == "精修" || dataType == "选片" || dataType == "选衣" || dataType == "初修") { string keyNumber = ""; foreach (DataGridViewRow tempDgvr in dgvData.Rows) { if (keyNumber != tempDgvr.Cells["订单编号"].Value.ToString()) { keyNumber = tempDgvr.Cells["订单编号"].Value.ToString(); } else { tempDgvr.Cells["订单编号"].Value = ""; tempDgvr.Cells["客户名称"].Value = ""; tempDgvr.Cells["客户电话"].Value = ""; tempDgvr.Cells["套系名称"].Value = ""; tempDgvr.Cells["套系价格"].Value = ""; } } } } private void lbl_Design_Click(object sender, EventArgs e) { //LYFZ.Software.MainBusiness.DoorCityProcess.frmDigitalArrangement digitalForm = new DoorCityProcess.frmDigitalArrangement(); //digitalForm.labDesign.Checked = true; //digitalForm.cbxMyJob.Checked = true; //digitalForm.BindPostionSize(); //digitalForm.Show(); //this.Close(); if (this.panelDay.Tag != null) { this.dgvData.Tag = null; this.dgvData.Rows.Clear(); this.dgvData.Columns.Clear(); //BindDataTableColumData(); //this.dgvData2.Rows.Clear(); LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender; string[] StrArray = lbl.Name.Trim().Split('_'); Dictionary dictData = (Dictionary)this.panelDay.Tag; //DataTable dtData = (DataTable)dictData["dtOrder"]; string StrDataTime = Convert.ToDateTime(this.numYear.Value + "-" + this.numMonth.Value + "-" + this.numDay.Value).ToYYYY_MM_dd(); DataTable dtData; if (dictData.ContainsKey("dtDesignOrder")) { dtData = (DataTable)dictData["dtDesignOrder"]; } else { string StrWhere = ""; StrWhere = " Ordv_DesignerStatus in ('0', '1') And Ordv_ReservationDesignerTime is not null "; dtData = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayDesignWorkData(StrWhere); dictData["dtDesignOrder"] = dtData; } string strWhere = ""; if (!chkAllUserWork.Checked) { //GetPhotographyByWhereData(StrArray[1], ref strKey, ref strContent); strWhere = " 设计师编号 = '" + StrUserID + "' and 完成期限 >='" + StrDataTime + " 00:00:00' and 完成期限 <='" + StrDataTime + " 23:59:59' "; } ///字段数据 foreach (DataColumn dtColum in dtData.Columns) { DataGridViewTextBoxColumn textBoxColum = new DataGridViewTextBoxColumn(); textBoxColum.DataPropertyName = dtColum.ColumnName; textBoxColum.Name = dtColum.ColumnName; textBoxColum.HeaderText = dtColum.ColumnName; if (dtColum.ColumnName.Equals("设计师编号")) { textBoxColum.Visible = false; } if (dtColum.ColumnName.Equals("订单号")) { textBoxColum.Visible = false; } dgvData.Columns.Add(textBoxColum); } ///工作内容 DataGridViewTextBoxColumn tempTextBoxColum = new DataGridViewTextBoxColumn(); tempTextBoxColum.Name = "工作内容"; tempTextBoxColum.DataPropertyName = "工作内容"; tempTextBoxColum.HeaderText = "工作内容"; tempTextBoxColum.Visible = false; dgvData.Columns.Add(tempTextBoxColum); DataRow[] dtRows = dtData.Select(strWhere); string keyNumber = ""; foreach (DataRow dtRow in dtRows) { DataGridViewRow tempDgvr = this.BindClothDataListByRow(dtRow, "设计"); if (keyNumber != dtRow["订单编号"].ToString()) { keyNumber = dtRow["订单编号"].ToString(); } else { tempDgvr.Cells["订单编号"].Value = ""; tempDgvr.Cells["客户名称"].Value = ""; tempDgvr.Cells["客户电话"].Value = ""; tempDgvr.Cells["套系名称"].Value = ""; tempDgvr.Cells["套系价格"].Value = ""; } } this.dgvData.ClearSelection(); //this.dgvData2.ClearSelection(); this.tabControlSelectedIndex(); } } private void lbl_RefinedRepair_Click(object sender, EventArgs e) { //LYFZ.Software.MainBusiness.DoorCityProcess.frmDigitalArrangement digitalForm = new DoorCityProcess.frmDigitalArrangement(); //digitalForm.labRefineRepair.Checked = true; //digitalForm.cbxMyJob.Checked = true; //digitalForm.BindPostionSize(); //digitalForm.Show(); //this.Close(); if (this.panelDay.Tag != null) { this.dgvData.Tag = null; this.dgvData.Rows.Clear(); this.dgvData.Columns.Clear(); //BindDataTableColumData(); //this.dgvData2.Rows.Clear(); LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender; string[] StrArray = lbl.Name.Trim().Split('_'); Dictionary dictData = (Dictionary)this.panelDay.Tag; //DataTable dtData = (DataTable)dictData["dtOrder"]; string StrDataTime = Convert.ToDateTime(this.numYear.Value + "-" + this.numMonth.Value + "-" + this.numDay.Value).ToYYYY_MM_dd(); DataTable dtData; if (dictData.ContainsKey("dtRefinedRepairOrder")) { dtData = (DataTable)dictData["dtRefinedRepairOrder"]; } else { string StrWhere = ""; StrWhere = " Ordv_RefinementStatus in ('0', '1') And Ordv_ReservationRefinementTime is not null "; dtData = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayRefinedRepairWorkData(StrWhere); dictData["dtRefinedRepairOrder"] = dtData; } string strWhere = ""; if (!chkAllUserWork.Checked) { //GetPhotographyByWhereData(StrArray[1], ref strKey, ref strContent); strWhere = " 精修师编号 = '" + StrUserID + "' and 完成期限 >='" + StrDataTime + " 00:00:00' and 完成期限 <='" + StrDataTime + " 23:59:59' "; } ///字段数据 foreach (DataColumn dtColum in dtData.Columns) { DataGridViewTextBoxColumn textBoxColum = new DataGridViewTextBoxColumn(); textBoxColum.DataPropertyName = dtColum.ColumnName; textBoxColum.Name = dtColum.ColumnName; textBoxColum.HeaderText = dtColum.ColumnName; if (dtColum.ColumnName.Equals("精修师编号")) { textBoxColum.Visible = false; } if (dtColum.ColumnName.Equals("订单号")) { textBoxColum.Visible = false; } dgvData.Columns.Add(textBoxColum); } ///工作内容 DataGridViewTextBoxColumn tempTextBoxColum = new DataGridViewTextBoxColumn(); tempTextBoxColum.DataPropertyName = "工作内容";// dtColum.ColumnName; tempTextBoxColum.Name = "工作内容"; tempTextBoxColum.HeaderText = "工作内容"; tempTextBoxColum.Visible = false; dgvData.Columns.Add(tempTextBoxColum); DataRow[] dtRows = dtData.Select(strWhere); string keyNumber = ""; foreach (DataRow dtRow in dtRows) { DataGridViewRow tempDgvr = this.BindClothDataListByRow(dtRow, "精修"); if (keyNumber != dtRow["订单编号"].ToString()) { keyNumber = dtRow["订单编号"].ToString(); } else { tempDgvr.Cells["订单编号"].Value = ""; tempDgvr.Cells["客户名称"].Value = ""; tempDgvr.Cells["客户电话"].Value = ""; tempDgvr.Cells["套系名称"].Value = ""; tempDgvr.Cells["套系价格"].Value = ""; } } this.dgvData.ClearSelection(); //this.dgvData2.ClearSelection(); this.tabControlSelectedIndex(); } } private void lbl_FilmSelection_Click(object sender, EventArgs e) { if (this.panelDay.Tag != null) { this.dgvData.Tag = null; this.dgvData.Rows.Clear(); this.dgvData.Columns.Clear(); //BindDataTableColumData(); //this.dgvData2.Rows.Clear(); LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender; string[] StrArray = lbl.Name.Trim().Split('_'); Dictionary dictData = (Dictionary)this.panelDay.Tag; //DataTable dtData = (DataTable)dictData["dtOrder"]; string StrDataTime = Convert.ToDateTime(this.numYear.Value + "-" + this.numMonth.Value + "-" + this.numDay.Value).ToYYYY_MM_dd(); DataTable dtData; if (dictData.ContainsKey("dtFilmSelectionOrder")) { dtData = (DataTable)dictData["dtFilmSelectionOrder"]; } else { string StrWhere = ""; if (chkCompletedOK.Checked) { StrWhere = " Ordv_FilmSelectionStatus in ('1') And Ordv_ReservationFilmSelectionTime is not null "; } else if (chkCompletedNot.Checked||chkCompletedTimeOut.Checked) { StrWhere = " Ordv_FilmSelectionStatus in ('0') And Ordv_ReservationFilmSelectionTime is not null "; } dtData = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayFilmSelectionWorkData(StrWhere); dictData["dtFilmSelectionOrder"] = dtData; } string strWhere = ""; if (!chkAllUserWork.Checked) { //GetPhotographyByWhereData(StrArray[1], ref strKey, ref strContent); strWhere = " 选片师编号 = '" + StrUserID + "' "; } if(!string.IsNullOrEmpty(strWhere)) { strWhere +=" and "; } if (chkCompletedOK.Checked || chkCompletedNot.Checked) { strWhere += " 选片时间 ='" + StrDataTime + "' "; } else { strWhere += " 选片时间 <'" + StrDataTime + "' "; } ///字段数据 foreach (DataColumn dtColum in dtData.Columns) { DataGridViewTextBoxColumn textBoxColum = new DataGridViewTextBoxColumn(); textBoxColum.DataPropertyName = dtColum.ColumnName; textBoxColum.Name = dtColum.ColumnName; textBoxColum.HeaderText = dtColum.ColumnName; if (dtColum.ColumnName.Equals("选片师编号")) { textBoxColum.Visible = false; } if (dtColum.ColumnName.Equals("订单号")) { textBoxColum.Visible = false; } dgvData.Columns.Add(textBoxColum); } ///工作内容 DataGridViewTextBoxColumn tempTextBoxColum = new DataGridViewTextBoxColumn(); tempTextBoxColum.DataPropertyName = "工作内容"; tempTextBoxColum.Name = "工作内容"; tempTextBoxColum.HeaderText = "工作内容"; tempTextBoxColum.Visible = false; dgvData.Columns.Add(tempTextBoxColum); DataRow[] dtRows = dtData.Select(strWhere); string keyNumber = ""; foreach (DataRow dtRow in dtRows) { DataGridViewRow tempDgvr = this.BindClothDataListByRow(dtRow, "选片"); if (keyNumber != dtRow["订单编号"].ToString()) { keyNumber = dtRow["订单编号"].ToString(); } else { tempDgvr.Cells["订单编号"].Value = ""; tempDgvr.Cells["客户名称"].Value = ""; tempDgvr.Cells["客户电话"].Value = ""; tempDgvr.Cells["套系名称"].Value = ""; tempDgvr.Cells["套系价格"].Value = ""; } } this.dgvData.ClearSelection(); //this.dgvData2.ClearSelection(); this.tabControlSelectedIndex(); } } void chkAllUserWork_Click(object sender, EventArgs e) { PublicFunctionRows(); } bool IsFrist = true; /// /// 影楼编号 /// string StrCompanyID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); /// /// 员工编号 /// string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID; /// /// 员工姓名 /// string StrUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name; /// /// 获取类型 /// /// /// string GetWorkContent(string StrTypeCode) { switch (StrTypeCode) { case "Clothing": return "选衣"; case "Makeup": return "化妆"; case "MakeupAssistant": return "化妆助理"; case "Photography": return "拍摄"; case "PhotographyAssistant": return "拍摄助理"; case "BootDivision": return "引导"; case "BootDivisionAssistant": return "引导助理"; case "EarlyRepair": return "初修"; case "FilmSelection": return "选片"; case "RefinedRepair": return "精修"; case "Design": return "设计"; case "LookDesign": return "看设计"; case "SendPhoto": return "发片"; case "Pickup": return "取件"; case "Service": return "服务人员"; case "Marriage": return "婚期"; case "MemorialDay": return "纪念日"; case "Birthday": return "生日"; case "FullMoon": return "满月"; case "HundredDay": return "百天"; } return ""; } /// /// 获取类型编码 /// /// /// string GetWorkContentCode(string StrTypeName) { switch (StrTypeName) { case "选衣": return "Clothing"; case "化妆": return "Makeup"; case "化妆助理": return "MakeupAssistant"; case "拍摄": return "Photography"; case "拍摄助理": return "PhotographyAssistant"; case "引导": return "BootDivision"; case "引导助理": return "BootDivisionAssistant"; case "初修": return "EarlyRepair"; case "选片": return "FilmSelection"; case "精修": return "RefinedRepair"; case "设计": return "Design"; case "看设计": return "LookDesign"; case "发片": return "SendPhoto"; case "取件": return "Pickup"; case "服务人员": return "Service"; case "婚期": return "Marriage"; case "纪念日": return "MemorialDay"; case "生日": return "Birthday"; case "满月": return "FullMoon"; case "百天": return "HundredDay"; } return ""; } /// /// 窗体首次加载 /// /// /// void MyWorkRemindFormMain_Load(object sender, EventArgs e) { this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y); this.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height); string strColumn = "数码编号,订单号,订单类型,客户姓名,客户电话,工作内容,员工姓名,工作时间"; this.dgvData.DataColumns(strColumn, "数码编号"); //this.dgvData2.DataColumns(strColumn, "数码编号"); this.dgvData3.DataColumns("ID,状态,级别,发布人,发布时间,任务内容,办理人,完成期限", strHideField: "ID"); this.dgvData3.Columns["状态"].Width = 40; this.dgvData3.Columns["级别"].Width = 40; this.dgvData3.Columns["发布人"].Width = 70; this.dgvData3.Columns["办理人"].Width = 70; this.dgvData3.Columns["发布时间"].Width = 105; this.dgvData3.Columns["完成期限"].Width = 105; this.dgvData3.Columns["任务内容"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; this.dgvData3.Columns["状态"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; this.dgvData3.Columns["级别"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; this.paneltitle.BackColor = UIBlueThemeResources.SightsSelectTableBorderColor; } /// /// 窗体首次加载 /// /// /// void MyWorkRemindFormMain_Shown(object sender, EventArgs e) { this.numDay.Maximum = System.Threading.Thread.CurrentThread.CurrentUICulture.Calendar.GetDaysInMonth(Convert.ToInt32(this.numYear.Value), Convert.ToInt32(this.numMonth.Value)); this.numYear.Value = SDateTime.Now.Year; this.numMonth.Value = SDateTime.Now.Month; this.numDay.Value = SDateTime.Now.Day; this.numYear.Refresh(); this.numMonth.Refresh(); this.numDay.Refresh(); this.IsFrist = false; this.ControlsLoad(true); //获取我的任务 DataTable dtMyTask = LYFZ.BLL.BLL_ErpOrderView.GetData_MyTask(" And Agt_ManageName = '" + this.StrUserID + "'"); this.dgvData3.Rows.Clear(); if (dtMyTask.Rows.Count > 0) { #region DataGridViewRow dgvr = null; DataGridViewCell cell = null; foreach (DataRow dtRow in dtMyTask.Rows) { dgvr = new DataGridViewRow(); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["ID"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = "新"; cell.Style.ForeColor = Color.Red; dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); switch (dtRow["级别"].ToString().Trim()) { case "0": cell.Value = "高"; break; case "1": cell.Value = "中"; break; case "2": cell.Value = "低"; break; } dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.BLL.BLL_ErpOrderView.GetUserName(dtRow["发布人"]); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["发布时间"]); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["任务内容"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.BLL.BLL_ErpOrderView.GetUserName(dtRow["办理人"]); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["完成期限"]); dgvr.Cells.Add(cell); this.dgvData3.Rows.Add(dgvr); //dgvr.Tag = BindDataTableRowColumn1(dgvr); } dgvData3.Tag = null; this.dgvData3.ClearSelection(); this.lblMyTaskCount.Text = "( " + dtMyTask.Rows.Count + " )"; this.lblMyTaskCount.Visible = true; #endregion } } /// /// 加载 /// /// void ControlsLoad(bool IsLoad = false) { foreach (Control control in this.panelDay.Controls) { if (control is LYFZ.ComponentLibrary.LabelEx) { string[] lblArray = control.Text.Split(':'); control.Text = lblArray[0].Trim() + ": 0"; } } string StrCompleteStatus = "Not"; if (this.chkCompletedTimeOut.Checked) { StrCompleteStatus = "OuntNot"; } else if (this.chkCompletedOK.Checked) { StrCompleteStatus = "OK"; } this.Refresh(); string StrDataTime = Convert.ToDateTime(this.numYear.Value + "-" + this.numMonth.Value + "-" + this.numDay.Value).ToYYYY_MM_dd(); if (IsLoad) { System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(delegate() { this.GetDayData(StrCompleteStatus, StrDataTime); })); t.Start(); } else { LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker) { this.GetDayData(StrCompleteStatus, StrDataTime); }); } } /// /// 获取每日数据 /// void GetDayData(string StrCompleteStatus, string StrDataTime) { string strWhereOrder = ""; string strWhereCLientServiceTask = ""; DataTable dtOrder = new DataTable(); if (StrCompleteStatus == "OuntNot" || StrCompleteStatus == "Not") { if (StrCompleteStatus == "Not") { strWhereOrder = LYFZ.BLL.OtherCommonModel.GetDateTime("工作时间", StrDataTime, StrDataTime); strWhereCLientServiceTask = " And Cst_CompletionIntStatus = 0" + LYFZ.BLL.OtherCommonModel.GetDateTime("Cst_TaskTermTime", StrDataTime, StrDataTime); //获取未完成 dtOrder = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayWorkNot(strWhereOrder); } else { strWhereOrder = " And 工作时间 < '" + Convert.ToDateTime(StrDataTime).ToString("yyyy-MM-dd HH:mm:ss") + "'"; strWhereCLientServiceTask = " And Cst_CompletionIntStatus = 0 And Cst_TaskTermTime < '" + Convert.ToDateTime(StrDataTime).ToString("yyyy-MM-dd HH:mm:ss") + "'"; //获取超时未完成 dtOrder = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayWorkNot(strWhereOrder); } } else if (StrCompleteStatus == "OK") { strWhereOrder = LYFZ.BLL.OtherCommonModel.GetDateTime("工作时间", StrDataTime, StrDataTime); strWhereCLientServiceTask = " And Cst_CompletionIntStatus = 1" + LYFZ.BLL.OtherCommonModel.GetDateTime("Cst_TaskTermTime", StrDataTime, StrDataTime); //获取已完成 dtOrder = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayWorkOK(strWhereOrder); } //获取客服任务 DataTable dtTaskData = LYFZ.BLL.BLL_ErpOrderView.GetData_ClientServiceTask(strWhereCLientServiceTask, IsShowCompletionRemark: false, IsReturnNewTable: false); //获取客户节日 DataTable dtClient = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_ClientFestivals(StrDataTime); //获取客户节日 DataTable dtTodayTrack = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_TodayTrack(StrDataTime); //今日跟踪(医院客户提醒) DataTable dtTodayHospital = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_TodayTrackHospital(StrDataTime); //今日跟踪(客户今日提醒) DataTable dtTodayClient = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_TodayTrackClient(StrDataTime); try { this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate() { Dictionary dictData = new Dictionary(); dictData.Add("dtOrder", dtOrder); dictData.Add("dtTaskData", dtTaskData); dictData.Add("dtClient", dtClient); dictData.Add("dtTodayTrack", dtTodayTrack); dictData.Add("dtTodayHospital", dtTodayHospital); dictData.Add("dtTodayClient", dtTodayClient); this.panelDay.Tag = dictData; this.PublicFunctionRows(); })); } catch { } } /// /// 全绑定 /// void PublicFunctionRows() { this.dgvData.Rows.Clear(); BindDataTableColumData(); BindDayWorkData(); //this.dgvData2.Rows.Clear(); if (this.panelDay.Tag != null) { string[] tagList = new string[] { "Clothing", "Makeup","MakeupAssistant","Photography","PhotographyAssistant","BootDivision", "BootDivisionAssistant","EarlyRepair","FilmSelection","RefinedRepair","Design","LookDesign","SendPhoto","Pickup", "Service","Marriage","MemorialDay","Birthday","FullMoon","HundredDay" }; foreach (var item in tagList) { string strCode = item; LYFZ.ComponentLibrary.LabelEx lbl = this.GetGroupBoxData(strCode); string[] StrArray = lbl.Text.Trim().Split(':'); lbl.Text = StrArray[0] + ":0" ; } string strWhere = ""; if(!chkAllUserWork.Checked) { strWhere = " 员工编号 = '" + StrUserID + "' "; } //订单流程 Dictionary dictDataTable = (Dictionary)this.panelDay.Tag; DataRow[] dtRowsOrder = ((DataTable)dictDataTable["dtOrder"]).Select(strWhere); if (dtRowsOrder.Length > 0) { Dictionary dictData = new Dictionary(); foreach (DataRow dtRow in dtRowsOrder) { if (dictData.ContainsKey(dtRow["工作内容"].ToString().Trim())) { dictData[dtRow["工作内容"].ToString().Trim()] = (Convert.ToInt32(dictData[dtRow["工作内容"].ToString().Trim()]) + 1); } else { dictData.Add(dtRow["工作内容"].ToString().Trim(), 1); } this.PublicOrderRows(dtRow); } foreach (var item in dictData) { string strCode = this.GetWorkContentCode(item.Key.Trim()); LYFZ.ComponentLibrary.LabelEx lbl = this.GetGroupBoxData(strCode); string[] StrArray = lbl.Text.Trim().Split(':'); lbl.Text = StrArray[0] + ": " + item.Value; } } if (!chkAllUserWork.Checked) { strWhere = " 员工姓名 = '" + this.StrUserName + "' "; } //客户节日 DataRow[] dtRowsClient = ((DataTable)dictDataTable["dtClient"]).Select(strWhere); if (dtRowsClient.Length > 0) { Dictionary dictData = new Dictionary(); foreach (DataRow dtRow in dtRowsClient) { if (dictData.ContainsKey(dtRow["工作内容"].ToString().Trim())) { dictData[dtRow["工作内容"].ToString().Trim()] = (Convert.ToInt32(dictData[dtRow["工作内容"].ToString().Trim()]) + 1); } else { dictData.Add(dtRow["工作内容"].ToString().Trim(), 1); } this.PublicClientRows(dtRow); } foreach (var item in dictData) { string strCode = this.GetWorkContentCode(item.Key.Trim()); LYFZ.ComponentLibrary.LabelEx lbl = this.GetGroupBoxData(strCode); string[] StrArray = lbl.Text.Trim().Split(':'); lbl.Text = StrArray[0] + ": " + item.Value; } } if (!chkAllUserWork.Checked) { strWhere = " Cst_ServicePerson = '" + this.StrUserID + "' "; } //客服任务 DataRow[] dtRowsTask = ((DataTable)dictDataTable["dtTaskData"]).Select(strWhere); if (dtRowsTask.Length > 0) { foreach (DataRow dtRow in dtRowsTask) { this.PublicTaskRows(dtRow); } string[] StrArray = this.lbl_ClientServiceTask.Text.Trim().Split(':'); this.lbl_ClientServiceTask.Text = StrArray[0] + ": " + dtRowsTask.Length; } if (!chkAllUserWork.Checked) { strWhere = " 员工编号 = '" + this.StrUserID + "' "; } int TodayTrackCount = 0; //今日跟踪 DataRow[] dtTodayTrack = ((DataTable)dictDataTable["dtTodayTrack"]).Select(strWhere); if (dtTodayTrack.Length > 0) { foreach (DataRow dtRow in dtTodayTrack) { this.PublicOrderRows(dtRow); } TodayTrackCount += dtTodayTrack.Length; } if (!chkAllUserWork.Checked) { strWhere = " 员工姓名 = '" + this.StrUserName + "' "; } //今日跟踪(医院今日提醒) DataRow[] dtTodayHospital = ((DataTable)dictDataTable["dtTodayHospital"]).Select(strWhere); if (dtTodayHospital.Length > 0) { foreach (DataRow dtRow in dtTodayHospital) { this.PublicClientRows(dtRow); } TodayTrackCount += dtTodayHospital.Length; } if (!chkAllUserWork.Checked) { strWhere = " 员工姓名 = '" + this.StrUserName + "' "; } //今日跟踪(客户今日提醒) DataRow[] dtTodayClient = ((DataTable)dictDataTable["dtTodayClient"]).Select(strWhere); if (dtTodayClient.Length > 0) { foreach (DataRow dtRow in dtTodayClient) { this.PublicClientRows(dtRow); } TodayTrackCount += dtTodayClient.Length; } if (TodayTrackCount > 0) { string[] StrArray = this.lbl_TodayTrack.Text.Trim().Split(':'); this.lbl_TodayTrack.Text = StrArray[0] + ": " + TodayTrackCount; } this.dgvData.ClearSelection(); //this.dgvData2.ClearSelection(); } } LYFZ.ComponentLibrary.LabelEx GetGroupBoxData( string strCode) { LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)this.groupBoxEx1.Controls["lbl_" + strCode]; if(lbl==null) { lbl = (LYFZ.ComponentLibrary.LabelEx)this.groupBoxEx2.Controls["lbl_" + strCode]; } if (lbl == null) { lbl = (LYFZ.ComponentLibrary.LabelEx)this.groupBoxEx3.Controls["lbl_" + strCode]; } if (lbl == null) { lbl = (LYFZ.ComponentLibrary.LabelEx)this.groupBoxEx4.Controls["lbl_" + strCode]; } return lbl; } void BindDataTableColumData(string strColumn = "数码编号,订单号,订单类型,客户姓名,客户电话,工作内容,员工姓名,工作时间", string hidColum = "数码编号") { this.dgvData.Columns.Clear(); //string strColumn = "数码编号,订单号,订单类型,客户姓名,工作内容,员工姓名,工作时间"; string[] columLists = strColumn.Split(','); foreach (string colum in columLists) { DataGridViewTextBoxColumn dataColum = new DataGridViewTextBoxColumn(); //dataColum.Name = colum; //dataColum.HeaderText = colum; dataColum.Name = colum; dataColum.DataPropertyName = colum; dataColum.HeaderText = colum; dataColum.Resizable = DataGridViewTriState.True; if (hidColum.Equals(colum)) { dataColum.Visible = false; } this.dgvData.Columns.Add(dataColum); } //this.dgvData.DataColumns(strColumn, "数码编号"); } void BindDayWorkData() { foreach (Control control in this.panelDay.Controls) { if (control is LYFZ.ComponentLibrary.LabelEx) { string[] lblArray = control.Text.Split(':'); control.Text = lblArray[0].Trim() + ": 0"; } } } /// /// 绑定订单工作 /// /// void PublicOrderRows(DataRow dtRow) { DataGridViewCell cell = null; DataGridViewRow dgvr = null; if (!chkAllUserWork.Checked) { if (dtRow["员工编号"].ToString() == this.StrUserID) { dgvr = new DataGridViewRow(); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["数码编号"].ToString(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["订单号"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["订单类型"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["客户姓名"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["客户电话"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["工作内容"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["员工姓名"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["工作时间"]); dgvr.Cells.Add(cell); this.dgvData.Rows.Add(dgvr); dgvr.Tag = BindDataTableRowColumn(dgvr); } } else { dgvr = new DataGridViewRow(); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["数码编号"].ToString(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["订单号"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["订单类型"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["客户姓名"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["客户电话"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["工作内容"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["员工姓名"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["工作时间"]); dgvr.Cells.Add(cell); this.dgvData.Rows.Add(dgvr); dgvr.Tag = BindDataTableRowColumn(dgvr); } dgvData.Tag = null; } DataRow BindDataTableRowColumn(DataGridViewRow dgvr) { DataTable dtTable = new DataTable(); foreach (DataGridViewColumn culumn in this.dgvData.Columns) { dtTable.Columns.Add(new DataColumn(culumn.HeaderText)); } DataRow dtRow = dtTable.NewRow(); foreach (DataGridViewColumn culumn in this.dgvData.Columns) { if (this.dgvData.Columns.Contains(culumn.HeaderText)) { dtRow[culumn.HeaderText] = dgvr.Cells[culumn.HeaderText].Value; } } return dtRow; } DataRow BindDataTableRowColumn1(DataGridViewRow dgvr) { DataTable dtTable = new DataTable(); foreach (DataGridViewColumn culumn in this.dgvData.Columns) { dtTable.Columns.Add(new DataColumn(culumn.HeaderText)); } DataRow dtRow = dtTable.NewRow(); dtRow["工作内容"] = dgvr.Cells["任务内容"]; dtRow["员工姓名"] = dgvr.Cells["办理人"]; dtRow["工作时间"] = dgvr.Cells["发布时间"]; return dtRow; } /// /// 绑定订单工作 /// /// void PublicClientRows(DataRow dtRow) { DataGridViewCell cell = null; DataGridViewRow dgvr = null; if (!chkAllUserWork.Checked) { if (dtRow["员工姓名"].ToString() == this.StrUserName) { dgvr = new DataGridViewRow(); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["数码编号"].ToString(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["订单号"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["订单类型"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["客户姓名"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["客户电话"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["工作内容"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["员工姓名"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["工作时间"]); dgvr.Cells.Add(cell); this.dgvData.Rows.Add(dgvr); dgvr.Tag = BindDataTableRowColumn(dgvr); } } else { dgvr = new DataGridViewRow(); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["数码编号"].ToString(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["订单号"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["订单类型"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["客户姓名"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["客户电话"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["工作内容"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["员工姓名"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.BLL.OtherCommonModel.DateTimeToString(dtRow["工作时间"]); dgvr.Cells.Add(cell); this.dgvData.Rows.Add(dgvr); dgvr.Tag = BindDataTableRowColumn(dgvr); } dgvData.Tag = null; } /// /// 绑定客户安排 /// /// void PublicTaskRows(DataRow dtRow) { DataGridViewCell cell = null; DataGridViewRow dgvr = null; if (!chkAllUserWork.Checked) { if (dtRow["Cst_ServicePerson"].ToString().Trim() == this.StrUserID) { dgvr = new DataGridViewRow(); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["Cst_ViceNumber"].ToString(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["Cst_ShowOrderNumber"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = "客户任务"; dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["Cus_Name"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["Cus_Telephone"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["Cst_TaskItem"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.BLL.BLL_ErpOrderView.GetUserName(dtRow["Cst_ServicePerson"]); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = Convert.ToDateTime(dtRow["Cst_TaskTermTime"]).ToString("yyyy-MM-dd"); dgvr.Cells.Add(cell); this.dgvData.Rows.Add(dgvr); dgvr.Tag = BindDataTableRowColumn(dgvr); } } else { dgvr = new DataGridViewRow(); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["Cst_ViceNumber"].ToString(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["Cst_ShowOrderNumber"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = "客户任务"; dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["Cus_Name"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["Cus_Telephone"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow["Cst_TaskItem"].ToString().Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.BLL.BLL_ErpOrderView.GetUserName(dtRow["Cst_ServicePerson"]); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = Convert.ToDateTime(dtRow["Cst_TaskTermTime"]).ToString("yyyy-MM-dd"); dgvr.Cells.Add(cell); this.dgvData.Rows.Add(dgvr); dgvr.Tag = BindDataTableRowColumn(dgvr); } dgvData.Tag = null; } /// /// 年回车 /// /// /// void numYear_KeyDown(object sender, KeyEventArgs e) { this.numDay_KeyDown(this, e); } /// /// 月回车 /// /// /// void numMonth_KeyDown(object sender, KeyEventArgs e) { this.numDay_KeyDown(this, e); } /// /// 日回车 /// /// /// void numDay_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { this.numDay_ValueChanged(this, null); } } /// /// 年值变更 /// /// /// void numYear_ValueChanged(object sender, EventArgs e) { this.numDay_ValueChanged(this, null); } /// /// 月值变更 /// /// /// void numMonth_ValueChanged(object sender, EventArgs e) { this.numDay.Maximum = System.Threading.Thread.CurrentThread.CurrentUICulture.Calendar.GetDaysInMonth(Convert.ToInt32(this.numYear.Value), Convert.ToInt32(this.numMonth.Value)); this.numDay_ValueChanged(this, null); } /// /// 日值变更 /// /// /// void numDay_ValueChanged(object sender, EventArgs e) { this.lblLunarCalendar.Text = LYFZ.Command.Command_CalendarTurnLunar.GetLunarNewYearMonthDay(Convert.ToDateTime(numYear.Value + "-" + numMonth.Value + "-" + this.numDay.Value).ToString(), false); this.lblWeek.Text = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.CaculateWeekDay(Convert.ToDateTime(Convert.ToDateTime(numYear.Value + "-" + numMonth.Value + "-" + this.numDay.Value)).DayOfWeek.ToString()); if (!this.IsFrist) { this.ControlsLoad(); } } /// /// 已完成 /// /// /// void chkCompletedOK_Click(object sender, EventArgs e) { this.chkCompletedOK.Checked = true; this.chkCompletedNot.Checked = false; this.chkCompletedTimeOut.Checked = false; this.ControlsLoad(); } /// /// 未完成 /// /// /// void chkCompletedNot_Click(object sender, EventArgs e) { this.chkCompletedNot.Checked = true; this.chkCompletedOK.Checked = false; this.chkCompletedTimeOut.Checked = false; this.ControlsLoad(); } /// /// 超时未完成 /// /// /// void chkCompletedTimeOut_Click(object sender, EventArgs e) { this.chkCompletedTimeOut.Checked = true; this.chkCompletedOK.Checked = false; this.chkCompletedNot.Checked = false; this.ControlsLoad(); } /// /// 点击查看全部 /// /// /// void panelDay_Click(object sender, EventArgs e) { dataType = ""; if (this.panelDay.Tag != null) { this.PublicFunctionRows(); } } /// /// 选衣服数据 /// /// /// void lbl_Clothing_Click(object sender, EventArgs e) { if (this.panelDay.Tag != null) { this.dgvData.Tag = null; this.dgvData.Rows.Clear(); this.dgvData.Columns.Clear(); //this.dgvData2.Rows.Clear(); LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender; string[] StrArray = lbl.Name.Trim().Split('_'); Dictionary dictData = (Dictionary)this.panelDay.Tag; DataTable dtData; //(DataTable)dictData["dtClothOrder"]; if(dictData.ContainsKey("dtClothOrder")) { dtData = (DataTable)dictData["dtClothOrder"]; } else { string StrDataTime = Convert.ToDateTime(this.numYear.Value + "-" + this.numMonth.Value + "-" + this.numDay.Value).ToYYYY_MM_dd(); string StrWhere = LYFZ.BLL.OtherCommonModel.GetDateTime("Ordv_ReservationClothingTime", StrDataTime, StrDataTime); if(chkCompletedTimeOut.Checked) { StrWhere = " and Ordv_ReservationClothingTime <='" + StrDataTime + "' "; } if (chkCompletedOK.Checked) { dtData = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayClothWorkData(LYFZ.BLL.OtherCommonModel.GetDateTime("Ordv_ClothingTime", StrDataTime, StrDataTime), "1"); } else { dtData = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayClothWorkData(StrWhere); } dictData["dtClothOrder"] = dtData; } ///字段数据 foreach(DataColumn dtColum in dtData.Columns) { DataGridViewTextBoxColumn textBoxColum = new DataGridViewTextBoxColumn(); textBoxColum.DataPropertyName = dtColum.ColumnName;//"工作内容"; textBoxColum.Name = dtColum.ColumnName; textBoxColum.HeaderText = dtColum.ColumnName; dgvData.Columns.Add(textBoxColum); } ///工作内容 DataGridViewTextBoxColumn tempTextBoxColum = new DataGridViewTextBoxColumn(); tempTextBoxColum.DataPropertyName = "工作内容"; tempTextBoxColum.Name = "工作内容"; tempTextBoxColum.HeaderText = "工作内容"; tempTextBoxColum.Visible = false; dgvData.Columns.Add(tempTextBoxColum); string strKey = ""; if (!chkAllUserWork.Checked) { strKey = "安排人='" + this.StrUserName + "'"; } DataRow[] dtRows = dtData.Select(strKey); foreach (DataRow dtRow in dtRows) { this.BindClothDataListByRow(dtRow, "选衣"); } this.dgvData.ClearSelection(); //this.dgvData2.ClearSelection(); this.tabControlSelectedIndex(); } } /// /// 选衣服数据 /// /// /// void lbl_Photograph_Click(object sender, EventArgs e) { if (this.panelDay.Tag != null) { this.dgvData.Tag = null; this.dgvData.Rows.Clear(); this.dgvData.Columns.Clear(); //this.dgvData2.Rows.Clear(); LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender; string[] StrArray = lbl.Name.Trim().Split('_'); Dictionary dictData = (Dictionary)this.panelDay.Tag; DataTable dtData; string strKey = ""; string strContent = ""; //(DataTable)dictData["dtClothOrder"]; if (dictData.ContainsKey("dtPhotographOrder")) { dtData = (DataTable)dictData["dtPhotographOrder"]; } else { string StrDataTime = Convert.ToDateTime(this.numYear.Value + "-" + this.numMonth.Value + "-" + this.numDay.Value).ToYYYY_MM_dd(); string StrWhere = ""; if (chkCompletedNot.Checked) { StrWhere = " Ordpg_PhotographyStatus = '0' " + LYFZ.BLL.OtherCommonModel.GetDateTime("Ordpg_ReservationPhotographyTime", StrDataTime, StrDataTime); } if (chkCompletedOK.Checked) { StrWhere = " Ordpg_PhotographyStatus = '1' " + LYFZ.BLL.OtherCommonModel.GetDateTime("Ordpg_PhotographyTime", StrDataTime, StrDataTime); } if(chkCompletedTimeOut.Checked) { StrWhere = " Ordpg_PhotographyStatus = '0' and Ordpg_ReservationPhotographyTime < '" + StrDataTime + "' "; } dtData = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayPhotographyWorkData(StrWhere); dictData["dtPhotographOrder"] = dtData; } if (!chkAllUserWork.Checked) { GetPhotographyByWhereData(StrArray[1], ref strKey, ref strContent); } ///字段数据 foreach (DataColumn dtColum in dtData.Columns) { DataGridViewTextBoxColumn textBoxColum = new DataGridViewTextBoxColumn(); textBoxColum.DataPropertyName = dtColum.ColumnName;// "工作内容"; textBoxColum.Name = dtColum.ColumnName; textBoxColum.HeaderText = dtColum.ColumnName; dgvData.Columns.Add(textBoxColum); } ///工作内容 DataGridViewTextBoxColumn tempTextBoxColum = new DataGridViewTextBoxColumn(); tempTextBoxColum.DataPropertyName = "工作内容"; tempTextBoxColum.Name = "工作内容"; tempTextBoxColum.HeaderText = "工作内容"; tempTextBoxColum.Visible = false; dgvData.Columns.Add(tempTextBoxColum); DataRow[] dtRows = { }; dtRows = dtData.Select(strKey); foreach (DataRow dtRow in dtRows) { this.BindClothDataListByRow(dtRow, strContent); } this.dgvData.ClearSelection(); //this.dgvData2.ClearSelection(); this.tabControlSelectedIndex(); } } void GetPhotographyByWhereData(string type,ref string strKey,ref string strContent) { //strKey+"='" + this.StrUserName + "'" switch(type) { case "Photography": strContent = "拍摄"; strKey = "摄影师" + "='" + this.StrUserName + "'"; break; case "PhotographyAssistant": strContent = "拍摄助理"; strKey = "摄影助理" + "='" + this.StrUserName + "'"; break; case "Makeup": strContent = "化妆"; strKey = "化妆师" + "='" + this.StrUserName + "'"; break; case "MakeupAssistant": strContent = "化妆助理"; strKey = "化妆助理" + "='" + this.StrUserName + "'"; break; case "BootDivision": strContent = "引导"; strKey = "引导师" + "='" + this.StrUserName + "'"; break; case "BootDivisionAssistant": strContent = "引导助理"; strKey = "引导助理" + "='" + this.StrUserName + "'"; break; } } DataGridViewRow BindClothDataListByRow(DataRow dtRow, string workContent) { dataType = workContent; DataGridViewCell cell = null; DataGridViewRow dgvr = null; dgvr = new DataGridViewRow(); foreach (DataColumn colum in dtRow.Table.Columns) { cell = new DataGridViewTextBoxCell(); cell.Value = dtRow[colum.ColumnName].ToString(); dgvr.Cells.Add(cell); } cell = new DataGridViewTextBoxCell(); cell.Value = workContent; dgvr.Cells.Add(cell); this.dgvData.Rows.Add(dgvr); dgvr.Tag = BindDataTableRowColumn(dgvr); return dgvr; } /// /// 订单流程点击 /// /// /// void lbl_BootDivision_Click(object sender, EventArgs e) { dataType = ""; if (this.panelDay.Tag != null) { this.dgvData.Tag = null; this.dgvData.Rows.Clear(); BindDataTableColumData(); //this.dgvData2.Rows.Clear(); LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender; string[] StrArray = lbl.Name.Trim().Split('_'); Dictionary dictData = (Dictionary)this.panelDay.Tag; DataTable dtData = (DataTable)dictData["dtOrder"]; DataRow[] dtRows = dtData.Select("工作内容='" + this.GetWorkContent(StrArray[1]) + "'"); foreach (DataRow dtRow in dtRows) { this.PublicOrderRows(dtRow); } this.dgvData.ClearSelection(); //this.dgvData2.ClearSelection(); this.tabControlSelectedIndex(); } } /// /// 订单流程点击 /// /// /// void lbl_EarlyRepair_Click(object sender, EventArgs e) { //LYFZ.Software.MainBusiness.DoorCityProcess.frmDigitalArrangement digitalForm = new DoorCityProcess.frmDigitalArrangement(); //digitalForm.labEarlyRepair.Checked = true; //digitalForm.cbxMyJob.Checked = true; //digitalForm.BindPostionSize(); //digitalForm.Show(); //this.Close(); if (this.panelDay.Tag != null) { this.dgvData.Tag = null; this.dgvData.Rows.Clear(); this.dgvData.Columns.Clear(); //BindDataTableColumData(); //this.dgvData2.Rows.Clear(); LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender; string[] StrArray = lbl.Name.Trim().Split('_'); Dictionary dictData = (Dictionary)this.panelDay.Tag; //DataTable dtData = (DataTable)dictData["dtOrder"]; string StrDataTime = Convert.ToDateTime(this.numYear.Value + "-" + this.numMonth.Value + "-" + this.numDay.Value).ToYYYY_MM_dd(); DataTable dtData; if (dictData.ContainsKey("dtEarlyRepairOrder")) { dtData = (DataTable)dictData["dtEarlyRepairOrder"]; } else { string StrWhere = ""; StrWhere = " Ordv_EarlyRepairStatus in ('0', '1') And Ordv_ReservationEarlyRepairTime is not null "; dtData = LYFZ.BLL.BLL_ErpOrderView.GetData_DailyWork_DayEarlyRepairWorkData(StrWhere); dictData["dtEarlyRepairOrder"] = dtData; } string strWhere = ""; if (!chkAllUserWork.Checked) { //GetPhotographyByWhereData(StrArray[1], ref strKey, ref strContent); strWhere = " 初修师编号 = '" + StrUserID + "' and 完成期限 >='" + StrDataTime + " 00:00:00' and 完成期限 <='" + StrDataTime + " 23:59:59' "; } ///字段数据 foreach (DataColumn dtColum in dtData.Columns) { DataGridViewTextBoxColumn textBoxColum = new DataGridViewTextBoxColumn(); textBoxColum.DataPropertyName = dtColum.ColumnName;//"工作内容"; textBoxColum.Name = dtColum.ColumnName; textBoxColum.HeaderText = dtColum.ColumnName; if (dtColum.ColumnName.Equals("初修师编号")) { textBoxColum.Visible = false; } if (dtColum.ColumnName.Equals("订单号")) { textBoxColum.Visible = false; } dgvData.Columns.Add(textBoxColum); } ///工作内容 DataGridViewTextBoxColumn tempTextBoxColum = new DataGridViewTextBoxColumn(); tempTextBoxColum.DataPropertyName = "工作内容"; tempTextBoxColum.Name = "工作内容"; tempTextBoxColum.HeaderText = "工作内容"; tempTextBoxColum.Visible = false; dgvData.Columns.Add(tempTextBoxColum); DataRow[] dtRows = dtData.Select(strWhere); string keyNumber = ""; foreach (DataRow dtRow in dtRows) { DataGridViewRow tempDgvr = this.BindClothDataListByRow(dtRow, "初修"); if (keyNumber != dtRow["订单编号"].ToString()) { keyNumber = dtRow["订单编号"].ToString(); } else { tempDgvr.Cells["订单编号"].Value = ""; tempDgvr.Cells["客户名称"].Value = ""; tempDgvr.Cells["客户电话"].Value = ""; tempDgvr.Cells["套系名称"].Value = ""; tempDgvr.Cells["套系价格"].Value = ""; } } this.dgvData.ClearSelection(); //this.dgvData2.ClearSelection(); this.tabControlSelectedIndex(); } } /// /// 客户任务 /// /// /// void lbl_ClientServiceTask_Click(object sender, EventArgs e) { if (this.panelDay.Tag != null) { this.dgvData.Rows.Clear(); //this.dgvData2.Rows.Clear(); Dictionary dictData = (Dictionary)this.panelDay.Tag; DataTable dtData = (DataTable)dictData["dtTaskData"]; DataRow[] dtRows = dtData.Select(""); foreach (DataRow dtRow in dtRows) { this.PublicTaskRows(dtRow); } this.dgvData.ClearSelection(); //this.dgvData2.ClearSelection(); this.tabControlSelectedIndex(); } } /// /// 今日跟踪点击 /// /// /// void lbl_TodayTrack_Click(object sender, EventArgs e) { if (this.panelDay.Tag != null) { this.dgvData.Rows.Clear(); this.dgvData.Columns.Clear(); string strColumn = "数码编号,订单号,订单类型,客户姓名,客户电话,工作内容,员工姓名,工作时间"; this.dgvData.DataColumns(strColumn, "数码编号"); //this.dgvData2.Rows.Clear(); Dictionary dictData = (Dictionary)this.panelDay.Tag; DataTable dtDataTodayTrack = (DataTable)dictData["dtTodayTrack"]; DataRow[] dtTodayTrack = dtDataTodayTrack.Select(""); foreach (DataRow dtRow in dtTodayTrack) { this.PublicOrderRows(dtRow); } DataTable dtDataTodayHospital = (DataTable)dictData["dtTodayHospital"]; DataRow[] dtTodayHospital = dtDataTodayHospital.Select(""); foreach (DataRow dtRow in dtTodayHospital) { this.PublicClientRows(dtRow); } DataTable dtDataTodayClient = (DataTable)dictData["dtTodayClient"]; DataRow[] dtTodayClient = dtDataTodayClient.Select(""); foreach (DataRow dtRow in dtTodayClient) { this.PublicClientRows(dtRow); } this.dgvData.ClearSelection(); //this.dgvData2.ClearSelection(); this.tabControlSelectedIndex(); } } /// /// 客户节日点击 /// /// /// void lbl_Birthday_Click(object sender, EventArgs e) { if (this.panelDay.Tag != null) { this.dgvData.Rows.Clear(); this.dgvData.Columns.Clear(); string strColumn = "数码编号,订单号,订单类型,客户姓名,客户电话,工作内容,员工姓名,工作时间"; this.dgvData.DataColumns(strColumn, "数码编号"); //this.dgvData2.Rows.Clear(); LYFZ.ComponentLibrary.LabelEx lbl = (LYFZ.ComponentLibrary.LabelEx)sender; string[] StrArray = lbl.Name.Trim().Split('_'); Dictionary dictData = (Dictionary)this.panelDay.Tag; DataTable dtData = (DataTable)dictData["dtClient"]; DataRow[] dtTodayTrack = dtData.Select("工作内容='" + this.GetWorkContent(StrArray[1]) + "'"); foreach (DataRow dtRow in dtTodayTrack) { this.PublicClientRows(dtRow); } this.dgvData.ClearSelection(); //this.dgvData2.ClearSelection(); this.tabControlSelectedIndex(); } } void tabControlSelectedIndex() { if (this.dgvData.Rows.Count > 0) { this.tabControlEx1.SelectedIndex = 0; } //else if (this.dgvData2.Rows.Count > 0) //{ this.tabControlEx1.SelectedIndex = 1; } else { this.tabControlEx1.SelectedIndex = 0; } } bool IsGoPages = false; Form frmGoPages = null; /// /// 选择后去完成任务 /// /// /// void dgvData_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { this.dgvCellDoubleClick(this.dgvData, e); } /// /// 选择后去完成任务 /// /// /// void dgvData2_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { //this.dgvCellDoubleClick(this.dgvData2, e); } /// /// 我的任务双击事件 /// /// /// void dgvData3_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex >= 0 && e.ColumnIndex >= 0) { LYFZ.Software.MainBusiness.OAShopManagement.frmTeskView frm1 = new OAShopManagement.frmTeskView(); frm1.TeskRow = this.dgvData3.Rows[e.RowIndex]; frm1.Owner = this; frm1.ShowDialog(); if (frm1.IsSaveed) { } } } /// /// 选择后去完成任务 /// /// void dgvCellDoubleClick(DataGridViewEc dgv, DataGridViewCellEventArgs e) { if (e.ColumnIndex >= 0 && e.RowIndex >= 0) { if (dgv.Rows.Count > 0) { if (dgv.CurrentCell.ColumnIndex >= 0 && dgv.CurrentRow.Index >= 0) { if (!this.chkCompletedOK.Checked) { switch (dgv.CurrentRow.Cells["工作内容"].Value.ToString().Trim()) { case "选礼服": LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.SelectDressConfirmSmallForm frm1 = new SmallForm.SelectDressConfirmSmallForm(); frm1.strViceNumber = dgv.CurrentRow.Cells["数码编号"].Value.ToString().Trim(); frm1.StartPosition = FormStartPosition.CenterScreen; frm1.IsAnPai = true; this.frmGoPages = frm1; break; case "化妆": case "化妆助理": case "拍摄": case "拍摄助理": case "引导师": case "引导助理": LYFZ.Software.MainBusiness.DoorCityProcess.PhotographedFormMain frm2 = new DoorCityProcess.PhotographedFormMain(); frm2.StrOrdNumber = dgv.CurrentRow.Cells["订单号"].Value.ToString().Trim(); frm2.StartPosition = System.Windows.Forms.FormStartPosition.Manual; frm2.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y); frm2.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height); this.frmGoPages = frm2; break; case "初修": LYFZ.Software.MainBusiness.DoorCityProcess.RepairPieceFormMain frm3 = new DoorCityProcess.RepairPieceFormMain(); frm3.StrOrdNumber = dgv.CurrentRow.Cells["订单号"].Value.ToString().Trim(); frm3.StartPosition = System.Windows.Forms.FormStartPosition.Manual; frm3.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y); frm3.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height); this.frmGoPages = frm3; break; case "选片": LYFZ.Software.MainBusiness.DoorCityProcess.FilmSelectionFormMain frm4 = new DoorCityProcess.FilmSelectionFormMain(); frm4.StrOrdNumber = dgv.CurrentRow.Cells["订单号"].Value.ToString().Trim(); frm4.StartPosition = System.Windows.Forms.FormStartPosition.Manual; frm4.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y); frm4.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height); this.frmGoPages = frm4; break; case "精修": LYFZ.Software.MainBusiness.DoorCityProcess.RefinedRepairFormMain frm5 = new DoorCityProcess.RefinedRepairFormMain(); frm5.StrOrdNumber = dgv.CurrentRow.Cells["订单号"].Value.ToString().Trim(); frm5.StartPosition = System.Windows.Forms.FormStartPosition.Manual; frm5.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y); frm5.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height); this.frmGoPages = frm5; break; case "设计": case "看设计": LYFZ.Software.MainBusiness.DoorCityProcess.DesignFormMain frm6 = new DoorCityProcess.DesignFormMain(); frm6.StrOrdNumber = dgv.CurrentRow.Cells["订单号"].Value.ToString().Trim(); frm6.StartPosition = System.Windows.Forms.FormStartPosition.Manual; frm6.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y); frm6.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height); this.frmGoPages = frm6; break; case "发片师": case "取件": LYFZ.Software.MainBusiness.DoorCityProcess.TotakePieceFormMain frm7 = new DoorCityProcess.TotakePieceFormMain(); frm7.StrOrdNumber = dgv.CurrentRow.Cells["订单号"].Value.ToString().Trim(); frm7.StartPosition = System.Windows.Forms.FormStartPosition.Manual; frm7.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y); frm7.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height); this.frmGoPages = frm7; break; case "服务人员": LYFZ.Software.MainBusiness.CameraControlBook.SmallForm.WeddingReservationSmallForm frm8 = new SmallForm.WeddingReservationSmallForm(); frm8.OrdNumber = dgv.CurrentRow.Cells["订单号"].Value.ToString().Trim(); this.frmGoPages = frm8; break; } if (this.frmGoPages != null) { this.IsGoPages = true; this.Close(); } } } } } } /// /// 选项卡选择事件 /// /// /// void tabControlEx1_SelectedIndexChanged(object sender, EventArgs e) { switch (this.tabControlEx1.SelectedTab.Name.Trim()) { case "tabPage1": case "tabPage2": this.chkAllUserWork.Visible = true; this.chkCompletedTimeOut.Visible = true; this.chkCompletedOK.Visible = true; this.chkCompletedNot.Visible = true; this.lblMyTaskCount.BackColor = System.Drawing.Color.FromArgb(220, 224, 253); this.lblMyTaskCount.Location = new Point(this.lblMyTaskCount.Location.X, 51); break; case "tabPage3": this.chkAllUserWork.Visible = false; this.chkCompletedTimeOut.Visible = false; this.chkCompletedOK.Visible = false; this.chkCompletedNot.Visible = false; this.lblMyTaskCount.BackColor = System.Drawing.Color.FromArgb(255, 255, 255); this.lblMyTaskCount.Location = new Point(this.lblMyTaskCount.Location.X, 52); break; } } /// /// 窗体关闭生事件 /// /// /// void MyWorkRemindFormMain_FormClosed(object sender, FormClosedEventArgs e) { if (this.IsGoPages) { frmGoPages.Show(); } } /// /// 点击我的任务数量 /// /// /// void lblMyTaskCount_Click(object sender, EventArgs e) { // this.tabControlEx1.SelectedIndex = 2; } } }