コード例 #1
0
ファイル: DiakontViewModel.cs プロジェクト: baldmanx/Diakont2
        public void RDatesSource()
        {
            switch (RDSelected_dep_index)
            {
            case (int)DIndex.kb:
            {
                String_dates.Clear();
                RString_dates.Clear();
                context = new DiakontEntities();
                context.Departments.Load();

                foreach (Departments d in context.Departments)
                {
                    if (d.department_name == "КБ" && d.workers_amount != null)
                    {
                        String_dates.Add(d.jd_from.ToString());
                        RString_dates.Add(d.date_to.ToString());
                    }
                }

                if (RString_dates.LongCount() > 0)
                {
                    RSelected_jdate = RString_dates[0];
                }
                break;
            }

            case (int)DIndex.to:
            {
                String_dates.Clear();
                RString_dates.Clear();
                context = new DiakontEntities();
                context.Departments.Load();

                foreach (Departments d in context.Departments)
                {
                    if (d.department_name == "ТО" && d.workers_amount != null)
                    {
                        String_dates.Add(d.jd_from.ToString());
                        RString_dates.Add(d.date_to.ToString());
                    }
                }

                RSelected_jdate = RString_dates[0];
                break;
            }
            }
            NotifyPropertyChanged(nameof(String_dates));
            NotifyPropertyChanged(nameof(RString_dates));
            NotifyPropertyChanged(nameof(RSelected_jdate));
        }
コード例 #2
0
ファイル: DiakontViewModel.cs プロジェクト: baldmanx/Diakont2
        public void DatesSource()
        {
            switch (DSelected_job_index)
            {
            case (int)JIndex.ik:
            {
                String_dates.Clear();
                context = new DiakontEntities();
                context.Jobs.Load();

                foreach (Jobs j in context.Jobs)
                {
                    if (j.job_name == "Инженер-конструктор" && j.fee != null)
                    {
                        String_dates.Add(j.jdate_from.ToString());
                    }
                }
                if (String_dates.LongCount() > 0)
                {
                    Selected_jdate  = String_dates[0];
                    RSelected_jdate = String_dates[0];
                }
                break;
            }

            case (int)JIndex.it:
            {
                String_dates.Clear();
                context = new DiakontEntities();
                context.Jobs.Load();

                foreach (Jobs j in context.Jobs)
                {
                    if (j.job_name == "Инженер-технолог" && j.fee != null)
                    {
                        String_dates.Add(j.jdate_from.ToString());
                    }
                }
                Selected_jdate  = String_dates[0];
                RSelected_jdate = String_dates[0];
                break;
            }
            }
            NotifyPropertyChanged(nameof(String_dates));
            NotifyPropertyChanged(nameof(Selected_jdate));
            NotifyPropertyChanged(nameof(RSelected_jdate));
        }