private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox2.SelectedIndex < 0) { MessageBox.Show("Select User Email!!!!"); } else { string uEmail = comboBox2.SelectedItem.ToString(); UserSer userS = new UserSer(); int uID = userS.GetUserIdByEmail(uEmail); ShareTaskSer uS = new ShareTaskSer(); List <int> catIDList = uS.GetCategoryID(LogIn.user_ID, uID); //MessageBox.Show(catIDList.Count.ToString()); CategorySer cS; List <string> catNameList = new List <string>(); string catName; for (int i = 0; i < catIDList.Count; i++) { cS = new CategorySer(); //MessageBox.Show(catIDList[i].ToString()); catName = cS.GetCategoryName(catIDList[i], LogIn.user_ID); catNameList.Add(catName); } for (int i = 0; i < catNameList.Count; i++) { comboBox3.Items.Add(catNameList[i]); } } }
public void LoadDataInfoOfTask(Tasks obj) { button1.Text = "Update"; this.obj = obj; textBox1.Text = obj.Tittle; textBox2.Text = obj.Description; dateTimePicker2.Value = Convert.ToDateTime(obj.Date); dateTimePicker1.Value = Convert.ToDateTime(obj.Time); CategorySer cS = new CategorySer(); cBCategory.Text = cS.GetCategoryName(obj.Category_ID, LogIn.user_ID); if (obj.Priority == 1) { cBPriority.Text = "Low"; } else if (obj.Priority == 2) { cBPriority.Text = "Medium"; } else { cBPriority.Text = "High"; } if (obj.RepeatName == "") { cBRepeat.Text = "Doesn't Repeat"; } else { cBRepeat.Text = obj.RepeatName; } for (int i = 0; i < obj.Notify_Time_List.Count; i++) { cBSelectedReminders.Items.Add(obj.Notify_Time_List[i].NotifyTimeBeforeString); } }