Esempio n. 1
0
        private void FillShifts()
        {
            StaffShiftsLogic shifts = new StaffShiftsLogic(manager);

            ShiftsCB.ValueMember   = "ID";
            ShiftsCB.DisplayMember = "Name";
            ShiftsCB.DropDownStyle = ComboBoxStyle.DropDownList;
            StaffShift none = new StaffShift();

            //none.ID = -1;
            none.Name = "- не вибрано -";
            List <StaffShift> list = new List <StaffShift>();

            list.Add(none);
            list.AddRange(shifts.GetAll());

            ShiftsCB.DataSource = list;

            if (mode == "edit" || mode == "copy")
            {
                if (sheduler != null && sheduler.ShiftID != null)
                {
                    int i = 0;
                    foreach (object o in ShiftsCB.Items)
                    {
                        StaffShift shift = (StaffShift)o;
                        if (shift.ID == sheduler.ShiftID)
                        {
                            ShiftsCB.SelectedIndex = i;
                        }
                        i++;
                    }
                }
            }
        }
Esempio n. 2
0
        private void Fill()
        {
            StaffShiftsLogic shifts = new StaffShiftsLogic(manager);

            DataGV.AutoGenerateColumns = false;
            DataGV.DataSource          = shifts.GetAll();
            DataGV.Update();
        }
Esempio n. 3
0
        private void FillShifts()
        {
            StaffShiftsLogic shifts = new StaffShiftsLogic(manager);

            ShiftsCB.ValueMember   = "ID";
            ShiftsCB.DisplayMember = "Name";
            ShiftsCB.DropDownStyle = ComboBoxStyle.DropDownList;
            StaffShift none = new StaffShift();

            //none.ID = -1;
            none.Name = "- не вибрано -";
            List <StaffShift> list = new List <StaffShift>();

            list.Add(none);
            list.AddRange(shifts.GetAll());

            ShiftsCB.DataSource = list;
        }
Esempio n. 4
0
        private void FillShifts()
        {
            StaffShiftsLogic shifts = new StaffShiftsLogic(manager);
            ShiftsCB.ValueMember = "ID";
            ShiftsCB.DisplayMember = "Name";
            ShiftsCB.DropDownStyle = ComboBoxStyle.DropDownList;
            StaffShift none = new StaffShift();
            //none.ID = -1;
            none.Name = "- не вибрано -";
            List<StaffShift> list = new List<StaffShift>();
            list.Add(none);
            list.AddRange(shifts.GetAll());

            ShiftsCB.DataSource = list;

            if (mode == "edit" || mode == "copy")
            {
                if (sheduler != null && sheduler.ShiftID != null)
                {
                    int i = 0;
                    foreach (object o in ShiftsCB.Items)
                    {
                        StaffShift shift = (StaffShift)o;
                        if (shift.ID == sheduler.ShiftID)
                        {
                            ShiftsCB.SelectedIndex = i;
                        }
                        i++;
                    }
                }
            }
        }
Esempio n. 5
0
        private void FillShifts()
        {
            StaffShiftsLogic shifts = new StaffShiftsLogic(manager);
            ShiftsCB.ValueMember = "ID";
            ShiftsCB.DisplayMember = "Name";
            ShiftsCB.DropDownStyle = ComboBoxStyle.DropDownList;
            StaffShift none = new StaffShift();
            //none.ID = -1;
            none.Name = "- не вибрано -";
            List<StaffShift> list = new List<StaffShift>();
            list.Add(none);
            list.AddRange(shifts.GetAll());

            ShiftsCB.DataSource = list;
        }