Example #1
0
        private string GetTextDisplay()
        {
            try
            {
                string text = null;
                if (IntV > 0 || StringValue.HasValue())
                {
                    switch (SearchType)
                    {
                    case eSearchType.None:
                        break;

                    case eSearchType.User:
                        var obj101 = vmMas.GetUser(StringValue);
                        text             = obj101.FULLNAME_TH;
                        this.selectedrow = obj101;
                        break;

                    case eSearchType.Customer:
                        var obj201 = vmMas.GetCustomer(IntV.GetValueOrDefault());
                        text             = obj201.NAME;
                        this.selectedrow = obj201;
                        break;

                    case eSearchType.Project:
                        var obj202 = vmMas.GetCustomerProject(IntV.GetValueOrDefault());
                        text             = obj202.NAME;
                        this.selectedrow = obj202;
                        break;

                    case eSearchType.Instrument:
                        var obj303 = vmMas.GetInstrument(IntV.GetValueOrDefault());
                        text             = obj303.NAME;
                        this.selectedrow = obj303;
                        break;

                    case eSearchType.MethodAnalysis:
                        this.selectedrow = vmMas.GetMethodAnalysis(IntV.GetValueOrDefault());
                        text             = (this.selectedrow as sp_MAS304_GetMethodAnalysis_Result).NAME;
                        break;

                    case eSearchType.ParameterAnalysis:
                        this.selectedrow = vmMas.GetParameterAnalysis(IntV.GetValueOrDefault());
                        text             = (this.selectedrow as sp_MAS305_GetParameterAnalysis_Result).NAME;
                        break;

                    case eSearchType.ToolPick:
                        var obj308 = vmMas.GetToolPick(IntV.GetValueOrDefault());
                        text             = obj308.NAME;
                        this.selectedrow = obj308;
                        break;

                    case eSearchType.ToolAnalysis:
                        var obj309 = vmMas.GetToolAnalysis(IntV.GetValueOrDefault());
                        text             = obj309.NAME;
                        this.selectedrow = obj309;
                        break;

                    case eSearchType.StandardLight:
                        var obj302 = vmMas.GetSTDLight(IntV.GetValueOrDefault());
                        text             = obj302.ALIAS_NAME.GetValueOrDefault(obj302.NAME);
                        this.selectedrow = obj302;
                        break;
                    }
                }
                return(text);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }