| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- 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 CoreFS.CA06;
- using Core.Mes.Client.Comm.Tool;
- using Core.Mes.Client.Comm.Server;
- using Core.StlMes.Client.YdmStuffManage.Entity;
- using System.Collections;
- using Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Format;
- using Infragistics.Win;
- using Core.Mes.Client.Comm.Control;
- using System.Threading;
- namespace Core.StlMes.Client.YdmStuffManage
- {
- public partial class FrmGPLocationDlog : FrmBase
- {
- public FrmGPLocationDlog(List<FrmGPRuleEntity> list)
- {
- entitys = list;
- InitializeComponent();
- }
- List<FrmGPRuleEntity> entitys = null;
- ArrayList arr = new ArrayList();
- private void Frm_Load(object sender, EventArgs e)
- {
- GridHelper.SetAllColumnsActive(ultraGrid1);
- //EntityHelper.ShowGridCaption<FrmGPRuleEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- foreach (FrmGPRuleEntity item in entitys) {
- arr.Add(item.StorageNo);
- }
- doQuery();
- }
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- case "Query":
- doQuery();
- break;
- case "doConfirm":
- doConfirm();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- private void doQuery()
- {
- this.dataTable1.Clear();
- String parm = "";
- if (chkLocationName.Checked) {
- parm = txtLocationName.Text;
- }
- DataTable dt = ServerHelper.GetData("Core.LgMes.Server.Stuffmanage.FrmGPRule.queryLocation", new Object[] { arr,parm }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
- }
- private void doConfirm()
- {
- try
- {
- this.ultraGrid1.UpdateData();
- if (ultraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowTips("请选择返库的料位号!");
- return;
- }
- ArrayList strEntity = new ArrayList();
- foreach (FrmGPRuleEntity item in entitys)
- {
- strEntity.Add(JSONFormat.Format(item));
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "Core.LgMes.Server.Stuffmanage.FrmGPRule";
- ccp.MethodName = "insertYdmGpOutList";
- ccp.ServerParams = new object[] { strEntity,ultraGrid1.ActiveRow.Cells["LOCATION_NO"].Value.ToString(),ultraGrid1.ActiveRow.Cells["LOCATION_NAME"].Value.ToString() };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp != null)
- {
- if (ccp.ReturnCode == -1)
- {
- MessageUtil.ShowWarning(ccp.ReturnInfo);
- return;
- }
- MessageUtil.ShowTips("返库成功!");
- this.CloseEvent = "update";
- this.Close();
- }
- }
- catch (System.Exception ex)
- {
- MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
- private void chkStoveNo_CheckedChanged(object sender, EventArgs e)
- {
- if (chkLocationName.Checked)
- {
- this.txtLocationName.Enabled = true;
- }
- else {
- this.txtLocationName.Enabled = false;
- }
- }
- /// <summary>
- /// 窗体关闭属性 默认关闭
- /// </summary>
- private string closeEvent = "formClose";
- /// <summary>
- /// 窗体关闭属性
- /// </summary>
- public string CloseEvent
- {
- get { return closeEvent; }
- set { closeEvent = value; }
- }
- }
- }
|