private void connectToServer() { string ID = "ID#" + ID_Box.Text + ": "; //need to change how I hadle ID Client_model cm = new Client_model(); Form1 sendMesForm = new Form1("ID#" + ID_Box.Text + ": ", cm); ID_Box.Clear(); sendMesForm.ShowDialog(); }
private void login_btn_Click(object sender, EventArgs e) { if (!ID_Box.Text.Equals("") && !PW_Box.Text.Equals("")) { string loginResult = loginReceive.loginReveiveToServer("userLogin", ID_Box.Text, PW_Box.Text); if (loginResult.Equals("true")) { loginStausLabel.Text = ""; UserInfo.userId = ID_Box.Text; UserIP = UserGetIP.GetLocalIP(); UserInfo.userIP = UserIP; contextmenustripform.IconVisiblefalse(); loginformCheck = false; Mainform mainform = new Mainform(contextmenustripform); mainform.Show(); ID_Box.Clear(); PW_Box.Clear(); ID_Box.Focus(); this.Hide(); //서버로 로그인 id에 맞는 값을 받아와야 함. } else { //MessageBox.Show("ID 혹은 PW가 일치하지 않습니다.", "로그인실패", MessageBoxButtons.OK, MessageBoxIcon.Error); loginStausLabel.Text = "ID 또는 PW가 일치하지 않습니다."; loginStausLabel.ForeColor = Color.Red; ID_Box.Clear(); //PW_Box.Clear(); PW_Box.Text = "Password"; PW_Box.ForeColor = Color.Gray; PW_Box.PasswordChar = '\0'; login_btn.BackColor = Color.White; login_btn.ForeColor = Color.Gray; login_btn.Enabled = false; ID_Box.Focus(); } } else { loginStausLabel.Text = "ID 또는 PW를 적어주세요."; loginStausLabel.ForeColor = Color.Red; ID_Box.Focus(); //MessageBox.Show("ID 혹은 PW를 적어주세요.", "로그인실패", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ID_Box_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) { if (!PW_Box.Text.Equals("") && !(PW_Box.Text.Equals("Password") && PW_Box.ForeColor == Color.Gray)) { string loginCheck = loginReceive.loginReveiveToServer("userLogin", ID_Box.Text, PW_Box.Text); if (loginCheck.Equals("true")) { loginStausLabel.Text = ""; UserInfo.userId = ID_Box.Text; UserIP = UserGetIP.GetLocalIP(); UserInfo.userIP = UserIP; contextmenustripform.IconVisiblefalse(); loginformCheck = false; Mainform mainform = new Mainform(contextmenustripform); mainform.Show(); ID_Box.Clear(); PW_Box.Clear(); ID_Box.Focus(); this.Hide(); } else { loginStausLabel.Text = "ID 또는 PW가 일치하지 않습니다."; loginStausLabel.ForeColor = Color.Red; ID_Box.Clear(); //PW_Box.Clear(); PW_Box.Text = "Password"; PW_Box.ForeColor = Color.Gray; PW_Box.PasswordChar = '\0'; login_btn.BackColor = Color.White; login_btn.ForeColor = Color.Gray; login_btn.Enabled = false; ID_Box.Focus(); } } else { PW_Box.Focus(); } } }
private void UsunButton_Click(object sender, EventArgs e) { if (ValidateForm()) { DataAccess db = new DataAccess(); UsunModel usunModel = new UsunModel(ID_Box.Text); // wykonuje procedure usuniecia towaru if (db.UsunTowar(usunModel.ID_Towaru)) { MessageBox.Show("Usunięto towar"); } else { MessageBox.Show("Nie ma Towaru o podanym ID, bądz istnieje na ten towar zamówienie."); } // czysci pole ID ID_Box.Clear(); } }
private void ClearInnerFields() { ID_Box.Clear(); IloscInnerBox.Clear(); }