Beispiel #1
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;
            }
        }
Beispiel #2
0
        public date(Guid Id)
        {
            InitializeComponent();
            _db = new WorkerContext();
            _Id = Id;

            //_db.Workers.Load();
            //_db.Vacations.Load();
            if (vacations.Count(i => i.Peopleid == _Id) < 1)
            {
                MessageBox.Show("Don`t have weekend");
            }
            else
            {
                BindingSource DatedbOne  = new BindingSource();
                var           DatedbOneK = vacations.Get(i => i.Peopleid == _Id);
                personOfweekend = vacations.FindById(i => i.Peopleid == _Id);
                if (personOfweekend == null)
                {
                    return;
                }
                checkBox1.Checked = personOfweekend.IndexDate;
                var qieryAsList = new BindingList <Vacation>(DatedbOneK.ToList());
                DatedbOne.DataSource     = qieryAsList;
                dataGridView1.DataSource = DatedbOne;
            }
        }
Beispiel #3
0
        public Form1()
        {
            db = new WorkerContext();

            //_db = new WorkerContext();
            InitializeComponent();
            //  db.Workers.Load();
            PersonGridView.DataSource = workers.GetSort(u => u.TeamName);
        }