| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- 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 Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Server;
- using System.Collections;
- using CoreFS.CA06;
- using Core.Mes.Client.Comm.Control;
- namespace Core.StlMes.Client.ZGMil.Popup
- {
- public partial class frmInspector : Form
- {
- OpeBase ob = null;
- public frmInspector(OpeBase ob)
- {
- InitializeComponent();
- this.ob = ob;
- getMIL_BASE_INSPECTOR(ob);
- }
- //查询质检员信息
- public void getMIL_BASE_INSPECTOR(OpeBase ob)
- {
- DataTable dt =
- ServerHelper.GetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.getMIL_BASE_INSPECTOR", new object[] { }, ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dt_Defect, true);
- ultraGrid1.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraBtn_delete_Click(object sender, EventArgs e)
- {
- UltraGridRow ulgr = ultraGrid1.ActiveRow;
- if (ulgr != null)
- {
- int retnum = ServerHelper.SetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.DelMIL_BASE_INSPECTOR", new object[] { ulgr.Cells["INSPECTOR_CODE"].Value.ToString() }, this.ob);
- if (retnum > 0)
- {
- MessageBox.Show("删除成功", "提示", MessageBoxButtons.OK);
- getMIL_BASE_INSPECTOR(this.ob);
- }
- }
- else
- {
- MessageBox.Show("请选择要删除的行!", "提示", MessageBoxButtons.OK);
- }
- }
- /// <summary>
- /// 增加
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraBtn_add_Click(object sender, EventArgs e)
- {
- if (txtName.Text.Trim() == "")
- {
- MessageBox.Show("请输入一个有效的名称", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- if (txtCode.Text.Trim() == "")
- {
- MessageBox.Show("请输入一个有效的代码", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- {
- if (ultraGrid1.Rows[i].Cells["INSPECTOR_CODE"].Value.ToString() == txtCode.Text)
- {
- MessageBox.Show("输入的产线代码已存在,请重新输入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- }
- int retnum = ServerHelper.SetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.AddMIL_BASE_INSPECTOR", new object[] { txtCode.Text, txtName.Text, ulCombShift.Value, ulCombGroup.Value, txtPlanCode.Text }, this.ob);
- if (retnum > 0)
- {
- MessageBox.Show("添加成功", "提示", MessageBoxButtons.OK);
- getMIL_BASE_INSPECTOR(this.ob);
- }
- }
- /// <summary>
- /// 修改
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultrabtn_upd_Click(object sender, EventArgs e)
- {
- UltraGridRow ulgr = ultraGrid1.ActiveRow;
- if (ulgr == null)
- { MessageBox.Show("请选中一行数据进行更新", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; }
- if (txtName.Text.Trim() == "")
- {
- MessageBox.Show("请输入一个有效的名称", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- if (txtCode.Text.Trim() == "")
- {
- MessageBox.Show("请输入一个有效的代码", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- {
- if (ultraGrid1.Rows[i].Cells["INSPECTOR_CODE"].Value.ToString() == txtCode.Text && ultraGrid1.Rows[i] != ulgr)
- {
- MessageBox.Show("输入的产线代码已存在,请重新输入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- }
- int retnum = ServerHelper.SetData("com.steering.mes.zgmil.coup.SurfaceInspectionResult.UpdMIL_BASE_INSPECTOR", new object[] { txtCode.Text, txtName.Text, ulCombShift.Value, ulCombGroup.Value, txtPlanCode.Text, ulgr.Cells["INSPECTOR_CODE"].Value.ToString() }, this.ob);
- if (retnum > 0)
- {
- MessageBox.Show("更新成功", "提示", MessageBoxButtons.OK);
- getMIL_BASE_INSPECTOR(this.ob);
- }
- }
- /// <summary>
- /// 选中行激活事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow ugr = ultraGrid1.ActiveRow;
- txtCode.Text= ugr.Cells["INSPECTOR_CODE"].Value.ToString();
- txtName.Text= ugr.Cells["INSPECTOR_NAME"].Value.ToString();
- ulCombShift.Text = ugr.Cells["COL_SHIFT"].Value.ToString();
- ulCombGroup.Text = ugr.Cells["COL_GROUP"].Value.ToString();
- //txtPlanCode.Text = ugr.Cells["PLINE_CODE"].Value.ToString();
- }
- }
- }
|