private void RelateToToDo_Load(object sender, EventArgs e) { comboBoxSearchProject.SelectedIndexChanged -= comboBoxSearchProject_SelectedIndexChanged; comboBoxSearchBranch.SelectedIndexChanged -= comboBoxSearchBranch_SelectedIndexChanged; CommonFunc.BindProjectListToComboBox(comboBoxSearchProject, null, true); if (relatedProjectID != CommonData.ItemNullValue) { comboBoxSearchProject.SelectedValue = relatedProjectID; } else if (CommonData.CurrentProject != null && CommonData.CurrentProject.ID != CommonData.ItemNullValue && CommonData.CurrentProject.ID != CommonData.ItemAllValue) { comboBoxSearchProject.SelectedValue = CommonData.CurrentProject.ID; } CommonFunc.BindBranchListToComboBox(comboBoxSearchBranch, null, true); if (relatedBranchID != CommonData.ItemNullValue) { comboBoxSearchBranch.SelectedValue = relatedBranchID; } else if (CommonData.CurrentBranch != null && CommonData.CurrentBranch.ID != CommonData.ItemNullValue && CommonData.CurrentBranch.ID != CommonData.ItemAllValue) { comboBoxSearchBranch.SelectedValue = CommonData.CurrentBranch.ID; } comboBoxSearchProject.SelectedIndexChanged += comboBoxSearchProject_SelectedIndexChanged; comboBoxSearchBranch.SelectedIndexChanged += comboBoxSearchBranch_SelectedIndexChanged; List <ToDoStatus> toDoList = CommonFunc.GetToDoStatusListForSearch(); toDoList.Add(CommonData.toDoStatusNotDone); CommonFunc.BindToDoStatusListToComboBox(comboBoxSearchStatus, toDoList, true); comboBoxSearchStatus.SelectedValue = EnumToDoStatus.Done; CommonFunc.GetWeekDateTime(ref weekStartTime, ref weekEndTime); dateTimePickerSearchFisnishTimeFrom.Value = weekStartTime; dateTimePickerSearchFinishTimeTo.Value = weekEndTime; dateTimePickerSearchFisnishTimeFrom.Checked = false; dateTimePickerSearchFinishTimeTo.Checked = false; CommonFunc.BindUserListToComboBox(comboBoxSearchFinishUser, null, true); if (CommonData.CurrentUser != null && CommonData.CurrentUser.ID != CommonData.ItemNullValue && CommonData.CurrentUser.ID != CommonData.ItemAllValue) { comboBoxSearchFinishUser.SelectedValue = CommonData.CurrentUser.ID; } }