天津投入产出系统后端
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.
 
 
 
 
 
 

112 lines
3.9 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.Entity;
using QMAPP.ServicesAgent;
using QMAPP.FJC.Entity.Produce;
using QMAPP.MD.Entity;
namespace QMAPP.WinForm.Forms.Test
{
public partial class Door_frameForm : Form
{
Product recorder = new Product();//编辑保存实体
public Door_frameForm()
{
InitializeComponent();
}
/// <summary>
/// 校验料架零件号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void textBox1_CheckRackCode(object sender, EventArgs e)
{
var rockcode=this.textBox1.Text;
Material material = new Material();
material.MATERIAL_CODE = rockcode;
QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent();
DataResult<Material> result;
if (!string.IsNullOrEmpty(rockcode))
{
result = agent.InvokeServiceFunction<DataResult<Material>>("MaterialBLL_Get", material);
if (result.Result==null)
{
lblError.Text = string.Format("{0}料架零件号不存在!", textBox1.Text);
this.lblError.ForeColor = Color.Red;
}
}
}
/// <summary>
/// 料箱零件号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void textBox2_CheckCaseMaterialCode(object sender, EventArgs e)
{
var casematerialcode=this.textBox2.Text;
QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent();
//DataResult<int> result;
//if (!string.IsNullOrEmpty(casematerialcode))
//{
// //result = agent.InvokeServiceFunction<DataResult<int>>(B9BasicService.InjectionRecorderBLL_Insert.ToString(), rockcode);
// if (1 != 1)
// {
// lblError.Text = string.Format("{0}料箱零件号不存在!", textBox2.Text);
// this.lblError.ForeColor = Color.Red;
// }
//}
if (this.textBox2.Text != this.textBox1.Text)
{
lblError.Text = string.Format("{0}料箱零件号和料架零件号不同!", textBox2.Text);
this.lblError.ForeColor = Color.Red;
}
}
/// <summary>
/// 箱号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void textBox3_CheckCaseCode(object sender, EventArgs e)
{
var casecode = this.textBox3.Text;
QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent();
Product productinfo = new Product();
if (!string.IsNullOrEmpty(casecode))
{
productinfo.PRODUCTCODE = casecode;
List<Product> product = agent.InvokeServiceFunction<List<Product>>(B9BasicService.ProductBLL_GetAllList.ToString(), productinfo);
if (product.Count>0)
{
lblError.Text = string.Format("{0}箱号已存在!", textBox3.Text);
this.lblError.ForeColor = Color.Green;
}
else
{
//不存在则插入
DataResult<int> result = agent.InvokeServiceFunction<DataResult<int>>(B9BasicService.ProductBLL_Insert.ToString(), productinfo);
if (result.IsSuccess)
{
lblError.Text = string.Format("{0}插入成功!", textBox3.Text);
this.lblError.ForeColor = Color.Green;
}
}
}
}
}
}