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 { /// /// /// public partial class SignInfoForm : Form { //获取服务代理 QMAPP.ServicesAgent.ServiceAgent _agent = ClientContext.GetServiceAgent(); List _bzdConfig = null; private SignInfo signInfo = new SignInfo(); Product _CurrentProduct = null; private OperationForm _parentForm; /// /// /// /// public SignInfoForm(OperationForm parentForm) { InitializeComponent(); infolabel.Text = ""; infolabel.ForeColor = Color.Red; _parentForm = parentForm; } #region 打印按钮 /// /// 打印按钮 /// /// /// 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>(B9IPCService.SignInfoBLL_Insert.ToString(), signInfo); if (result.Result > 0) { infolabel.Text = "保存成功!"; txtMainCode.Text = ""; return; } } catch (Exception exception) { MessageBox.Show("打印失败!"); throw; } } #endregion #region 查找Product /// /// 查找Product /// /// public Product SelectProduct(string Products) { var list = new List(); var ProductList = _agent.InvokeServiceFunction(B9IPCService.ProductBLL_Get.ToString(), new Product() { PRODUCTCODE = Products }); return ProductList; } #endregion #region 初始界面 /// /// /// /// /// 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 加载总成物料 /// /// 加载总成物料 /// private void LoadAssyMaterial() { //模腔号 this.cbMaterial.DataSource = _bzdConfig; this.cbMaterial.DisplayMember = "MATERIALCODDE"; this.cbMaterial.ValueMember = "PID"; } /// /// /// public class Config{ /// /// /// public string PID { get; set; } /// /// /// public string MATERIALCODDE { get; set; } } #endregion private void label2_Click(object sender, EventArgs e) { } } }