123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- 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;
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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();
- }
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnQuery_Click(object sender, EventArgs e)
- {
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 查询回车事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cmbQueryText_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- { this.PublicFunctionRows(); }
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnDelete_Click(object sender, EventArgs e)
- {
- }
- /// <summary>
- /// 创建行
- /// </summary>
- private void PublicFunctionRows()
- {
- this.UcPagerEx1.PageCurrent = 1;
- this.UcPagerEx1.PageSize = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetPageSize();//3;分页条数
- this.UcPagerEx1.Bind();
- }
- /// <summary>
- /// 分页前数据,便于展开时用来查询订单的子数据
- /// </summary>
- DataTable tblMianSelectData = new DataTable();
- /// <summary>
- /// 画分页
- /// </summary>
- /// <param name="e"></param>
- /// <returns></returns>
- 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;
- }
- /// <summary>
- /// 返回要操作的条件
- /// </summary>
- /// <returns></returns>
- private string GetWhereStr()
- {
- string StrWhere = " 1=1 ";
- string StrText = cmbQueryText.Text.Trim();
- if (!string.IsNullOrEmpty(StrText))
- { StrWhere += " and sOrd_Number = '" + StrText + "'"; }
- return StrWhere;
- }
- }
- }
|