示例#1
0
        private void ShowSettedLicenseService()
        {
            string LStrMainSpare = string.Empty;
            string LStrIsEnabled = string.Empty;
            string LStrServerHost = string.Empty;
            string LStrServerPort = string.Empty, LStrOtherInfo = string.Empty;

            TextBoxMPort.SetMinMaxDefaultValue(1024, 65535, 3070);
            TextBoxSPort.SetMinMaxDefaultValue(1024, 65535, 3070);

            foreach (DataRow LDataRowSingleLicenseService in IDataTableLicenseService.Rows)
            {
                LStrMainSpare  = LDataRowSingleLicenseService["MainSpare"].ToString();
                LStrIsEnabled  = LDataRowSingleLicenseService["IsEnabled"].ToString();
                LStrServerHost = LDataRowSingleLicenseService["ServerHost"].ToString();
                LStrServerPort = LDataRowSingleLicenseService["ServerPort"].ToString();
                LStrOtherInfo  = LDataRowSingleLicenseService["OtherInfo"].ToString();

                if (LStrMainSpare == "1")
                {
                    if (LStrIsEnabled == "1")
                    {
                        RadioButtonMIsEnabled1.IsChecked = true;
                    }
                    else
                    {
                        RadioButtonMIsEnabled0.IsChecked = true;
                    }
                    TextBoxMServer.SetIP(LStrServerHost);
                    TextBoxMPort.SetElementData(LStrServerPort);
                }
                else
                {
                    if (LStrIsEnabled == "1")
                    {
                        RadioButtonSIsEnabled1.IsChecked = true;
                    }
                    else
                    {
                        RadioButtonSIsEnabled0.IsChecked = true;
                    }
                    TextBoxSServer.SetIP(LStrServerHost);
                    TextBoxSPort.SetElementData(LStrServerPort);
                }
            }
        }
示例#2
0
        private bool VerfySettedParameters()
        {
            bool   LBoolReturn     = true;
            string LStrMServerHost = string.Empty;
            string LStrMServerPort = string.Empty;
            string LStrMIsEnabled  = string.Empty;

            string LStrSServerHost = string.Empty;
            string LStrSServerPort = string.Empty;
            string LStrSIsEnabled  = string.Empty;
            string LStrP01         = string.Empty;

            try
            {
                LStrMServerHost = TextBoxMServer.GetIP();
                LStrMServerPort = TextBoxMPort.GetElementData();
                if (RadioButtonMIsEnabled1.IsChecked == true)
                {
                    LStrMIsEnabled = "1";
                }
                else
                {
                    LStrMIsEnabled = "0";
                }

                LStrSServerHost = TextBoxSServer.GetIP();
                LStrSServerPort = TextBoxSPort.GetElementData();
                if (RadioButtonSIsEnabled1.IsChecked == true)
                {
                    LStrSIsEnabled = "1";
                }
                else
                {
                    LStrSIsEnabled = "0";
                }

                if (LStrMIsEnabled == "0" && LStrSIsEnabled == "0")
                {
                    MessageBox.Show(App.GetDisplayCharater("M01111"), App.GStrApplicationReferredTo, MessageBoxButton.OK, MessageBoxImage.Warning);
                    return(false);
                }

                foreach (DataRow LDataRowSingleLicenseService in IDataTableLicenseService.Rows)
                {
                    LStrP01 = LDataRowSingleLicenseService["MainSpare"].ToString();
                    if (LStrP01 == "1")
                    {
                        LDataRowSingleLicenseService["IsEnabled"]  = LStrMIsEnabled;
                        LDataRowSingleLicenseService["ServerHost"] = LStrMServerHost;
                        LDataRowSingleLicenseService["ServerPort"] = LStrMServerPort;
                    }
                    else
                    {
                        LDataRowSingleLicenseService["IsEnabled"]  = LStrSIsEnabled;
                        LDataRowSingleLicenseService["ServerHost"] = LStrSServerHost;
                        LDataRowSingleLicenseService["ServerPort"] = LStrSServerPort;
                    }
                }
            }
            catch (Exception ex)
            {
                LBoolReturn = false;
                App.ShowExceptionMessage("VerfySettedParameters()\n" + ex.ToString());
            }
            return(LBoolReturn);
        }