Exemplo n.º 1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (txtMacSeriesUserName.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), lbMacSeriesUserName.Text));
                txtMacSeriesUserName.Focus();
                return;
            }

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

            frmMJSeaSeriesOprt frm = new frmMJSeaSeriesOprt(this.Text, label1.Text, txtMacSeriesUserName.Text + ":" + txtPwd2.Text, 4, null);

            frm.ShowDialog();
        }
Exemplo n.º 2
0
        private void btnGetNetParam_Click(object sender, EventArgs e)
        {
            string             param = "";
            frmMJSeaSeriesOprt frm   = new frmMJSeaSeriesOprt(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", ""));
                    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", ""));
                }
            }
        }
Exemplo n.º 3
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (cbbVolume.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label1.Text));
                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);
            frmMJSeaSeriesOprt frm        = new frmMJSeaSeriesOprt(this.Text, btnOk.Text, jsonString, 9, null);

            frm.ShowDialog();
            SaveParam();
        }
Exemplo n.º 4
0
        private void btnGetNetParam_Click(object sender, EventArgs e)
        {
            string             param = "";
            frmMJSeaSeriesOprt frm   = new frmMJSeaSeriesOprt(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", ""));
                    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", ""));
                }
            }
        }
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));
                return;
            }
            if (string.IsNullOrEmpty(cbbControlType.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText(formCode, "ErrorSelectCorrect", ""), label5.Text));
                return;
            }
            if (string.IsNullOrEmpty(txtPublicMjCardNo.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText(formCode, "ErrorEnterCorrect", ""), label7.Text));
                txtPublicMjCardNo.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtAutoMjCardBgnNo.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText(formCode, "ErrorEnterCorrect", ""), label8.Text));
                txtAutoMjCardBgnNo.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtAutoMjCardEndNo.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText(formCode, "ErrorEnterCorrect", ""), label9.Text));
                txtAutoMjCardEndNo.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtIOStayTime.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText(formCode, "ErrorEnterCorrect", ""), label10.Text));
                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);

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

            frm.ShowDialog();

            SaveParam();
        }
Exemplo n.º 6
0
        private void btnClearSnapshotsLog_Click(object sender, EventArgs e)
        {
            frmMJSeaSeriesOprt frm = new frmMJSeaSeriesOprt(btnClearSnapshotsLog.Text, btnClearSnapshotsLog.Text, "", 12, null);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                ExecItemRefresh();
            }
        }
Exemplo n.º 7
0
        private void btnGetSnapshotsLog_Click(object sender, EventArgs e)
        {
            string             startTime = dtpStart.Value.ToString(SystemInfo.SQLDateFMT);
            string             endTime   = dtpEnd.Value.ToString(SystemInfo.SQLDateFMT);
            frmMJSeaSeriesOprt frm       = new frmMJSeaSeriesOprt(btnGetSnapshotsLog.Text, btnGetSnapshotsLog.Text, startTime + "@" + endTime, 13, null);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                ExecItemRefresh();
            }
        }
Exemplo n.º 8
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!IsIpAddr(txtIPAddr.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label1.Text));
                txtIPAddr.Focus();
                return;
            }
            if (!IsIpAddr(txtSubmask.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label2.Text));
                txtSubmask.Focus();
                return;
            }
            if (!IsIpAddr(txtGateway.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label3.Text));
                txtGateway.Focus();
                return;
            }
            if (txtListenPort.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label4.Text));
                txtSubmask.Focus();
                return;
            }
            if (txtWebPort.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), label5.Text));
                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);
            frmMJSeaSeriesOprt frm        = new frmMJSeaSeriesOprt(this.Text, btnOk.Text, jsonString, 5, null);

            frm.ShowDialog();

            SaveParam();
        }
Exemplo n.º 9
0
        private void btnGetSetSound_Click(object sender, EventArgs e)
        {
            string sql = Pub.GetSQL(DBCode.DB_000500, new string[] { "2" });

            try
            {
                string             param = "";
                frmMJSeaSeriesOprt frm   = new frmMJSeaSeriesOprt(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", ""));
                        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", ""));
                    }
                }
            }
            catch (Exception E)
            {
                Pub.ShowErrorMsg(E);
            }
        }
Exemplo n.º 10
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtTemperatureCheck.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), lbTemperatureCheck.Text));
                txtTemperatureCheck.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtTemperatureHigh.Text))
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), lbTemperatureHigh.Text));
                txtTemperatureHigh.Focus();
                return;
            }
            if (txtEnvTemperature.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), lbEnvTemperature.Text));
                txtTemperatureCheck.Focus();
                return;
            }
            if (txtEnvTemperatureCheck.Text == "")
            {
                Pub.MessageBoxShow(string.Format(Pub.GetResText("", "ErrorEnterCorrect", ""), lbEnvTemperatureCheck.Text));
                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);
            frmMJSeaSeriesOprt frm        = new frmMJSeaSeriesOprt(this.Text, btnOk.Text, jsonString, 14, null);

            frm.ShowDialog();

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

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

            frm.ShowDialog();
        }
Exemplo n.º 12
0
        private void btnGetParam_Click(object sender, EventArgs e)
        {
            string             param = "";
            frmMJSeaSeriesOprt frm   = new frmMJSeaSeriesOprt(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", ""));
                    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", ""));
                }
            }
        }
Exemplo n.º 13
0
        private void ShowMJSeaRebootDevice()
        {
            frmMJSeaSeriesOprt frm = new frmMJSeaSeriesOprt("", "", "", 11, null);

            frm.ShowDialog();
        }
Exemplo n.º 14
0
        private void ShowMJSeaSeriesOprt()
        {
            frmMJSeaSeriesOprt frm = new frmMJSeaSeriesOprt("", "", "", 0, null);

            frm.ShowDialog();
        }