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

146 lines
4.0 KiB

2 years ago
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
{
2 years ago
/// <summary>
///
/// </summary>
2 years ago
public partial class SignInfoForm : Form
{
//获取服务代理
QMAPP.ServicesAgent.ServiceAgent _agent = ClientContext.GetServiceAgent();
2 years ago
List<Config> _bzdConfig = null;
private SignInfo signInfo = new SignInfo();
2 years ago
Product _CurrentProduct = null;
private OperationForm _parentForm;
2 years ago
/// <summary>
///
/// </summary>
/// <param name="parentForm"></param>
2 years ago
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
{
2 years ago
if (string.IsNullOrWhiteSpace(cbMaterial.Text))
{
infolabel.Text = "请选择标记类型!";
cbMaterial.Focus();
return;
}
2 years ago
2 years ago
signInfo.ProductCode = txtMainCode.Text;
signInfo.WorkLoc = _parentForm._SignMachineInfo.MACHINECODDE;
signInfo.Type = cbMaterial.Text;
2 years ago
2 years ago
var result = _agent.InvokeServiceFunction<DataResult<int>>(B9IPCService.SignInfoBLL_Insert.ToString(), signInfo);
2 years ago
2 years ago
if (result.Result > 0)
2 years ago
{
2 years ago
infolabel.Text = "保存成功!";
txtMainCode.Text = "";
return;
2 years ago
}
2 years ago
2 years ago
}
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)
{
2 years ago
_bzdConfig.Add(new Config { PID = "配胶", MATERIALCODDE = "配胶" });
_bzdConfig.Add(new Config { PID = "清胶", MATERIALCODDE = "清胶" });
_bzdConfig.Add(new Config { PID = "表皮新料", MATERIALCODDE = "表皮新料" });
2 years ago
LoadAssyMaterial();
}
#endregion
#region 加载总成物料
/// <summary>
/// 加载总成物料
/// </summary>
private void LoadAssyMaterial()
{
//模腔号
this.cbMaterial.DataSource = _bzdConfig;
this.cbMaterial.DisplayMember = "MATERIALCODDE";
this.cbMaterial.ValueMember = "PID";
}
2 years ago
/// <summary>
///
/// </summary>
public class Config{
/// <summary>
///
/// </summary>
public string PID { get; set; }
/// <summary>
///
/// </summary>
public string MATERIALCODDE { get; set; }
}
2 years ago
#endregion
private void label2_Click(object sender, EventArgs e)
{
}
}
}