|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Data;
|
|
|
|
using System.Drawing;
|
|
|
|
using System.Windows.Forms;
|
|
|
|
using QMAPP.FJC.Entity.Operation;
|
|
|
|
using QMAPP.ServicesAgent;
|
|
|
|
using QMAPP.FJC.Entity.BZD;
|
|
|
|
using QMAPP.Entity;
|
|
|
|
|
|
|
|
namespace QMAPP.WinForm.Forms.Operation
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
public partial class SignInfoForm : Form
|
|
|
|
{
|
|
|
|
//获取服务代理
|
|
|
|
QMAPP.ServicesAgent.ServiceAgent _agent = ClientContext.GetServiceAgent();
|
|
|
|
|
|
|
|
List<Config> _bzdConfig = null;
|
|
|
|
private SignInfo signInfo = new SignInfo();
|
|
|
|
|
|
|
|
Product _CurrentProduct = null;
|
|
|
|
private OperationForm _parentForm;
|
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="parentForm"></param>
|
|
|
|
public SignInfoForm(OperationForm parentForm)
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
infolabel.Text = "";
|
|
|
|
infolabel.ForeColor = Color.Red;
|
|
|
|
_parentForm = parentForm;
|
|
|
|
}
|
|
|
|
|
|
|
|
#region 打印按钮
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 打印按钮
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
/// <param name="e"></param>
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(cbMaterial.Text))
|
|
|
|
{
|
|
|
|
infolabel.Text = "请选择标记类型!";
|
|
|
|
cbMaterial.Focus();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
signInfo.ProductCode = txtMainCode.Text;
|
|
|
|
signInfo.WorkLoc = _parentForm._SignMachineInfo.MACHINECODDE;
|
|
|
|
signInfo.Type = cbMaterial.Text;
|
|
|
|
|
|
|
|
var result = _agent.InvokeServiceFunction<DataResult<int>>(B9IPCService.SignInfoBLL_Insert.ToString(), signInfo);
|
|
|
|
|
|
|
|
if (result.Result > 0)
|
|
|
|
{
|
|
|
|
infolabel.Text = "保存成功!";
|
|
|
|
txtMainCode.Text = "";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
catch (Exception exception)
|
|
|
|
{
|
|
|
|
MessageBox.Show("打印失败!");
|
|
|
|
throw;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 查找Product
|
|
|
|
/// <summary>
|
|
|
|
/// 查找Product
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
public Product SelectProduct(string Products)
|
|
|
|
{
|
|
|
|
var list = new List<string>();
|
|
|
|
var ProductList = _agent.InvokeServiceFunction<Product>(B9IPCService.ProductBLL_Get.ToString(), new Product() { PRODUCTCODE = Products });
|
|
|
|
return ProductList;
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 初始界面
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
/// <param name="e"></param>
|
|
|
|
private void PrintForm_Load(object sender, EventArgs e)
|
|
|
|
{
|
|
|
|
_bzdConfig.Add(new Config { PID = "配胶", MATERIALCODDE = "配胶" });
|
|
|
|
_bzdConfig.Add(new Config { PID = "清胶", MATERIALCODDE = "清胶" });
|
|
|
|
_bzdConfig.Add(new Config { PID = "表皮新料", MATERIALCODDE = "表皮新料" });
|
|
|
|
LoadAssyMaterial();
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 加载总成物料
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 加载总成物料
|
|
|
|
/// </summary>
|
|
|
|
private void LoadAssyMaterial()
|
|
|
|
{
|
|
|
|
|
|
|
|
//模腔号
|
|
|
|
this.cbMaterial.DataSource = _bzdConfig;
|
|
|
|
this.cbMaterial.DisplayMember = "MATERIALCODDE";
|
|
|
|
this.cbMaterial.ValueMember = "PID";
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
public class Config{
|
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
public string PID { get; set; }
|
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
public string MATERIALCODDE { get; set; }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
private void label2_Click(object sender, EventArgs e)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|