Esempio n. 1
0
 public Form1()
 {
     db = new WorkerContext();
     InitializeComponent();
     db.Peoples.Load();
     dataGridView1.DataSource = db.Peoples.Local.ToBindingList();
 }
Esempio n. 2
0
        public date(int Id)
        {
            InitializeComponent();
            _db = new WorkerContext();


            _Id = Id;
            _db.Peoples.Load();
            _db.HolyDays.Load();
            if (_db.HolyDays.Count(i => i.Peopleid == _Id) < 1)
            {
                MessageBox.Show("Don`t have weekend");
            }
            else
            {
                BindingSource DatedbOne  = new BindingSource();
                var           DatedbOneK = from w in _db.HolyDays.Local
                                           where (w.Peopleid == _Id)
                                           select w;
                personOfweekend   = _db.HolyDays.FirstOrDefault(q => q.People.Id == _Id);
                checkBox1.Checked = personOfweekend.IndexDate;
                var qieryAsList = new BindingList <HolyDay>(DatedbOneK.ToList());
                DatedbOne.DataSource     = qieryAsList;
                dataGridView1.DataSource = DatedbOne;
            }
        }
Esempio n. 3
0
        public Sort(Guid Id, string name, string lastName)
        {
            _Id = Id;
            InitializeComponent();
            _db = new WorkerContext();
            //_db.Workers.Load();
            //_db.Vacations.Load();
            linkLabel2.Text = name;
            linkLabel3.Text = lastName;
            Person peopl = _db.Workers.Find(_Id);

            YearIndex            = peopl.Year;
            numericUpDown1.Value = YearIndex;
            if (_db.Vacations.Count(i => i.FirstDate.Year == YearIndex) < 1)
            {
                MessageBox.Show("not booked");
            }
            else
            {
                BindingSource DatedbOne  = new BindingSource();
                var           DatedbOnek = from w in _db.Vacations
                                           where w.FirstDate.Year == YearIndex
                                           where w.People.Id == _Id
                                           select w;
                var qieryAsList = new BindingList <Vacation>(DatedbOnek.ToList());
                DatedbOne.DataSource     = qieryAsList;
                dataGridView1.DataSource = DatedbOne;
            }
        }
Esempio n. 4
0
 public Form1()
 {
     db = new WorkerContext();
     //_db = new WorkerContext();
     InitializeComponent();
     db.Workers.Load();
     PersonGridView.DataSource = db.Workers.Local.ToBindingList();
 }
Esempio n. 5
0
 public Sort()
 {
     InitializeComponent();
     _db = new WorkerContext();
     _db.Peoples.Load();
     YearIndex = 2018;
     if (_db.Peoples.Count(i => i.Year == YearIndex) < 1)
     {
         MessageBox.Show("Don`t booked");
     }
     else
     {
         BindingSource DatedbOne  = new BindingSource();
         var           DatedbOnek = from w in _db.Peoples.Local
                                    where w.Year == YearIndex
                                    select w;
         var qieryAsList = new BindingList <People>(DatedbOnek.ToList());
         DatedbOne.DataSource     = qieryAsList;
         dataGridView1.DataSource = DatedbOne;
     }
 }