Example #1
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);
                }
            }
        }
Example #2
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();
        }
Example #3
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);
                }
            }
        }
        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();
        }
Example #5
0
        public void SaveCardLog(string LogStr)
        {
            jsonBody <CardVerify> verifyPush = JsonConvert.DeserializeObject <jsonBody <CardVerify> >(LogStr);

            byte[] PhotoImage = null;
            int    InOutMode  = 0;
            string GUID       = "";

            MacSN         = verifyPush.info.DeviceID.ToString();
            attLog.Remark = verifyPush.info.CardNo;
            UInt32 FingerNo = 0;

            attLog          = new TSeaLog();
            attLog.CardID   = FingerNo.ToString("0000000000");
            attLog.CardTime = DateTime.Parse(verifyPush.info.CreateTime);
            attLog.FingerNo = FingerNo;
            if (!db.IsOpen)
            {
                db.Open(SystemInfo.ConnStr);
            }
            DataTableReader dr = db.GetDataReader("SELECT * FROM VSEA_MacInfoFace WHERE MacSN='" + MacSN + "'");

            if (dr.Read())
            {
                int.TryParse(dr["MacInOut"].ToString(), out InOutMode);
            }
            dr.Close();
            attLog.InOutMode = InOutMode;

            readData.Sea_SetLogName(attLog, InOutMode, 1, 21);

            readData.WriteTextFile(attLog, Int32.Parse(MacSN), true);
            if (textFormat.Allow)
            {
                readData.WriteTextFormat(db, textFormat, attLog, Int32.Parse(MacSN), true);
            }
            readData.SeaSaveDB(db, attLog, Int32.Parse(MacSN), FingerNo, PhotoImage);

            if (attLog.VerifyMode == 0)
            {
                attLog.VerifyMode     = attLog.DoorMode;
                attLog.VerifyModeName = attLog.DoorModeName;
            }

            readData.SeaSaveDBMJ(db, attLog, MacSN.ToString(), PhotoImage, ref GUID);
            if (prog != null)
            {
                prog(attLog, Int32.Parse(MacSN), GUID);
            }
        }
Example #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();
        }
Example #7
0
        protected bool SyncTime(string url, string name, string pwd)
        {
            bool     ret      = false;
            DateTime dt       = new DateTime();
            string   syncTime = "";

            if (db.GetServerDate(ref dt))
            {
                url = url + "action/SetSysTime";
                SeaSeriesSyncTime            seaSeriesSyncTime = new SeaSeriesSyncTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second);
                jsonBody <SeaSeriesSyncTime> jsonBody          = new jsonBody <SeaSeriesSyncTime>("SetSysTime", seaSeriesSyncTime);
                syncTime = JsonConvert.SerializeObject(jsonBody);
                ret      = DeviceObject.objFK623.POST_GetResponse(url, name, pwd, ref syncTime);
            }

            return(ret);
        }
Example #8
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);
            }
        }
Example #9
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();
        }
        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);
                }
            }
        }