//서버에 저장된 Off 목록을 가지고 온다. public virtual List <Off> getOffList() { string message = "CALLOFFLIST|"; SendMessage(message); while (messageReturned == null) { ; } if (messageReturned.Equals("FAIL")) { MessageBox.Show("잘못 입력하셨습니다!"); messageReturned = null; return(null); } string[] msgArray = messageReturned.Split('|'); List <Off> result = new List <Off>(); for (int i = 0; i < msgArray.Length; i++) { Off newOff = new Off(msgArray[i]); result.Add(newOff); } messageReturned = null; return(result); }
// 추가 버튼 private void btnAdd_Click(object sender, EventArgs e) { if (radiobuttonSelected) { DateTime date = monthCalendar1.SelectionStart; for (int i = 0; i < lboxHoliday.Items.Count; i++) { if (((Off)lboxHoliday.Items[i]).Date.Equals(date)) { MessageBox.Show("이미 선택한 날짜입니다!"); return; } } Off newOff = new Off(date, selectedRadioButton, currentUserID); lboxHoliday.Items.Add(newOff); } }