Ejemplo n.º 1
0
        private string CreateToolID()
        {
            string toolID = null;

            // Get code for holder type
            if (TypeComboBox.Text == "Milling")
            {
                List <string> holderCode = SqliteDataAcces.SearchSingleValueByText("HolderCode_mill", "Holders", "HolderName", HolderComboBox.Text);
                toolID += holderCode[0];
            }
            else
            {
                List <string> holderCode = SqliteDataAcces.SearchSingleValueByText("HolderCode_turn", "Holders", "HolderName", HolderComboBox.Text);
                toolID += holderCode[0];
            }

            // Get code for diameter and length
            toolID += GetDiameter();
            toolID += GetLength();

            // Get code for function type
            if (TypeComboBox.Text == "Milling")
            {
                List <string> functionCode = SqliteDataAcces.SearchSingleValueByText("FunctionCode", "ToolFunctions_milling", "Function", FunctionComboBox.Text);
                toolID += functionCode[0];
            }
            else
            {
                List <string> functionCode = SqliteDataAcces.SearchSingleValueByText("FunctionCode", "ToolFunctions_turning", "Function", FunctionComboBox.Text);
                toolID += functionCode[0];
            }
            return(toolID);
        }