public DeviceInput(string title, int mode, CelotMClient.Model.Device device)
 {
     // TODO: Complete member initialization
     InitializeComponent();
     this.Text = title;
     this.mode = mode;
     this.device = device;
 }
        private bool CheckField()
        {
            if (String.IsNullOrEmpty(this.nameBox.Text))
            {
                MessageBox.Show("라우터 이름을 입력해주세요");
                this.nameBox.Focus();
                return false;
            }
            String name = this.nameBox.Text;

            if (String.IsNullOrEmpty(this.groupNameBox.Text))
            {
                MessageBox.Show("라우터 그룹을 입력해주세요");
                this.nameBox.Focus();
                return false;
            }
            String groupName = this.groupNameBox.Text;

            if (String.IsNullOrEmpty(this.serialBox.Text))
            {
                MessageBox.Show("시리얼 번호를 입력해주세요");
                this.serialBox.Focus();
                return false;
            }

            if (String.IsNullOrEmpty(this.secuCodeBox.Text) || this.secuCodeBox.Text.Length !=8 )
            {
                MessageBox.Show("8자리의 보안코드를 입력해주세요");
                this.secuCodeBox.Focus();
                return false;
            }
            String secuCode = this.secuCodeBox.Text;

            int serialNo;
            bool isNum = int.TryParse(this.serialBox.Text, out serialNo);
            if (!isNum )
            {
                ShowMessage("시리얼 번호는 숫자만 가능합니다");
                this.serialBox.Focus();
                return false;
            }

            string routerIp = this.routerIpBox.Text;
            if (String.IsNullOrEmpty(routerIp))
            {
                ShowMessage("라우터 IP 를 입력해주세요");
                this.routerIpBox.Focus();
                return false;
            }

            if (!CelotUtility.CheckValidIp(routerIp))
            {
                ShowMessage("아이피 포맷이 잘못되었습니다. ");
                this.routerIpBox.Focus();
                return false;
            }

            if (String.IsNullOrEmpty(this.latitudeBox.Text))
            {
                ShowMessage("위도 정보를 입력해주세요");
                this.latitudeBox.Focus();
                return false;
            }

            double latitude;
            bool isFloat = double.TryParse(this.latitudeBox.Text, out latitude);
            if (!isFloat)
            {
                ShowMessage("위도 정보는 실수만 가능합니다");
                this.latitudeBox.Focus();
                return false;
            }

            if (String.IsNullOrEmpty(this.longitudeBox.Text))
            {
                MessageBox.Show("경도 정보를 입력해주세요");
                this.longitudeBox.Focus();
                return false;
            }

            double longitude;
            bool isFloat1 = double.TryParse(this.longitudeBox.Text, out longitude);
            if (!isFloat1)
            {
                ShowMessage("경도 정보는 실수만 가능합니다");
                this.longitudeBox.Focus();
                return false;
            }

            if (String.IsNullOrEmpty(this.desBox.Text))
            {
                ShowMessage("라우터 설명을 입력해주세요");
                this.desBox.Focus();
                return false;
            }
            string des = this.desBox.Text;

            if (String.IsNullOrEmpty(this.phoneBox_1.Text))
            {
                MessageBox.Show("라우터 전화번호를 입력해주세요");
                this.phoneBox_1.Focus();
                return false;
            }

            int phoneNumber;
            bool isNum1 = int.TryParse(this.phoneBox_1.Text, out phoneNumber);
            if (!isNum1)
            {
                ShowMessage("전화번호는 숫자만 가능합니다");
                this.phoneBox_1.Focus();
                return false;
            }

            if (this.mode == Constants.CREATE)
            {
                this.device = new Device();
            }

            this.device.Name = name;
            this.device.SecuCode = secuCode;
            this.device.Des = des;
            this.device.Latitude = this.latitudeBox.Text;
            this.device.Longitude = this.longitudeBox.Text;
            this.device.PhoneNumber = phoneNumber;
            this.device.GroupName = this.groupNameBox.Text;
            this.device.RouterIp = routerIp;
            this.device.SerialNo = serialNo;
            this.device.SmsSupport = this.smsSupportCombo.SelectedIndex;
            this.device.VpnSupport = this.vpnSupportCombo.SelectedIndex;
            this.device.WifiSupport = this.wifiSupportCombo.SelectedIndex;
            this.device.BatterySupport = this.batterySupportCombo.SelectedIndex;

            return true;
        }
 public NMSReportCommand(Device device, nms_reprot_t report)
 {
     this.Device = device;
     this.nms_reprot_t = report;
     this._alertList = new List<AlertClass>();
 }