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.StudioDataSet { public partial class OrderDeletePhotosFormMain : LYFZ.Software.UI.StudioDataSet.OrderDeletePhotosFormMain { public OrderDeletePhotosFormMain() { this.Load += OrderDeletePhotosFormMain_Load; this.btnQuery.Click += btnQuery_Click; this.btnDelete.Click += btnDelete_Click; this.cmbQueryText.KeyDown += cmbQueryText_KeyDown; this.UcPagerEx1.EventPaging += UcPagerEx1_EventPaging; } string strUsrID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID; /// /// 窗体加载事件 /// /// /// void OrderDeletePhotosFormMain_Load(object sender, EventArgs e) { if (this.dgvData.Columns.Count <= 0) { string strColumn = "Ord_Number,订单号,客户姓名,订单类型,取件日期,已取天数,原片状况,初修片状况,精修片状况,设计片状况,接单人,套系名称,套系价格"; this.dgvData.DataColumns(strColumn, "Ord_Number"); this.dgvData.Columns["订单号"].Width = 120; this.dgvData.Columns["已取天数"].Width = 60; this.dgvData.Columns["原片状况"].Width = 140; this.dgvData.Columns["初修片状况"].Width = 140; this.dgvData.Columns["精修片状况"].Width = 140; this.dgvData.Columns["设计片状况"].Width = 140; } this.PublicFunctionRows(); } /// /// 查询 /// /// /// void btnQuery_Click(object sender, EventArgs e) { this.PublicFunctionRows(); } /// /// 查询回车事件 /// /// /// void cmbQueryText_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { this.PublicFunctionRows(); } } /// /// 删除 /// /// /// void btnDelete_Click(object sender, EventArgs e) { } /// /// 创建行 /// private void PublicFunctionRows() { this.UcPagerEx1.PageCurrent = 1; this.UcPagerEx1.PageSize = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPageSize();//3;分页条数 this.UcPagerEx1.Bind(); } /// /// 分页前数据,便于展开时用来查询订单的子数据 /// DataTable tblMianSelectData = new DataTable(); /// /// 画分页 /// /// /// int UcPagerEx1_EventPaging(UCPager.EventPagingArg e) { LYFZ.UCPager.PageData pageData = new LYFZ.UCPager.PageData(); pageData.TableName = "Vw_OrderPickupSelect"; pageData.PageIndex = this.UcPagerEx1.PageCurrent; pageData.PageSize = this.UcPagerEx1.PageSize; pageData.QueryCondition = GetWhereStr(); pageData.OrderStr = "ID"; pageData.OrderType = 1; this.dgvData.dgvGuidName = LYFZ.EnumPublic.dgvGuidName.E_FormAll_A0001.ToString().Trim(); this.dgvData.dgvUserEmployeeID = strUsrID; this.dgvData.dgvFixedHideColumn = "Ord_Number"; this.dgvData.dgvCurrentColumnOriginalSet = "Ord_Number,sOrd_Number,Cus_Name,Ord_Type_CS,PickupStatus,PickupTime,dayCount,Ord_SeriesName,Ord_SeriesPrice,OrdPe_OrdersPerson,Ord_PhotoPath"; pageData.QueryFieldName = this.dgvData.dgvSetColumnName(); if (string.IsNullOrEmpty(pageData.QueryFieldName)) { pageData.QueryFieldName = this.dgvData.dgvCurrentColumnOriginalSet; } LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker) { this.tblMianSelectData = pageData.QueryDataTable().Tables[0]; try { this.Invoke(new LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.UpdateControl(delegate() { //this.dgvData.DataSourceMain(this.tblMianSelectData); this.dgvData.Rows.Clear(); for (int i = 0; i < tblMianSelectData.Rows.Count; i++) { DataGridViewRow dgvr = new DataGridViewRow(); DataGridViewCell cell = null; cell = new DataGridViewTextBoxCell(); cell.Value = tblMianSelectData.Rows[i]["Ord_Number"].ToString(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = tblMianSelectData.Rows[i]["sOrd_Number"].ToString(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = tblMianSelectData.Rows[i]["Cus_Name"].ToString(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = tblMianSelectData.Rows[i]["Ord_Type_CS"].ToString(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(tblMianSelectData.Rows[i]["PickupTime"], "yyyy-MM-dd"); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = tblMianSelectData.Rows[i]["dayCount"].ToString(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.BLL.BLL_ErpOrder.GetPhotoDelInfo(tblMianSelectData.Rows[i]["Ord_PhotoPath"].ToString(), LYFZ.Model.Model_ErpOrder.DirectoryType.PrimitivePicture); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.BLL.BLL_ErpOrder.GetPhotoDelInfo(tblMianSelectData.Rows[i]["Ord_PhotoPath"].ToString(), LYFZ.Model.Model_ErpOrder.DirectoryType.EarlyRetouch); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.BLL.BLL_ErpOrder.GetPhotoDelInfo(tblMianSelectData.Rows[i]["Ord_PhotoPath"].ToString(), LYFZ.Model.Model_ErpOrder.DirectoryType.FineRetouch); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.BLL.BLL_ErpOrder.GetPhotoDelInfo(tblMianSelectData.Rows[i]["Ord_PhotoPath"].ToString(), LYFZ.Model.Model_ErpOrder.DirectoryType.DesignPiece); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = tblMianSelectData.Rows[i]["OrdPe_OrdersPerson"].ToString(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = tblMianSelectData.Rows[i]["Ord_SeriesName"].ToString(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = tblMianSelectData.Rows[i]["Ord_SeriesPrice"].ToString(); dgvr.Cells.Add(cell); this.dgvData.Rows.Add(dgvr); } })); } catch { } }); try { this.UcPagerEx1.TbDataSource = this.tblMianSelectData; this.dgvData.Columns["客户姓名"].Frozen = true; //this.dgvData.Columns["套系价格"].Width = 30; } catch { } this.dgvData.ClearSelection(); return pageData.TotalCount; } /// /// 返回要操作的条件 /// /// private string GetWhereStr() { string StrWhere = " 1=1 "; string StrText = cmbQueryText.Text.Trim(); if (!string.IsNullOrEmpty(StrText)) { StrWhere += " and sOrd_Number = '" + StrText + "'"; } return StrWhere; } } }