private void buttonSave_Click(object sender, EventArgs e)
        {
            int index = listBox1.SelectedIndex; //선택된 간호사의 index

            Nurse newInfo = list[index];

            if (comboBox1.SelectedIndex == 0)
            {
                newInfo.Group = GROUP.Group1;
            }
            else if (comboBox1.SelectedIndex == 1)
            {
                newInfo.Group = GROUP.Group2;
            }
            else if (comboBox1.SelectedIndex == 2)
            {
                newInfo.Group = GROUP.Group3;
            }

            newInfo.Password = textBoxPW.Text;
            newInfo.PhoneNum = textBoxPhNum.Text;

            bool result = clientsocket.modifyNurse(newInfo.ID, newInfo, list);

            if (!result)
            {
                MessageBox.Show("변경 실패");
            }
            else
            {
                MessageBox.Show("변경 완료");
                loadNurse();
            }
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            List <Nurse> nurseList = clientSocket.getNurseList();

            if (!textBoxPW.Text.Equals(textBoxPW2.Text))
            {
                MessageBox.Show("비밀번호가 일치하지 않습니다.");
            }
            else
            {
                textBoxPW.Text.Replace(',', ' ');//,를 지운다.
                target.Password = textBoxPW.Text;
                bool result = clientSocket.modifyNurse(target.ID, target, nurseList);
                if (result)
                {
                    MessageBox.Show("변경 완료");
                }
                else
                {
                    MessageBox.Show("변경 실패");
                }
            }
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            List <Nurse> nurseList = clientsocket.getNurseList();

            #region 비일번호 일치 검사
            if (!textBoxPW.Text.Equals(textBoxPW2.Text))     //비밀번호 일치 검사
            {
                MessageBox.Show("비밀번호가 일치하지 않습니다.");
                return;
            }
            #endregion
            #region 기존의 라이센스 검사
            List <Nurse> list = clientsocket.getNurseList();
            for (int i = 0; i < list.Count; i++)    //라이센스 번호 검사
            {
                if (textBoxLic.Text.Equals(list[i].LicenseNum) &&
                    !textBoxID.Text.Equals(list[i].ID))
                {
                    MessageBox.Show("라이센스 번호가 이미 존재합니다.");
                    return;
                }
            }
            #endregion
            //string 입력은 , << 제거 처리
            #region 정보 입력
            if (comboBoxType.SelectedIndex == 0)    //수간호사 선택
            {
                currentNurse.IsChiefNurse = true;
            }
            else
            {
                currentNurse.IsChiefNurse = false;
            }

            currentNurse.Name = textBoxName.Text;

            currentNurse.Password = textBoxPW.Text;
            if (comboBoxSex.SelectedIndex == 0)
            {
                currentNurse.Sex = SEX.Male;
            }
            else
            {
                currentNurse.Sex = SEX.Female;
            }
            currentNurse.LicenseNum = textBoxLic.Text;
            currentNurse.PhoneNum   = textBoxPh.Text;
            #endregion
            #region 서버에 저장
            bool result = clientsocket.modifyNurse(currentNurse.ID, currentNurse, nurseList);
            if (result)
            {
                MessageBox.Show("수정완료");
            }
            else
            {
                MessageBox.Show("수정실패");
            }
            #endregion
            this.Close();
        }