You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
2.0 KiB
72 lines
2.0 KiB
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 QMAPP.ServicesAgent;
|
|
using QMAPP.FJC.Entity.ProduceManage;
|
|
|
|
namespace QMAPP.WinForm.Forms.Mend
|
|
{
|
|
public partial class ItemForm : Form
|
|
{
|
|
MendRecorderReasonForm form;
|
|
|
|
public ItemForm()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public ItemForm(MendRecorderReasonForm Mform)
|
|
{
|
|
InitializeComponent();
|
|
this.form = Mform;
|
|
}
|
|
|
|
private void tsbClose_Click(object sender, EventArgs e)
|
|
{
|
|
this.Close();
|
|
}
|
|
|
|
private void ItemForm_Load(object sender, EventArgs e)
|
|
{
|
|
QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent();
|
|
DataTable recorder = agent.InvokeServiceFunction<DataTable>(B9IPCService.DefectTypeBLL_GetDefectType.ToString());
|
|
|
|
itemCheckBoxList.DataSource = recorder;
|
|
itemCheckBoxList.DisplayMember = "DEFECTVALUE";
|
|
itemCheckBoxList.ValueMember = "DEFECTKEY";
|
|
}
|
|
|
|
private void tsbSave_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
if (itemCheckBoxList.CheckedItems.Count == 0)
|
|
{
|
|
MessageBox.Show("请选择缺陷类型!", "提示");
|
|
return;
|
|
}
|
|
if (itemCheckBoxList.CheckedItems.Count > 1)
|
|
{
|
|
MessageBox.Show("只能选择一条缺陷!", "提示");
|
|
return;
|
|
}
|
|
List<DefectType> list = new List<DefectType>();
|
|
|
|
for (int i = 0; i < itemCheckBoxList.CheckedItems.Count; i++)
|
|
{
|
|
DataRowView dv = ((DataRowView)itemCheckBoxList.CheckedItems[i]);
|
|
list.Add(new DefectType() { DEFECTVALUE = dv["DEFECTVALUE"].ToString(), DEFECTKEY = dv["DEFECTKEY"].ToString() });
|
|
}
|
|
|
|
form.getSelectList = list;
|
|
|
|
this.Close();
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|