Exemplo n.º 1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (cbbVolume.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label1.Text), MessageBoxIcon.Error);
                cbbVolume.Focus();
                return;
            }
            int      VerifySuccAudio    = Convert.ToInt32(chkVerifySuccAudio.Checked);
            int      VerifyFailAudio    = Convert.ToInt32(chkVerifyFailAudio.Checked);
            int      RemoteCtrlAudio    = Convert.ToInt32(chkRemoteCtrlAudio.Checked);
            int      VerifySuccGuiTip   = Convert.ToInt32(chkVerifySuccGuiTip.Checked);
            int      VerifyFailGuiTip   = Convert.ToInt32(chkVerifyFailGuiTip.Checked);
            int      UnregisteredGuiTip = Convert.ToInt32(chkUnregisteredGuiTip.Checked);
            int      Volume             = Convert.ToInt32(cbbVolume.Text);
            int      IPHide             = Convert.ToInt32(chkIPHide.Checked);
            int      IsShowName         = Convert.ToInt32(chkIsShowName.Checked);
            int      IsShowTitle        = Convert.ToInt32(chkIsShowTitle.Checked);
            int      IsShowVersion      = Convert.ToInt32(chkIsShowVersion.Checked);
            int      IsShowDate         = Convert.ToInt32(chkIsShowDate.Checked);
            int      IDCardNumHide      = Convert.ToInt32(chkIDCardNumHide.Checked);
            int      ICCardNumHide      = Convert.ToInt32(chkICCardNumHide.Checked);
            SetSound setSound           = new SetSound(VerifySuccAudio, VerifyFailAudio, RemoteCtrlAudio, Volume, VerifySuccGuiTip, VerifyFailGuiTip, UnregisteredGuiTip, IPHide,
                                                       IsShowName, IsShowTitle, IsShowVersion, IsShowDate, IDCardNumHide, ICCardNumHide);
            jsonBody <SetSound> jsonBody = new jsonBody <SetSound>("SetSound", setSound);
            string     jsonString        = JsonConvert.SerializeObject(jsonBody);
            frmSeaOprt frm = new frmSeaOprt(this.Text, btnOk.Text, jsonString, 9, null);

            frm.ShowDialog();
            SaveParam();
        }
Exemplo n.º 2
0
        private void btnGetNetParam_Click(object sender, EventArgs e)
        {
            string     param = "";
            frmSeaOprt frm   = new frmSeaOprt(this.Text, btnGetTemperatureParam.Text, param, 15, null);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                param = frm.BodyParameter;
                if (param != "")
                {
                    Pub.MessageBoxShow(btnGetTemperatureParam.Text + Pub.GetResText("", "FK_RUN_SUCCESS", ""), MessageBoxIcon.Information);
                    jsonBody <TemperatureParam> jsonTemperatureParam = JsonConvert.DeserializeObject <jsonBody <TemperatureParam> >(param);

                    txtTemperatureCheck.Text         = jsonTemperatureParam.info.TemperatureCheck.ToString("0.00");
                    txtTemperatureHigh.Text          = jsonTemperatureParam.info.TemperatureHigh.ToString("0.00");
                    txtEnvTemperature.Text           = jsonTemperatureParam.info.EnvTemperature.ToString("0.00");
                    txtEnvTemperatureCheck.Text      = jsonTemperatureParam.info.EnvTemperatureCheck.ToString("0.00");
                    cbbFaceMaskTPTMode.SelectedIndex = jsonTemperatureParam.info.FaceMaskTPTMode;
                    cbbOpenLaser.SelectedIndex       = jsonTemperatureParam.info.OpenLaser;

                    SaveParam();
                }
                else
                {
                    Pub.MessageBoxShow(btnGetTemperatureParam.Text + Pub.GetResText("", "FK_RUNERR_NON_CARRYOUT", ""), MessageBoxIcon.Information);
                }
            }
        }
Exemplo n.º 3
0
        private void btnGetNetParam_Click(object sender, EventArgs e)
        {
            string     param = "";
            frmSeaOprt frm   = new frmSeaOprt(this.Text, btnGetNetParam.Text, param, 6, null);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                param = frm.BodyParameter;
                if (param != "")
                {
                    Pub.MessageBoxShow(btnGetNetParam.Text + Pub.GetResText("", "FK_RUN_SUCCESS", ""), MessageBoxIcon.Information);
                    jsonBody <NetParam> jsonDoorCondition = JsonConvert.DeserializeObject <jsonBody <NetParam> >(param);
                    txtIPAddr.Text     = jsonDoorCondition.info.IPAddr;
                    txtSubmask.Text    = jsonDoorCondition.info.Submask;
                    txtGateway.Text    = jsonDoorCondition.info.Gateway;
                    txtListenPort.Text = jsonDoorCondition.info.ListenPort.ToString();
                    txtWebPort.Text    = jsonDoorCondition.info.WebPort.ToString();

                    SaveParam();
                }
                else
                {
                    Pub.MessageBoxShow(btnGetNetParam.Text + Pub.GetResText("", "FK_RUNERR_NON_CARRYOUT", ""), MessageBoxIcon.Information);
                }
            }
        }
Exemplo n.º 4
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (txtMacSeriesUserName.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), lbUserName.Text), MessageBoxIcon.Error);
                txtMacSeriesUserName.Focus();
                return;
            }

            if (txtPwd1.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label1.Text), MessageBoxIcon.Error);
                txtPwd1.Focus();
                return;
            }
            if (txtPwd2.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label2.Text), MessageBoxIcon.Error);
                txtPwd2.Focus();
                return;
            }
            if (txtPwd2.Text != txtPwd1.Text)
            {
                Pub.MessageBoxShow(Pub.GetResText(formCode, "Error001", ""), MessageBoxIcon.Error);
                txtPwd2.Focus();
                return;
            }

            frmSeaOprt frm = new frmSeaOprt(this.Text, Pub.GetResText(formCode, "SetPwd", ""), txtMacSeriesUserName.Text + ":" + txtPwd2.Text, 4, null);

            frm.ShowDialog();
        }
Exemplo n.º 5
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(cbbVerifyMode.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText(formCode, "ErrorSelectCorrect", ""), label4.Text), MessageBoxIcon.Error);
                return;
            }
            if (string.IsNullOrEmpty(cbbControlType.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText(formCode, "ErrorSelectCorrect", ""), label5.Text), MessageBoxIcon.Error);
                return;
            }
            if (string.IsNullOrEmpty(txtPublicMjCardNo.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText(formCode, "ErrorEnterCorrect", ""), label7.Text), MessageBoxIcon.Error);
                txtPublicMjCardNo.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtAutoMjCardBgnNo.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText(formCode, "ErrorEnterCorrect", ""), label8.Text), MessageBoxIcon.Error);
                txtAutoMjCardBgnNo.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtAutoMjCardEndNo.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText(formCode, "ErrorEnterCorrect", ""), label9.Text), MessageBoxIcon.Error);
                txtAutoMjCardEndNo.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtIOStayTime.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText(formCode, "ErrorEnterCorrect", ""), label10.Text), MessageBoxIcon.Error);
                txtIOStayTime.Focus();
                return;
            }
            int FaceThreshold   = cbbFaceThreshold.SelectedIndex + 50;
            int IDCardThreshold = cbbIDCardThreshold.SelectedIndex + 50;
            int OpendoorWay     = cbbOpendoorWay.SelectedIndex;

            int  VerifyMode      = ((VerifyModeType)cbbVerifyMode.SelectedItem).id;
            int  ControlType     = cbbControlType.SelectedIndex;
            int  Wiegand         = cbbWiegand.SelectedIndex;
            uint PublicMjCardNo  = Convert.ToUInt32(txtPublicMjCardNo.Text);
            uint AutoMjCardBgnNo = Convert.ToUInt32(txtAutoMjCardBgnNo.Text);
            uint AutoMjCardEndNo = Convert.ToUInt32(txtAutoMjCardEndNo.Text);
            int  IOStayTime      = Convert.ToInt32(txtIOStayTime.Text);

            DoorCondition doorCondition = new DoorCondition(FaceThreshold, IDCardThreshold, OpendoorWay, VerifyMode, ControlType, Wiegand, PublicMjCardNo,
                                                            AutoMjCardBgnNo, AutoMjCardEndNo, IOStayTime);
            jsonBody <DoorCondition> jsonDoorCondition = new jsonBody <DoorCondition>("SetDoorCondition", doorCondition);
            string jsonString = JsonConvert.SerializeObject(jsonDoorCondition);

            frmSeaOprt frm = new frmSeaOprt(this.Text, btnOk.Text, jsonString, 2, null);

            frm.ShowDialog();

            SaveParam();
        }
Exemplo n.º 6
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!IsIpAddr(txtIPAddr.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label1.Text), MessageBoxIcon.Error);
                txtIPAddr.Focus();
                return;
            }
            if (!IsIpAddr(txtSubmask.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label2.Text), MessageBoxIcon.Error);
                txtSubmask.Focus();
                return;
            }
            if (!IsIpAddr(txtGateway.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label3.Text), MessageBoxIcon.Error);
                txtGateway.Focus();
                return;
            }
            if (txtListenPort.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label4.Text), MessageBoxIcon.Error);
                txtSubmask.Focus();
                return;
            }
            if (txtWebPort.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label5.Text), MessageBoxIcon.Error);
                txtWebPort.Focus();
                return;
            }

            string IPAddr     = txtIPAddr.Text;
            string Submask    = txtSubmask.Text;
            string Gateway    = txtGateway.Text;
            int    ListenPort = Convert.ToInt32(txtListenPort.Text);
            int    WebPort    = Convert.ToInt32(txtWebPort.Text);

            NetParam            netParam = new NetParam(IPAddr, Submask, Gateway, ListenPort, WebPort);
            jsonBody <NetParam> jsonBody = new jsonBody <NetParam>("SetNetParam", netParam);
            string     jsonString        = JsonConvert.SerializeObject(jsonBody);
            frmSeaOprt frm = new frmSeaOprt(this.Text, btnOk.Text, jsonString, 5, null);

            frm.ShowDialog();

            SaveParam();
        }
Exemplo n.º 7
0
        private void btnGetSetSound_Click(object sender, EventArgs e)
        {
            try
            {
                string     param = "";
                frmSeaOprt frm   = new frmSeaOprt(this.Text, btnGetSetSound.Text, param, 10, null);

                if (frm.ShowDialog() == DialogResult.OK)
                {
                    param = frm.BodyParameter;
                    if (param != "")
                    {
                        Pub.MessageBoxShow(btnGetSetSound.Text + Pub.GetResText("", "FK_RUN_SUCCESS", ""), MessageBoxIcon.Information);
                        jsonBody <SetSound> jsonDoorCondition = JsonConvert.DeserializeObject <jsonBody <SetSound> >(param);

                        chkVerifyFailAudio.Checked    = Convert.ToBoolean(jsonDoorCondition.info.VerifyFailAudio);
                        chkVerifySuccAudio.Checked    = Convert.ToBoolean(jsonDoorCondition.info.VerifySuccAudio);
                        chkRemoteCtrlAudio.Checked    = Convert.ToBoolean(jsonDoorCondition.info.RemoteCtrlAudio);
                        chkVerifySuccGuiTip.Checked   = Convert.ToBoolean(jsonDoorCondition.info.VerifySuccGuiTip);
                        chkUnregisteredGuiTip.Checked = Convert.ToBoolean(jsonDoorCondition.info.UnregisteredGuiTip);
                        chkVerifyFailGuiTip.Checked   = Convert.ToBoolean(jsonDoorCondition.info.VerifyFailGuiTip);
                        cbbVolume.Text           = jsonDoorCondition.info.Volume.ToString();
                        chkIPHide.Checked        = Convert.ToBoolean(jsonDoorCondition.info.IPHide);
                        chkIsShowName.Checked    = Convert.ToBoolean(jsonDoorCondition.info.IsShowName);
                        chkIsShowTitle.Checked   = Convert.ToBoolean(jsonDoorCondition.info.IsShowTitle);
                        chkIsShowVersion.Checked = Convert.ToBoolean(jsonDoorCondition.info.IsShowVersion);
                        chkIsShowDate.Checked    = Convert.ToBoolean(jsonDoorCondition.info.IsShowDate);
                        chkIDCardNumHide.Checked = Convert.ToBoolean(jsonDoorCondition.info.IDCardNumHide);
                        chkICCardNumHide.Checked = Convert.ToBoolean(jsonDoorCondition.info.ICCardNumHide);


                        SaveParam();
                    }
                    else
                    {
                        Pub.MessageBoxShow(btnGetSetSound.Text + Pub.GetResText("", "FK_RUNERR_NON_CARRYOUT", ""), MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception E)
            {
                Pub.ShowErrorMsg(E);
            }
        }
Exemplo n.º 8
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtTemperatureCheck.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), lbTemperatureCheck.Text), MessageBoxIcon.Error);
                txtTemperatureCheck.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtTemperatureHigh.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), lbTemperatureHigh.Text), MessageBoxIcon.Error);
                txtTemperatureHigh.Focus();
                return;
            }
            if (txtEnvTemperature.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), lbEnvTemperature.Text), MessageBoxIcon.Error);
                txtTemperatureCheck.Focus();
                return;
            }
            if (txtEnvTemperatureCheck.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), lbEnvTemperatureCheck.Text), MessageBoxIcon.Error);
                txtEnvTemperatureCheck.Focus();
                return;
            }
            int    FaceMaskTPTMode     = ((TemperatureType)cbbFaceMaskTPTMode.SelectedItem).id;
            double TemperatureCheck    = Math.Round(Convert.ToDouble(txtTemperatureCheck.Text), 2);
            double TemperatureHigh     = Math.Round(Convert.ToDouble(txtTemperatureHigh.Text), 2);
            double EnvTemperature      = Math.Round(Convert.ToDouble(txtEnvTemperature.Text), 2);
            double EnvTemperatureCheck = Math.Round(Convert.ToDouble(txtEnvTemperatureCheck.Text), 2);
            int    OpenLaser           = cbbOpenLaser.SelectedIndex;


            TemperatureParam            temperatureParam = new TemperatureParam(111111, FaceMaskTPTMode, TemperatureCheck, TemperatureHigh, EnvTemperature, EnvTemperatureCheck, OpenLaser);
            jsonBody <TemperatureParam> jsonBody         = new jsonBody <TemperatureParam>("SetTemperature", temperatureParam);
            string     jsonString = JsonConvert.SerializeObject(jsonBody);
            frmSeaOprt frm        = new frmSeaOprt(this.Text, btnOk.Text, jsonString, 14, null);

            frm.ShowDialog();

            SaveParam();
        }
Exemplo n.º 9
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (txtIP.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label1.Text), MessageBoxIcon.Error);
                txtIP.Focus();
                return;
            }
            if (txtPort.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label2.Text), MessageBoxIcon.Error);
                txtPort.Focus();
                return;
            }

            frmSeaOprt frm = new frmSeaOprt(this.Text, Pub.GetResText(formCode, "MsgNet", ""), "http://" + txtIP.Text + ":" + txtPort.Text, 1, null);

            frm.ShowDialog();
        }
Exemplo n.º 10
0
        private void btnGetParam_Click(object sender, EventArgs e)
        {
            string     param = "";
            frmSeaOprt frm   = new frmSeaOprt(this.Text, btnGetParam.Text, param, 3, null);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                param = frm.BodyParameter;
                if (param != "")
                {
                    Pub.MessageBoxShow(btnGetParam.Text + Pub.GetResText("", "FK_RUN_SUCCESS", ""), MessageBoxIcon.Information);
                    jsonBody <DoorCondition> jsonDoorCondition = JsonConvert.DeserializeObject <jsonBody <DoorCondition> >(param);
                    cbbFaceThreshold.SelectedIndex   = jsonDoorCondition.info.FaceThreshold - 50;
                    cbbIDCardThreshold.SelectedIndex = jsonDoorCondition.info.IDCardThreshold - 50;
                    cbbOpendoorWay.SelectedIndex     = jsonDoorCondition.info.OpendoorWay;
                    foreach (VerifyModeType verify in cbbVerifyMode.Items)
                    {
                        if (jsonDoorCondition.info.VerifyMode == verify.id)
                        {
                            cbbVerifyMode.SelectedItem = verify;
                            break;
                        }
                    }

                    cbbWiegand.SelectedIndex     = jsonDoorCondition.info.Wiegand;
                    cbbControlType.SelectedIndex = jsonDoorCondition.info.ControlType;
                    txtPublicMjCardNo.Text       = jsonDoorCondition.info.PublicMjCardNo.ToString();
                    txtAutoMjCardBgnNo.Text      = jsonDoorCondition.info.AutoMjCardBgnNo.ToString();
                    txtAutoMjCardEndNo.Text      = jsonDoorCondition.info.AutoMjCardEndNo.ToString();
                    txtIOStayTime.Text           = jsonDoorCondition.info.IOStayTime.ToString();

                    SaveParam();
                }
                else
                {
                    Pub.MessageBoxShow(btnGetParam.Text + Pub.GetResText("", "FK_RUNERR_NON_CARRYOUT", ""), MessageBoxIcon.Information);
                }
            }
        }
Exemplo n.º 11
0
        private void ShowSeaDoorOpen()
        {
            frmSeaOprt frm = new frmSeaOprt("", "", "", 0, null);

            frm.ShowDialog();
        }