private void getHistBtn_Click(object sender, EventArgs e) { this.workCodeMTB.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals; bool length = this.workCodeMTB.Text.Length == 0; this.workCodeMTB.TextMaskFormat = MaskFormat.IncludeLiterals; if (!length) { Workcode workcode = new Workcode(this.workCodeMTB.Text, false); if (workcode.KeyFound()) { this.partlNumberTB.Text = workcode.GetValue(workcode.MODELLCODE); string value = workcode.GetValue(workcode.AMPVERSION); this.versionUD.Value = Convert.ToDecimal(value); this.versionUD.Show(); } } this.ClearBindings(); this.ToggleEabledStates(false); string str = this.partlNumberTB.Text.Trim(); string str1 = this.versionUD.Value.ToString(); this._histTable = new HistoryTable(str, str1, false); if (this._histTable.KeyFound()) { this.BindControls(); this.ToggleEabledStates(true); return; } string[] strArrays = new string[] { "Partnumber: ", str, " Version: ", str1, " Could not be found in History!" }; MessageBox.Show(string.Concat(strArrays)); }
static public int GetLabelQtyFromWorkCode(string sWorkCode) { Workcode wc = new Workcode(sWorkCode); int nQty = Convert.ToInt32(wc.GetValue("quantity")); return(nQty); }
private void FillLabelData() { _wcLabelData = new LabelDataStruct(); Workcode wc = new Workcode(WorkCode); if (wc.KeyFound()) { string sPartNumber = wc.GetValue(wc.MODELLCODE).Trim(); _wcLabelData.PartNumber = sPartNumber; _wcLabelData.ROHS = Convert.ToBoolean(wc.GetValue("Rohasyorn")); string sVersion = wc.GetValue(wc.AMPVERSION); _wcLabelData.nQty = Convert.ToInt32(wc.GetValue("Quantity")); // ja - separate the 0. from the 00 string[] sStrippedVersion = sVersion.Split('.'); if (sStrippedVersion.Count() > 1) { _wcLabelData.nVersion = Convert.ToInt32(sStrippedVersion[1]); } PartsTable pt = new PartsTable(sPartNumber, sVersion); if (pt.KeyFound()) { _wcLabelData.EtherCat = Convert.ToBoolean(pt.GetValue("Ethercat")); _wcLabelData.UL = Convert.ToBoolean(pt.GetValue("UL")); _wcLabelData.InputSpecs = pt.GetValue("Inspecs").Trim(); _wcLabelData.OutputSpecs = pt.GetValue("Outspecs").Trim(); _wcLabelData.RevLetter = pt.GetValue("Revision").Trim(); _wcLabelData.CE = Convert.ToBoolean(pt.GetValue("Emc")); _wcLabelData.ProtoType = Convert.ToBoolean(pt.TableName == "Proto"); // ja - internal use _wcLabelData.BaseModel = pt.GetValue("BaseModel").Trim(); _wcLabelData.Extension = pt.GetValue("Extension").Trim(); _wcLabelData.sLabelsCode = pt.GetValue("Labelscode"); } } }