private void button2_Click(object sender, EventArgs e) { int productId; int workorderId; int error; _machineHook.GetProductByReference(textBox4.Text, out productId); _machineHook.CreateWorkOrderIfNotExisted(textBox1.Text, productId, Convert.ToInt32(textBox3.Text), out workorderId); _machineHook.LoadReference(textBox4.Text, out error); label5.Text = workorderId.ToString(); textBox2.Text = productId.ToString(); }
private void ReferenceChanged(string data) { if (data != string.Empty) { int error; if (!_thisMachine.LoadReference(_machineData.ActiveReference, out error)) { _thisMachine.UnloadReference(); ShowInformation(@"Failed to Load Reference " + data + ". Error Code : " + error); SetTraceabilityStates(TraceabilityStates.WaitingForReference); } else { SetTraceabilityStates(TraceabilityStates.Ready); } } else { _thisMachine.UnloadReference(); } SetProductInformation(); }