void UpdatecbProgram() { Proc = CppLib.GetProcessList(); cbProgram.Items.Clear(); cbCommand.SelectedIndex = -1; int OldCount = Proc.Count; for (int i = 0; i < OldCount; i++) { cbProgram.Items.Add(Proc[i].Name); for (int j = 0; j < options.ChildWindows.Count; j++) { IntPtr handle; if ((handle = CppLib.GetChildWindowHandle(options.ChildWindows[j], Proc[i].Handle)) != IntPtr.Zero) { CppLib.Rect rect = new CppLib.Rect(); CppLib.GetWindowRect(handle, ref rect); /*Запомнить на будущее*/ //Proc.Add(new CppLib.ProcessInfo { Handle = handle, Name = options.ChildWindows[j] + " от " + Proc[i].Name, Border = rect }); //cbProgram.Items.Add(options.ChildWindows[j] + " от " + Proc[i].Name); Proc.Add(new CppLib.ProcessInfo { Handle = handle, Name = options.ChildWindows[j], Border = rect }); cbProgram.Items.Add(options.ChildWindows[j]); } } } cbProgram.Items.Add("Системные команды"); cbProgram.SelectedIndex = cbProgram.Items.Count - 1; }
private void NewProc_Click(object sender, EventArgs e) { //MessageBox.Show(DateTime.Parse(DayBox.SelectedItem.ToString()).Year.ToString()); //MessageBox.Show(DateTime.Parse(DayBox.SelectedItem.ToString()).Month.ToString()); //MessageBox.Show(DateTime.Parse(DayBox.SelectedItem.ToString()).Day.ToString()); DateTime day = new DateTime(DateTime.Parse(DayBox.SelectedItem.ToString()).Year, DateTime.Parse(DayBox.SelectedItem.ToString()).Month, DateTime.Parse(DayBox.SelectedItem.ToString()).Day); DateTime time = new DateTime(1, 1, 1, TimeSpan.Parse(TimeBox.SelectedItem.ToString()).Hours, TimeSpan.Parse(TimeBox.SelectedItem.ToString()).Minutes, TimeSpan.Parse(TimeBox.SelectedItem.ToString()).Seconds); //MessageBox.Show(day.ToString()); //MessageBox.Show(time.ToString()); ProcModel procmodel = new ProcModel(); FreeTimeModel freetimemodel = new FreeTimeModel(); freetimemodel.Day = day; freetimemodel.Time = time; freetimemodel.Personal_Id = usercollection[DoctorBox.SelectedIndex].Id; freetimemodel.Id = freetime.Get_Item(freetimemodel.Day, freetimemodel.Time, freetimemodel.Personal_Id).Id; procmodel.Client_Id = Id; procmodel.Personal_Id = usercollection[DoctorBox.SelectedIndex].Id; procmodel.Proc_Type_Id = proctype.Get_Item("Name", ProcTypeBox.SelectedItem.ToString(), ConditionType.Equal).Id; procmodel.Date_Id = date.SwapFreeTime(freetimemodel); //MessageBox.Show(procmodel.ToString()); proc.Add(procmodel); MessageBox.Show("Сохранено"); back.Show(); this.Close(); }