| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- 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;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Tool;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- using Pur.Entity;
- using Pur.Entity.configureEntity;
- namespace Pur.Pop_upWindow
- {
- public partial class frmPopActualSeat : FrmPmsBase
- {
- private string deliveryLocation;
- private string deliveryLocationCode;
- private string tips;
- public string Tips
- {
- get { return tips; }
- set { tips = value; }
- }
- private string isJit="0";
- public string DeliveryLocationCode
- {
- get { return deliveryLocationCode; }
- set { deliveryLocationCode = value; }
- }
- public string DeliveryLocation
- {
- get { return deliveryLocation; }
- set { deliveryLocation = value; }
- }
- public frmPopActualSeat()
- {
- InitializeComponent();
- }
- public frmPopActualSeat(OpeBase OB,String strIsJit)
- {
- this.isJit = strIsJit;
- this.ob = OB;
- InitializeComponent();
- }
- //load
- private void frmPopActualSeat_Load(object sender, EventArgs e)
- {
- init();
- }
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- case "doRefresh": // ButtonTool
- init();
- break;
- case "doSure": // ButtonTool
- doSure();
- break;
- case "doClear": // ButtonTool
- doClear();
- break;
- case "doClose": // ButtonTool
- this.Close();
- break;
- }
- }
- //清空
- private void doClear()
- {
- deliveryLocation="";
- deliveryLocationCode="";
- tips = "1";
- this.Close();
- }
- //选择
- private void doSure()
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- getData(row);
- }
- //选择行
- private void getData(UltraGridRow row)
- {
- try
- {
- if (row == null)
- {
- MessageUtil.ShowTips("请选交付地点");
- return;
- }
- String strdeliveryLocation = row.GetCellValue("invPhysicName").ToString().Trim();
- String strdeliveryLocationCode = row.GetCellValue("invPhysic").ToString().Trim();
- if (String.IsNullOrEmpty(strdeliveryLocation) && String.IsNullOrEmpty(strdeliveryLocationCode))
- {
- MessageUtil.ShowTips("数据异常,交付地点和地点编码都不能空");
- return;
- }
- deliveryLocation = strdeliveryLocation;
- deliveryLocationCode = strdeliveryLocationCode;
- tips = "1";
- this.Close();
- }
- catch (Exception ex)
- {
- MessageUtil.ShowTips("操作失败:"+ex);
- }
- }
- //加载数据
- private void init()
- {
- try
- {
- this.Cursor = Cursors.WaitCursor;
- tips = "0";
- dataSet1.Clear();
- PhysicSeatEntity Phouse = new PhysicSeatEntity();
- Phouse.Validflag = "1";
- Phouse.InvPhysic = tbxPhysicQ.Text.ToString().Trim();
- Phouse.InvPhysicName = tbxPhysicNameQ.Text.ToString().Trim();
- if (isJit != "0")
- {
- Phouse.OrgId = UserInfo.GetDeptid();
- }
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.configure.service.ActualSeatService", "getActualSeat", new object[] { Phouse, 0, 0 });
- if (dt != null)
- {
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("查询失败:" + ex.Message);
- }
- finally
- {
- this.Cursor = Cursors.Default;
- }
- }
- //双击选择
- private void ultraGrid1_DoubleClickCell(object sender, Infragistics.Win.UltraWinGrid.DoubleClickCellEventArgs e)
- {
- //UltraGridRow row = e.Cell.Row;
- getData(e.Cell.Row);
- }
- }
- }
|