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;
using Core.Mes.Client.Comm.Control;
using Core.Mes.Client.Comm.Server;
using Core.Mes.Client.Comm.Tool;
using CoreFS.CA06;
namespace Core.StlMes.Client.Lims.Data.PipeAndOutdec
{
public partial class FrmCheckConsignBaseInfo : FrmBase
{
public FrmCheckConsignBaseInfo()
{
InitializeComponent();
}
public override void ToolBar_Click(object sender, string ToolbarKey)
{
switch (ToolbarKey)
{
case "doQuery":
doQuery();
break;
case "doUpdate":
doUpdate();
break;
case "Close":
this.Close();
break;
}
}
///
/// 查询
///
public void doQuery()
{
string checkNo = ""; //检验编号
string heatNo = ""; //炉号
if (uchkCheckNo.Checked)
{
checkNo = txtCheckNo.Text.Trim();
}
if (uchkHeatNo.Checked)
{
heatNo = txtHeatNo.Text.Trim();
}
if (checkNo.Equals("")&& heatNo.Equals("")) {
MessageUtil.ShowTips("请输入检验编号或炉号查询!");
return;
}
DataTable dt = ServerHelper.GetData("com.steering.lims.data.pipe.FrmCheckConsignBaseInfo.doQuery", new Object[] { checkNo, heatNo}, this.ob);
GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
}
///
/// 修改
///
public void doUpdate()
{
try
{
ultraGrid1.Update();
if (ultraGrid1.ActiveRow == null)
{
MessageUtil.ShowTips("请选择需要修改的数据!");
return;
}
String craftSource = ultraGrid1.ActiveRow.Cells["CRAFT_SOURCE"].Value.ToString();
if (!craftSource.Equals("生产样") && !craftSource.Equals("首日样"))
{
MessageUtil.ShowTips("改数据非生产样,不能修改!");
return;
}
if (MessageUtil.ShowYesNoAndQuestion("是否确定修改?") == DialogResult.No)
{
return;
}
ArrayList all = new ArrayList();
String checkNo = ultraGrid1.ActiveRow.Cells["CHECK_NO"].Value.ToString();
all.Add(checkNo);
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.lims.data.pipe.FrmCheckConsignBaseInfo";
ccp.MethodName = "doUpdate";
ccp.ServerParams = new object[] { all };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode == -1) return;
MessageBox.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
doQuery();
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
private void FrmCheckConsignBaseInfo_Load(object sender, EventArgs e)
{
}
}
}