Example #1
0
        private void TimeBox_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            ProcType.Visible = true;
            ProcTypeBox.Items.Clear();
            ProcTypeBox.Visible = true;
            List <ProcTypeModel> proctypecollection = new List <ProcTypeModel>();

            //MessageBox.Show(job.Get_Item("Name", JobBox.SelectedItem.ToString(), ConditionType.Equal).Id.ToString());

            FilterCondition filter = new FilterCondition();

            filter.Field = "Job_Id";
            filter.Value = job.Get_Item("Name", JobBox.SelectedItem.ToString(), ConditionType.Equal).Id;
            filter.Type  = ConditionType.Equal;
            List <FilterCondition> filt = new List <FilterCondition>();

            filt.Add(filter);

            proctypecollection = proctype.List(filt);
            ProcTypeBox.Items.Add(proctype.Get_Item("Id", "2", ConditionType.Equal).Name);
            foreach (ProcTypeModel P in proctypecollection)
            {
                ProcTypeBox.Items.Add(P.Name);
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            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 = Doctor_Id;
            freetimemodel.Id          = freetime.Get_Item(freetimemodel.Day, freetimemodel.Time, freetimemodel.Personal_Id).Id;
            procmodel.Client_Id       = Client_Id;
            procmodel.Personal_Id     = Doctor_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("Сохранено");
            proc.Delete(Proc_Id);
            back.back.Refresh_list();
            back.back.Show();
            back.Close();
            this.Close();
        }
Example #3
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            ProcTypeModel pmodel = new ProcTypeModel();

            if (0 != proctype.Get_Item("Name", ProcNameText.Text, ConditionType.Equal).Id)
            {
                MessageBox.Show("Такая процедура уже существует");
                ProcNameText.Clear();
            }
            else
            {
                ProcTypeModel model = new ProcTypeModel();
                model.Name   = ProcNameText.Text;
                model.Job_Id = job.Get_Item("Name", JobBox.SelectedItem.ToString(), ConditionType.Equal).Id;
                proctype.Add(model);
                MessageBox.Show("Запись внесена");
                ProcNameText.Clear();
            }
        }
        public void Refresh_list()
        {
            ListView.Items.Clear();

            ListView.FullRowSelect = true;
            ListView.GridLines     = true;

            List <DateModel> datecollection = date.List("Day", Program.Current_Date.Date);

            datecollection.Reverse();
            foreach (DateModel dateItem in datecollection)
            {
                FilterCondition filter1 = new FilterCondition();
                filter1.Field = "Personal_Id";
                filter1.Value = Current_Id;
                filter1.Type  = ConditionType.Equal;

                FilterCondition filter2 = new FilterCondition();
                filter2.Field = "Date_Id";
                filter2.Value = dateItem.Id.ToString();
                filter2.Type  = ConditionType.Equal;


                List <FilterCondition> filt = new List <FilterCondition>();
                filt.Add(filter1);
                filt.Add(filter2);



                List <ProcModel> collection = new List <ProcModel>();
                collection = proc.List(filt);

                foreach (var item in collection)
                {
                    ListViewItem Item = new ListViewItem(new string[]
                    {
                        date.Get_Item("Id", item.Date_Id.ToString(), ConditionType.Equal).Time.TimeOfDay.ToString(),
                        client.Get_Item("Id", item.Client_Id.ToString(), ConditionType.Equal).Name,
                        client.Get_Item("Id", item.Client_Id.ToString(), ConditionType.Equal).Surname,
                        client.Get_Item("Id", item.Client_Id.ToString(), ConditionType.Equal).Patronymic,
                        proctype.Get_Item("Id", item.Proc_Type_Id.ToString(), ConditionType.Equal).Name
                    });

                    /*Item.Text=i.ToString();
                     * Item.SubItems.Add(SubItem);
                     * SubItem.Text=item.Name;
                     * Item.SubItems.Add(SubItem);
                     * SubItem.Text=item.Surname;
                     * Item.SubItems.Add(SubItem);
                     * SubItem.Text=item.Patronymic;
                     * Item.SubItems.Add(SubItem);
                     * SubItem.Text=item.Job_Id.ToString();
                     * Item.SubItems.Add(SubItem);
                     * SubItem.Text = item.Login;
                     * Item.SubItems.Add(SubItem);
                     * SubItem.Text = item.Password;
                     * Item.SubItems.Add(SubItem);*/
                    ListView.Items.Add(Item);
                }
            }
        }