초기 커밋.

This commit is contained in:
chainsecure
2026-05-28 14:48:48 +09:00
parent 377498fae8
commit 5d6ee943f6
31 changed files with 3182 additions and 0 deletions

57
ControlServer/Form3.cs Normal file
View File

@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace ControlServer
{
public partial class Form3 : Form
{
public Form3(string terminalName, string terminalIP) // 매개변수 추가
{
InitializeComponent();
// 가져온 데이터를 Form3의 라벨이나 텍스트박스에 표시
lblTerminalName.Text = terminalName;
lblTerminalIP.Text = terminalIP;
txtBoxOnYY.TextChanged += ValidateInputs;
txtBoxOnMM.TextChanged += ValidateInputs;
txtBoxOffYY.TextChanged += ValidateInputs;
txtBoxOffMM.TextChanged += ValidateInputs;
txtBoxOnYY.PlaceholderText = "YY";
txtBoxOnMM.PlaceholderText = "MM";
txtBoxOffYY.PlaceholderText = "YY";
txtBoxOffMM.PlaceholderText = "MM";
}
private void ValidateInputs(object? sender, EventArgs e)
{
// 프로그램 시간 조건 체크
bool isOnYYEmpty = string.IsNullOrWhiteSpace(txtBoxOnYY.Text);
bool isOnMMEmpty = string.IsNullOrWhiteSpace(txtBoxOnMM.Text);
bool isOffYYEmpty = string.IsNullOrWhiteSpace(txtBoxOffYY.Text);
bool isOffMMEmpty = string.IsNullOrWhiteSpace(@txtBoxOffMM.Text);
// 둘 다 비어있거나(AND), 둘 다 비어있지 않거나(AND)
bool isTimeValid = (isOnYYEmpty && isOnMMEmpty && isOffYYEmpty && isOffMMEmpty) || (!isOnYYEmpty && !isOnMMEmpty && !isOffYYEmpty && !isOffMMEmpty);
// 저장 버튼 활성화
btnUpdate.Enabled = isTimeValid;
}
private void btnCancel_MouseClick(object sender, MouseEventArgs e)
{
this.Close();
}
private void btnUpdate_MouseClick(object sender, MouseEventArgs e)
{
// 수정
// 수정 시 DB 저장
}
}
}