Exemplo n.º 1
0
        public void InitControl(List <AvgWorkingDaysInWeek> lst)
        {
            Clear();
            if (EntityCountry != null)
            {
                _listAmounts = lst;
                if (_listAmounts == null)
                {
                    _listAmounts = ClientEnvironment.CountryService.AvgWorkingDaysInWeekService.GetAvgWorkingDaysInWeekFiltered(Country.ID, null, null);
                }

                if (_listAmounts != null)
                {
                    foreach (AvgWorkingDaysInWeek amount in _listAmounts)
                    {
                        ListOfAvgWDInWeek.Add(amount);
                    }
                }

                gridControlAvgWDiWeek.DataSource = ListOfAvgWDInWeek;

                gc_AverageWorkingDayInWeek.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                gc_AverageWorkingDayInWeek.DisplayFormat.FormatString = "n1";

                UpdateBarButtons();
            }
        }
Exemplo n.º 2
0
 public void ReBuildByWgr(HwgrToWgr wgr, BindingTemplate <BaseTreeItem> lst)
 {
     if (lst != null)
     {
         List <BaseTreeItem> detect = new List <BaseTreeItem>();
         detect.AddRange(lst);
         foreach (BaseTreeItem item in detect)
         {
             if (!item.IsHwgr && (item as WgrTreeItem).Wgr.WGR_ID == wgr.WGR_ID)
             {
                 lst.Remove(item);
             }
         }
         foreach (HwgrToWgr item in GetWgrHistoty())
         {
             if (item.BeginTime <= m_filterDate && item.EndTime >= m_filterDate)
             {
                 long parentid = 0;
                 foreach (BaseTreeItem var in lst)
                 {
                     if (var.IsHwgr && (var as HwgrTreeItem).Hwgr.HWGR_ID == item.HWGR_ID)
                     {
                         parentid = var.ID;
                         break;
                     }
                 }
                 lst.Add(new WgrTreeItem(item, parentid));
             }
         }
         lst.ClearRemoveList();
     }
 }
Exemplo n.º 3
0
        public void FireNewEntity()
        {
            if (ReadOnly)
            {
                return;
            }
            if (Country == null)
            {
                return;
            }

            WorkingModel entity = new WorkingModel();

            entity.CountryID        = Country.ID;
            entity.WorkingModelType = WorkingModelType.LunchModel;
            FormLunchModel countryform = new FormLunchModel(entity);

            countryform.Text  = GetLocalized("NewLunch");
            countryform.isNew = true;
            if (FocusedEntity != null)
            {
                countryform.setReadOnlyTypeLunch(FocusedEntity.IsDurationTime);
            }
            if (countryform.ShowDialog() == DialogResult.OK)
            {
                _listEntities.Add((WorkingModel)countryform.Entity);
                UpdateBarButtonEnable();
            }
        }
Exemplo n.º 4
0
        private void LoadStores()
        {
            gridControl.BeginUpdate();
            try
            {
                _listStores.Clear();

                if (EntityRegion != null)
                {
                    List <Domain.Store> lst = ClientEnvironment.StoreService.FindAll();
                    if (lst != null)
                    {
                        foreach (Domain.Store store in lst)
                        {
                            if (store.RegionID == EntityRegion.ID)
                            {
                                _listStores.Add(store);
                            }
                        }
                    }
                }

                if (gridControl.DataSource == null)
                {
                    gridControl.DataSource = _listStores;
                }
            }
            finally
            {
                gridControl.EndUpdate();
            }
        }
Exemplo n.º 5
0
        public void InitControl()
        {
            Clear();

            if (daysOfWeek == null)
            {
                daysOfWeek = new string[8];
                daysOfWeek[(int)BaumaxDayOfWeek.Monday]    = GetLocalized(BaumaxDayOfWeek.Monday.ToString());
                daysOfWeek[(int)BaumaxDayOfWeek.Tuesday]   = GetLocalized(BaumaxDayOfWeek.Tuesday.ToString());
                daysOfWeek[(int)BaumaxDayOfWeek.Wednesday] = GetLocalized(BaumaxDayOfWeek.Wednesday.ToString());
                daysOfWeek[(int)BaumaxDayOfWeek.Thursday]  = GetLocalized(BaumaxDayOfWeek.Thursday.ToString());
                daysOfWeek[(int)BaumaxDayOfWeek.Friday]    = GetLocalized(BaumaxDayOfWeek.Friday.ToString());
                daysOfWeek[(int)BaumaxDayOfWeek.Saturday]  = GetLocalized(BaumaxDayOfWeek.Saturday.ToString());
                daysOfWeek[(int)BaumaxDayOfWeek.Sunday]    = GetLocalized(BaumaxDayOfWeek.Sunday.ToString());
            }
            if (EntityCountry != null)
            {
                List <CountryAdditionalHour> lst;
                for (short year = BeginDate; year <= EndDate; year++)
                {
                    lst = ClientEnvironment.CountryService.CountryAdditionalHourService.GetCountryAdditionalHourFiltered(Country.ID, year);
                    if (lst != null && lst.Count != 0)
                    {
                        foreach (CountryAdditionalHour amount in lst)
                        {
                            ListOfUnavAddHours.Add(amount);
                        }
                    }
                }
                gridControl_UnAdHours.DataSource = ListOfUnavAddHours;
                UpdateBarButtons();
            }
        }
Exemplo n.º 6
0
        public void ReBuildByHwgr(long hwgrid, BindingTemplate <BaseTreeItem> lst)
        {
            if (lst != null && lst.Count > 0)
            {
                WorldToHwgr entity = hwgrList.GetEntityByHwgrAndDate(WorldID, hwgrid, m_filterDate);

                for (int i = 0; i < lst.Count; i++)
                {
                    if (lst[i].IsHwgr)
                    {
                        HwgrTreeItem item = (lst[i] as HwgrTreeItem);
                        if (item.Hwgr.HWGR_ID == hwgrid)
                        {
                            if (entity != null)
                            {
                                item.Hwgr = entity;
                            }
                            else
                            {
                                RemoveChilds(item.ID, lst);
                                lst.Remove(item);
                                lst.ClearRemoveList();
                            }
                            return;
                        }
                    }
                }
                // new item
                if (entity != null)
                {
                    HwgrTreeItem item = new HwgrTreeItem(entity, 0);
                    lst.Add(item);
                    foreach (HwgrToWgr htw in wgrList)
                    {
                        if (htw.HWGR_ID == hwgrid)
                        {
                            if (htw.BeginTime.Date <= m_filterDate && m_filterDate <= htw.EndTime.Date)
                            {
                                lst.Add(new WgrTreeItem(htw, item.ID));
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 7
0
        public BindingTemplate <BaseTreeItem> GetStructure()
        {
            BindingTemplate <BaseTreeItem> resultList = new BindingTemplate <BaseTreeItem>();

            if (hwgrList != null)
            {
                List <WorldToHwgr> lst = hwgrList.GetHwgrByWorldAndDate(WorldID, m_filterDate);

                for (int i = 0; i < lst.Count; i++)
                {
                    resultList.Add(new HwgrTreeItem(lst[i], 0));
                }
            }
            List <WgrTreeItem> tempList = new List <WgrTreeItem>();

            foreach (HwgrTreeItem entity in resultList)
            {
                long hwgrid = entity.Hwgr.HWGR_ID;

                if (wgrList != null)
                {
                    foreach (HwgrToWgr wgr in wgrList)
                    {
                        if (wgr.HWGR_ID == hwgrid)
                        {
                            if (Check4DateRange(entity.Hwgr.BeginTime, entity.Hwgr.EndTime,
                                                wgr.BeginTime, wgr.EndTime))
                            {
                                if (CheckDateRange(wgr.BeginTime, wgr.EndTime, m_filterDate))
                                {
                                    tempList.Add(new WgrTreeItem(wgr, entity.ID));
                                }
                            }
                        }
                    }
                }
            }

            foreach (WgrTreeItem item in tempList)
            {
                resultList.Add(item);
            }

            return(resultList);
        }
Exemplo n.º 8
0
        private void dateNavigator1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            DateTime dt = dateNavigator1.DateTime;

            Feast feast = new Feast();

            feast.Country = Country;
            feast.Date    = dt;
            _bindingFeasts.Add(feast);

            Modified = true;
        }
Exemplo n.º 9
0
        private void NewAbsence()
        {
            Absence absence = ClientEnvironment.AbsenceService.CreateEntity();

            if (Country != null)
            {
                absence.CountryID = Country.ID;
            }
            //new Domain.Absence();
            absence.AbsenceTypeID = AbsenceType.Absence;
            AbsenceForm form = new AbsenceForm(absence);

            form.AbsenceManager  = _absencemanager;
            form.CountryReadOnly = Country != null;

            if (form.ShowDialog() == DialogResult.OK)
            {
                if (_bindingAbsences.GetItemByID(form.Absence.ID) == null)
                {
                    _bindingAbsences.Add(form.Absence);
                }
            }
        }
Exemplo n.º 10
0
        public void InitControl(List <AvgAmount> lst)
        {
            Clear();

            if (EntityCountry != null)
            {
                _listAmounts = lst;
                if (_listAmounts == null)
                {
                    _listAmounts = ClientEnvironment.AvgAmountService.GetCountryAvgAmounts(EntityCountry.ID);
                }

                if (_listAmounts != null)
                {
                    foreach (AvgAmount amount in _listAmounts)
                    {
                        _bindingWeeks.Add(amount);
                    }
                }

                gridControl.DataSource = _bindingWeeks;
            }
        }
Exemplo n.º 11
0
        public override void Add()
        {
            using (FormLongTimeAbsence newAbsenceForm = new FormLongTimeAbsence())
            {
                LongTimeAbsence newAbsence = new LongTimeAbsence();
                newAbsenceForm.Entity = newAbsence;

                if (newAbsenceForm.ShowDialog() == DialogResult.OK)
                {
                    m_absenceList.Add(newAbsence);
                }
                UpdateButtonState();
            }
        }
Exemplo n.º 12
0
 public void NewEntity()
 {
     if (!ReadOnly)
     {
         using (FormLanguage2 f = new FormLanguage2())
         {
             //f.Text = Localizer.GetLocalized("New Language");
             f.Language = ClientEnvironment.LanguageService.CreateEntity();
             //new Domain.Language();
             if (f.ShowDialog(OwnerForm) == DialogResult.OK)
             {
                 _bindingLanguageList.Add(f.Language);
             }
         }
     }
 }
Exemplo n.º 13
0
        public void FireNewEntity()
        {
            if (ReadOnly)
            {
                return;
            }

            Domain.World entity = new Domain.World();
            FormWorldAdd form   = new FormWorldAdd();

            form.World = entity;
            if (form.ShowDialog() == DialogResult.OK)
            {
                _bindingEntities.Add(form.World);
            }
        }
Exemplo n.º 14
0
        public void FireNewEntity()
        {
            if (ReadOnly)
            {
                return;
            }

            Domain.HWGR entity = new Domain.HWGR();
            FormHwgrAdd form   = new FormHwgrAdd();

            form.HWGR = entity;
            if (form.ShowDialog() == DialogResult.OK)
            {
                _bindingEntities.Add(form.HWGR);
            }
        }
Exemplo n.º 15
0
        void NewFeast()
        {
            if (ReadOnly)
            {
                return;
            }
            FormFeast ffeast = new FormFeast();

            ffeast.Country = this.Country;
            if (ffeast.ShowDialog() == DialogResult.OK)
            {
                Feast[] newFeast = ffeast.GetNewFeast();
                for (int i = 0; i < newFeast.Length; i++)
                {
                    _bindingFeast.Add(newFeast[i]);
                }
            }
        }
Exemplo n.º 16
0
 public BindingTemplate <BaseTreeItem> GetByWorldID(long id, DateTime?date)
 {
     if (date != null)
     {
         BindingTemplate <BaseTreeItem> view = new BindingTemplate <BaseTreeItem>();
         foreach (BaseTreeItem var in this[id])
         {
             if (var.BeginTime < date && var.EndTime > date)
             {
                 view.Add(var);
             }
         }
         return(view);
     }
     else
     {
         return(this[id]);
     }
 }
Exemplo n.º 17
0
        public void FireNewEntity()
        {
            if (ReadOnly)
            {
                return;
            }
            if (Country == null)
            {
                return;
            }

            Domain.WorkingModel entity = new Domain.WorkingModel();
            entity.CountryID = Country.ID;
            WorkingModelForm countryform = new WorkingModelForm(entity);

            if (countryform.ShowDialog() == DialogResult.OK)
            {
                _listEntities.Add((Domain.WorkingModel)countryform.Entity);
                UpdateBarButtonEnable();
            }
        }
Exemplo n.º 18
0
        private void LoadStores()
        {
            lookUpStores.Properties.BeginUpdate();
            try
            {
                _listStores.Clear();

                if (Entity != null)
                {
                    StoreViewList lst = new StoreViewList();
                    lst.LoadByRegion(EntityRegion.ID);

                    for (int i = 0; i < lst.Count; i++)
                    {
                        _listStores.Add(lst[i].Entity);
                    }

                    //List<Domain.Store> lst = ClientEnvironment.StoreService.FindAll();
//                    if (lst != null)
//                    {
//                        foreach (Domain.Store store in lst)
//                            if (store.RegionID == EntityRegion.ID) _listStores.Add(store);
//                    }
                }

                if (lookUpStores.Properties.DataSource == null)
                {
                    lookUpStores.Properties.DataSource = _listStores;
                }
            }
            finally
            {
                lookUpStores.Properties.EndUpdate();
            }

            if (_listStores.Count > 0)
            {
                lookUpStores.EditValue = _listStores[0].ID;
            }
        }