using System; using System.Collections.Generic; using System.Configuration; using System.Drawing; using System.Windows.Forms; using QMAPP.FJC.Entity; using QMAPP.FJC.Entity.Injection; using QMAPP.FJC.Entity.Operation; using QMAPP.ServicesAgent; using QMAPP.WinForm.Common; using QMFrameWork.Common.Serialization; using QMFrameWork.Data; using QMAPP.Entity; using QMAPP.FJC.Entity.ProduceManage; using QMAPP.MD.Entity.TianJin; namespace QMAPP.WinForm.Forms.TianJin { /// /// 模块编号:M13-3 /// 作 用:出库操作 /// 作 者:王丹丹 /// 编写日期:2015年07月13日 /// public partial class TJOutWarehouseForm : Form { Storage searchModel = new Storage();//查询条件 Storage product = new Storage(); Main main = new Main(); //int isValidate = 0;//0:未校验 1:已校验 public TJOutWarehouseForm() { InitializeComponent(); } #region 窗体载入 private void Form_Load(object sender, EventArgs e) { //初始化控件属性 this.DGMendRecorder.AutoGenerateColumns = false; //出库原因下拉 BasicData basicData = new BasicData(); //comINTTYPE this.comINTTYPE.DataSource = basicData.GetOutReasonList(true); this.comINTTYPE.DisplayMember = "OUTREASON_NAME"; this.comINTTYPE.ValueMember = "OUTREASON_CODE"; //初始化分页 this.pager1.Init(); //加载默认查询条件 SetSearchModel(); BindGirdData(); } #endregion #region 绑定数据 /// /// 绑定数据列表 /// /// private DataPage BindGirdData() { QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent(); DataResult resultProduct = new DataResult(); DataResult
resultMain = new DataResult
(); List listProduct = new List(); List
listMain = new List
(); DataPage dataPage = new DataPage(); //获取前台分页设置信息 dataPage = pager1.DataPage; try { searchModel.State = "2"; //获取零件信息 var result = agent.InvokeServiceFunction>("StorageBLL_GetList", searchModel, dataPage); this.DGMendRecorder.DataSource = JsonConvertHelper.GetDeserialize>(result.Result.Result.ToString()); this.pager1.DataPage = dataPage; } catch (Exception ex) { throw ex; } return dataPage; } #endregion #region 事件 /// /// 分页事件 /// /// /// private DataPage pager1_EventPaging(Controls.EventPagingArg e) { return BindGirdData(); } /// /// 查询事件 /// /// /// private void tsbSearch_Click(object sender, EventArgs e) { BindGirdData(); } /// /// 出库 /// /// /// private void tsbOutWarehouse_Click(object sender, EventArgs e) { var form = new TJSendCodeForm(); //form.StartPosition = FormStartPosition.CenterScreen; form.ShowDialog(); this.pager1.Init(); BindGirdData(); } #endregion #region 设置查询条件 /// /// 设置查询条件 /// private void SetSearchModel() { searchModel = new Storage(); //条码 if (string.IsNullOrEmpty(this.txtPRODUCTCODE.Text.Trim()) == false) { searchModel.ProductCode = this.txtPRODUCTCODE.Text.Trim(); } //入库类型 if (this.comINTTYPE.SelectedValue != null && string.IsNullOrEmpty(this.comINTTYPE.SelectedValue.ToString().Trim()) == false) { searchModel.InStorageType = this.comINTTYPE.SelectedValue.ToString().Trim(); } //操作开始时间 if (string.IsNullOrEmpty(this.dtpCREATEDATESTART.Text.Trim()) == false) { searchModel.BeginTime = Convert.ToDateTime((this.dtpCREATEDATESTART.Value).ToString("yyyy-MM-dd") + " 00:00:00"); } //操作结束时间 if (string.IsNullOrEmpty(this.dtpCREATEDATEEND.Text.Trim()) == false) { searchModel.EndTime = Convert.ToDateTime((this.dtpCREATEDATEEND.Value).ToString("yyyy-MM-dd") + " 23:59:59"); } } #endregion /// /// 行序号 /// /// /// private void DG_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { Rectangle rectangle = new Rectangle(e.RowBounds.Location.X, e.RowBounds.Location.Y, this.DGMendRecorder.RowHeadersWidth - 4, e.RowBounds.Height); TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(), new Font("宋体", 12, FontStyle.Bold), rectangle, this.DGMendRecorder.RowHeadersDefaultCellStyle.ForeColor, TextFormatFlags.VerticalCenter | TextFormatFlags.Right); } } }