示例#1
0
        private bool devConfigCheck()
        {
            string text = this.tbDevName.Text.Trim();

            this.tbDevName.Text = text;
            bool flag = false;

            Ecovalidate.checkTextIsNull(this.tbDevName, ref flag);
            if (flag)
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[]
                {
                    this.lbName.Text
                }));
                this.tbDevName.BackColor = Color.Red;
                return(false);
            }
            InSnergyGateway gateWaybyGID = InSnergyGateway.GetGateWaybyGID(this.m_gatewayID);

            if (text.Equals(gateWaybyGID.GatewayName))
            {
                this.tbDevName.BackColor = Color.White;
                return(true);
            }
            if (!InSnergyGateway.CheckGatewayName(text))
            {
                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Dev_nmdup, new string[]
                {
                    this.tbDevName.Text
                }));
                this.tbDevName.Focus();
                this.tbDevName.BackColor = Color.Red;
                return(false);
            }
            this.tbDevName.BackColor = Color.White;
            return(true);
        }
示例#2
0
 private bool pduNmCheckAtDb(string devname)
 {
     return(InSnergyGateway.CheckGatewayName(devname));
 }