Beispiel #1
0
        public Sort(Guid Id, string name, string lastName)
        {
            _Id = Id;
            InitializeComponent();
            linkLabel2.Text = name;
            linkLabel3.Text = lastName;
            Person peopl = workers.FindById(_Id);

            YearIndex            = peopl.Year;
            numericUpDown1.Value = YearIndex;
            if (vacations.Count(i => i.FirstDate.Year == YearIndex) < 1)
            {
                MessageBox.Show("not booked");
            }
            else
            {
                BindingSource DatedbOne  = new BindingSource();
                var           DatedbOnek = from w in vacations.Get().ToList()
                                           where w.FirstDate.Year == YearIndex
                                           where w.Peopleid == _Id
                                           select w;
                var qieryAsList = new BindingList <Vacation>(DatedbOnek.ToList());
                DatedbOne.DataSource = qieryAsList;
                dataGridViewPersonsVacationSort.DataSource = DatedbOne;
            }
        }
Beispiel #2
0
        private void btnNextYear(object sender, EventArgs e)
        {
            Guid id      = new Guid();
            Add  addForm = new Add();
            int  index   = 0;

            if (PersonGridView.RowCount > workers.Count())
            {
                index = PersonGridView.RowCount - 1;
            }
            else
            {
                index = PersonGridView.RowCount;
            }
            for (int i = 0; i < index; i++)
            {
                id = (Guid)PersonGridView[0, i].Value;
                Person people    = new Person();
                Person peopleOne = new Person();
                peopleOne      = workers.FindById(id);
                peopleOne.Day  = (int)peopleOne.Day + 18;
                peopleOne.Year = (int)peopleOne.Year + 1;
                workers.Update(peopleOne);
            }

            evenstb();
        }
Beispiel #3
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 #4
0
        private void btnNextYear(object sender, EventArgs e)
        {
            int       Days         = EFSettings.Get().ToList()[0].VacationDays;
            Guid      id           = new Guid();
            AddPerson Changeperson = new AddPerson();
            int       index        = 0;

            if (PersonGridView.RowCount > workers.Count())
            {
                index = PersonGridView.RowCount - 1;
            }
            else
            {
                index = PersonGridView.RowCount;
            }
            for (int i = 0; i < index; i++)
            {
                id = (Guid)PersonGridView[0, i].Value;
                Person person    = new Person();
                Person persenOne = new Person();
                persenOne      = workers.FindById(id);
                persenOne.Days = (int)persenOne.Days + Days;
                persenOne.Year = (int)persenOne.Year + 1;
                workers.Update(persenOne);
            }
            UpdateDataGridView();
        }
        public newWeekendDatagridview()
        {
            InitializeComponent();

            if (holydays.Count() < 1)
            {
                MessageBox.Show("Don`t have weekend");
            }
            else
            {
                BindingSource DatedbOne   = new BindingSource();
                var           DatedbOneK  = holydays.Get();
                var           qieryAsList = new BindingList <Weekend>(DatedbOneK.ToList());
                DatedbOne.DataSource           = qieryAsList;
                dataGridViewWeekend.DataSource = DatedbOne;
            }
        }
Beispiel #6
0
 public ShowVacation(Guid Id)
 {
     InitializeComponent();
     _Id = Id;
     if (EFVacations.Count(i => i.Peopleid == _Id) < 1)
     {
         MessageBox.Show("Don`t have weekend");
     }
     else
     {
         BindingSource DatedbOne  = new BindingSource();
         var           DatedbOneK = EFVacations.Get(i => i.Peopleid == _Id);
         personOfweekend = EFVacations.FindById(i => i.Peopleid == _Id);
         if (personOfweekend == null)
         {
             return;
         }
         checkBox1.Checked = personOfweekend.IndexDate;
         var qieryAsList = new BindingList <Vacation>(DatedbOneK.ToList());
         DatedbOne.DataSource             = qieryAsList;
         dataGridViewVacations.DataSource = DatedbOne;
     }
     this.dataGridViewVacations.RowPrePaint += new DataGridViewRowPrePaintEventHandler(this.PaintRows);
 }