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.CameraControlBook { public partial class frmPerturbedController : LYFZ.Software.UI.CameraControlBook.frmPerturbedController { BLL.BLL_ErpOrderDigital orderDigitalBll = new BLL.BLL_ErpOrderDigital(); public frmPerturbedController() { this.Load += FrmPerturbedController_Load; this.btnSearch.Click += BtnSearch_Click; } private void FrmPerturbedController_Load(object sender, EventArgs e) { //PublicDataRows(); // 部门人员绑定 LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_DepartmentAndEmployee(this.cmbEmployeeName, IsFirstNodeNull: true, IsFirstNodeName: "全部", IsShowResign: false, IsShowAdmin: true, tb_User: LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable); this.cmbEmployeeName.TagFindText(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID); } void PublicDataRows() { dgvUnarranged.Rows.Clear(); dgvArranged.Rows.Clear(); string dataValue = this.cmbEmployeeName.Tag.ToString(); DataTable arrangeTable = orderDigitalBll.GetErpOrderDigitalNotArrange(tbSearchText.Text,dtpStartDate.Text, dtpEndDate.Text, dataValue); BindNotArrangeData(arrangeTable); BindArrangeData(arrangeTable); } void BindArrangeData(DataTable arrangeTable) { foreach (DataRow dr in arrangeTable.Rows) { string funcName = ""; if (string.IsNullOrEmpty(dr["Ordpg_PhotographyTime"].ToString_s()) && !string.IsNullOrEmpty(dr["Ordpg_ReservationPhotographyTime"].ToString_s())) { if (rdoPhotographed.Checked||rdoAll.Checked) { string StrRowValue = dr["Ordpg_Dispatcher"].ToString_s().Trim(); if (!string.IsNullOrEmpty(StrRowValue)) { DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrRowValue); if (dtRows != null) { StrRowValue = dtRows["User_Name"].ToString().Trim(); } else { StrRowValue = ""; } } BindArrangeDataRowData(dr, "拍照已安排未完成", dr["Ordpg_ReservationPhotographyTime"].ToString_s(), StrRowValue, dr["Ordpg_DispatchTime"].ToString_s()); } } if (!string.IsNullOrEmpty(dr["Ordv_ReservationFilmSelectionTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_FilmSelectionTime"].ToString_s())) { if (rdoFilmSelection.Checked || rdoAll.Checked) { string StrRowValue = dr["Ordv_FilmSelectionDispatcher"].ToString_s().Trim(); if (!string.IsNullOrEmpty(StrRowValue)) { DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrRowValue); if (dtRows != null) { StrRowValue = dtRows["User_Name"].ToString().Trim(); } else { StrRowValue = ""; } } BindArrangeDataRowData(dr, "选片已安排未完成", dr["Ordv_ReservationFilmSelectionTime"].ToString_s(), StrRowValue, dr["Ordv_FilmSelectionDispatchTime"].ToString_s()); } } if (!string.IsNullOrEmpty(dr["Ordv_ReservationLookDesignTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_LookDesignTime"].ToString_s())) { if (rdoLookDesign.Checked || rdoAll.Checked) { string StrRowValue = dr["Ordv_LookDesignDispatcher"].ToString_s().Trim(); if (!string.IsNullOrEmpty(StrRowValue)) { DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrRowValue); if (dtRows != null) { StrRowValue = dtRows["User_Name"].ToString().Trim(); } else { StrRowValue = ""; } } BindArrangeDataRowData(dr, "看版已安排未完成", dr["Ordv_ReservationLookDesignTime"].ToString_s(), StrRowValue, dr["Ordv_LookDesignDispatchTime"].ToString_s()); } } if (!string.IsNullOrEmpty(dr["Ordv_ReservationSendPhotoTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_SendPhotoTime"].ToString_s())) { if (rdoTotakePiece.Checked|| rdoAll.Checked) { string StrRowValue = dr["Ordv_SendPhotoDispatcher"].ToString_s().Trim(); if (!string.IsNullOrEmpty(StrRowValue)) { DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrRowValue); if (dtRows != null) { StrRowValue = dtRows["User_Name"].ToString().Trim(); } else { StrRowValue = ""; } } BindArrangeDataRowData(dr, "取件已安排未完成", dr["Ordv_ReservationSendPhotoTime"].ToString_s(), StrRowValue, dr["Ordv_SendPhotoDispatchTime"].ToString_s()); } } if (!string.IsNullOrEmpty(dr["Ordv_ReservationClothingTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_ClothingTime"].ToString_s())) { if (rdoSelectDress.Checked || rdoAll.Checked) { string StrRowValue = dr["Ordv_ClothingDispatcher"].ToString_s().Trim(); if (!string.IsNullOrEmpty(StrRowValue)) { DataRow dtRows = LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows.Find(StrRowValue); if (dtRows != null) { StrRowValue = dtRows["User_Name"].ToString().Trim(); } else { StrRowValue = ""; } } BindArrangeDataRowData(dr, "送礼服已安排未完成", dr["Ordv_ReservationClothingTime"].ToString_s(), StrRowValue, dr["Ordv_ClothingDispatchTime"].ToString_s()); } } } } void BindArrangeDataRowData(DataRow dr ,string msg, string time,string dname, string dtime) { DataGridViewRow dgvr = new DataGridViewRow(); DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell(); dgvr.Cells.Add(cell); cell.Value = dr["Ordpg_Number"]; cell = new DataGridViewTextBoxCell(); dgvr.Cells.Add(cell); cell.Value = dr["cus_Name"]; cell = new DataGridViewTextBoxCell(); dgvr.Cells.Add(cell); cell.Value = dr["Cus_Telephone"]; cell = new DataGridViewTextBoxCell(); dgvr.Cells.Add(cell); cell.Value = dr["Ordpg_Sign"]+"("+ msg + ")"; cell = new DataGridViewTextBoxCell(); dgvr.Cells.Add(cell); cell.Value = time; cell = new DataGridViewTextBoxCell(); dgvr.Cells.Add(cell); cell.Value = dname; cell = new DataGridViewTextBoxCell(); dgvr.Cells.Add(cell); cell.Value = dtime; dgvArranged.Rows.Add(dgvr); } void BindNotArrangeData(DataTable arrangeTable) { foreach (DataRow dr in arrangeTable.Rows) { DataGridViewRow dgvr = new DataGridViewRow(); DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell(); dgvr.Cells.Add(cell); cell.Value = dr["Ordpg_Number"]; cell = new DataGridViewTextBoxCell(); dgvr.Cells.Add(cell); cell.Value = dr["cus_Name"]; cell = new DataGridViewTextBoxCell(); dgvr.Cells.Add(cell); cell.Value = dr["Cus_Telephone"]; cell = new DataGridViewTextBoxCell(); dgvr.Cells.Add(cell); cell.Value = dr["Ordpg_Sign"]; cell = new DataGridViewTextBoxCell(); dgvr.Cells.Add(cell); cell.Value = dr["Ord_CreateDateTime"]; string funcName = ""; if (string.IsNullOrEmpty(dr["Ordpg_PhotographyTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordpg_ReservationPhotographyTime"].ToString_s())) { if (!string.IsNullOrEmpty(funcName)) { funcName += ","; } funcName += "未安排拍照"; } if (string.IsNullOrEmpty(dr["Ordv_ReservationFilmSelectionTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_FilmSelectionTime"].ToString_s())) { if (!string.IsNullOrEmpty(funcName)) { funcName += ","; } funcName += "未安排选片"; } if (string.IsNullOrEmpty(dr["Ordv_ReservationLookDesignTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_LookDesignTime"].ToString_s())) { if (!string.IsNullOrEmpty(funcName)) { funcName += ","; } funcName += "未安排看版"; } if (string.IsNullOrEmpty(dr["Ordv_ReservationSendPhotoTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_SendPhotoTime"].ToString_s())) { if (!string.IsNullOrEmpty(funcName)) { funcName += ","; } funcName += "未安排取件"; } if (string.IsNullOrEmpty(dr["Ordv_ReservationClothingTime"].ToString_s()) && string.IsNullOrEmpty(dr["Ordv_ClothingTime"].ToString_s())) { if (!string.IsNullOrEmpty(funcName)) { funcName += ","; } funcName += "未安排送礼服"; } if (Convert.ToInt32(dr["serviceCount"].ToString_s()) > 0) { if (!string.IsNullOrEmpty(funcName)) { funcName += ","; } funcName += "未安排服务(" + dr["serviceCount"].ToString_s() + ")"; } if(rdoPhotographed.Checked && !funcName.Contains("拍照")) { continue; } else if (rdoFilmSelection.Checked && !funcName.Contains("选片")) { continue; } else if (rdoLookDesign.Checked && !funcName.Contains("看版")) { continue; } else if (rdoTotakePiece.Checked && !funcName.Contains("取件")) { continue; } else if (rdoSelectDress.Checked && !funcName.Contains("送礼服")) { continue; } if (string.IsNullOrEmpty(funcName)) { continue; } cell = new DataGridViewTextBoxCell(); dgvr.Cells.Add(cell); cell.Value = funcName; dgvUnarranged.Rows.Add(dgvr); } } private void BtnSearch_Click(object sender, EventArgs e) { PublicDataRows(); } } }