ConfigurationForm - Add Event For btnCheckDoorDeviceControlAccessIP_Click
This commit is contained in:
parent
9400402141
commit
d97908a22b
21
AIParkingApplication/ConfigurationForm.Designer.cs
generated
21
AIParkingApplication/ConfigurationForm.Designer.cs
generated
|
@ -28,7 +28,7 @@
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.txtDoorDeviceControlAccessIPStatus = new System.Windows.Forms.Label();
|
this.lblDoorDeviceControlAccessIPStatus = new System.Windows.Forms.Label();
|
||||||
this.btnCheckDoorDeviceControlAccessIP = new System.Windows.Forms.Button();
|
this.btnCheckDoorDeviceControlAccessIP = new System.Windows.Forms.Button();
|
||||||
this.btnClose = new System.Windows.Forms.Button();
|
this.btnClose = new System.Windows.Forms.Button();
|
||||||
this.btnSaveSettings = new System.Windows.Forms.Button();
|
this.btnSaveSettings = new System.Windows.Forms.Button();
|
||||||
|
@ -50,14 +50,14 @@
|
||||||
this.statusStrip.SuspendLayout();
|
this.statusStrip.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// txtDoorDeviceControlAccessIPStatus
|
// lblDoorDeviceControlAccessIPStatus
|
||||||
//
|
//
|
||||||
this.txtDoorDeviceControlAccessIPStatus.AutoSize = true;
|
this.lblDoorDeviceControlAccessIPStatus.AutoSize = true;
|
||||||
this.txtDoorDeviceControlAccessIPStatus.Location = new System.Drawing.Point(412, 9);
|
this.lblDoorDeviceControlAccessIPStatus.Location = new System.Drawing.Point(412, 9);
|
||||||
this.txtDoorDeviceControlAccessIPStatus.Name = "txtDoorDeviceControlAccessIPStatus";
|
this.lblDoorDeviceControlAccessIPStatus.Name = "lblDoorDeviceControlAccessIPStatus";
|
||||||
this.txtDoorDeviceControlAccessIPStatus.Size = new System.Drawing.Size(58, 13);
|
this.lblDoorDeviceControlAccessIPStatus.Size = new System.Drawing.Size(58, 13);
|
||||||
this.txtDoorDeviceControlAccessIPStatus.TabIndex = 17;
|
this.lblDoorDeviceControlAccessIPStatus.TabIndex = 17;
|
||||||
this.txtDoorDeviceControlAccessIPStatus.Text = "Trạng thái:";
|
this.lblDoorDeviceControlAccessIPStatus.Text = "Trạng thái:";
|
||||||
//
|
//
|
||||||
// btnCheckDoorDeviceControlAccessIP
|
// btnCheckDoorDeviceControlAccessIP
|
||||||
//
|
//
|
||||||
|
@ -67,6 +67,7 @@
|
||||||
this.btnCheckDoorDeviceControlAccessIP.TabIndex = 2;
|
this.btnCheckDoorDeviceControlAccessIP.TabIndex = 2;
|
||||||
this.btnCheckDoorDeviceControlAccessIP.Text = "Kiểm tra";
|
this.btnCheckDoorDeviceControlAccessIP.Text = "Kiểm tra";
|
||||||
this.btnCheckDoorDeviceControlAccessIP.UseVisualStyleBackColor = true;
|
this.btnCheckDoorDeviceControlAccessIP.UseVisualStyleBackColor = true;
|
||||||
|
this.btnCheckDoorDeviceControlAccessIP.Click += new System.EventHandler(this.btnCheckDoorDeviceControlAccessIP_Click);
|
||||||
//
|
//
|
||||||
// btnClose
|
// btnClose
|
||||||
//
|
//
|
||||||
|
@ -233,7 +234,7 @@
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(646, 281);
|
this.ClientSize = new System.Drawing.Size(646, 281);
|
||||||
this.Controls.Add(this.statusStrip);
|
this.Controls.Add(this.statusStrip);
|
||||||
this.Controls.Add(this.txtDoorDeviceControlAccessIPStatus);
|
this.Controls.Add(this.lblDoorDeviceControlAccessIPStatus);
|
||||||
this.Controls.Add(this.btnCheckDoorDeviceControlAccessIP);
|
this.Controls.Add(this.btnCheckDoorDeviceControlAccessIP);
|
||||||
this.Controls.Add(this.btnClose);
|
this.Controls.Add(this.btnClose);
|
||||||
this.Controls.Add(this.btnSaveSettings);
|
this.Controls.Add(this.btnSaveSettings);
|
||||||
|
@ -266,7 +267,7 @@
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private System.Windows.Forms.Label txtDoorDeviceControlAccessIPStatus;
|
private System.Windows.Forms.Label lblDoorDeviceControlAccessIPStatus;
|
||||||
private System.Windows.Forms.Button btnCheckDoorDeviceControlAccessIP;
|
private System.Windows.Forms.Button btnCheckDoorDeviceControlAccessIP;
|
||||||
private System.Windows.Forms.Button btnClose;
|
private System.Windows.Forms.Button btnClose;
|
||||||
private System.Windows.Forms.Button btnSaveSettings;
|
private System.Windows.Forms.Button btnSaveSettings;
|
||||||
|
|
|
@ -29,6 +29,12 @@ namespace AIParkingApplication
|
||||||
|
|
||||||
private void btnSaveSettings_Click(object sender, EventArgs e)
|
private void btnSaveSettings_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
bool isValidIPAddress = Util.IsValidIPAddress(txtDoorDeviceControlAccessIP.Text);
|
||||||
|
if (!isValidIPAddress)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Nhập đúng IP thiết bị mở cửa!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
Util.UpsertAppSettings(AppConstant.DOOR_ACCESS_DEVICE_CONTROL_IP, txtDoorDeviceControlAccessIP.Text);
|
Util.UpsertAppSettings(AppConstant.DOOR_ACCESS_DEVICE_CONTROL_IP, txtDoorDeviceControlAccessIP.Text);
|
||||||
Util.UpsertAppSettings(AppConstant.AUTO_OPEN_DOOR_1, chkAllowAutoDoor1.Checked.ToString().ToLower());
|
Util.UpsertAppSettings(AppConstant.AUTO_OPEN_DOOR_1, chkAllowAutoDoor1.Checked.ToString().ToLower());
|
||||||
Util.UpsertAppSettings(AppConstant.AUTO_OPEN_DOOR_2, chkAllowAutoDoor2.Checked.ToString().ToLower());
|
Util.UpsertAppSettings(AppConstant.AUTO_OPEN_DOOR_2, chkAllowAutoDoor2.Checked.ToString().ToLower());
|
||||||
|
@ -84,5 +90,19 @@ namespace AIParkingApplication
|
||||||
return defaultValueIfReadFailed;
|
return defaultValueIfReadFailed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void btnCheckDoorDeviceControlAccessIP_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
lblDoorDeviceControlAccessIPStatus.Text = string.Empty;
|
||||||
|
bool isValidIPAddress = Util.IsValidIPAddress(txtDoorDeviceControlAccessIP.Text);
|
||||||
|
if (!isValidIPAddress)
|
||||||
|
{
|
||||||
|
lblDoorDeviceControlAccessIPStatus.Text = "Không đúng định dạng IP";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblDoorDeviceControlAccessIPStatus.Text = "OK";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user