コード例 #1
0
ファイル: UCLunchBrakes.cs プロジェクト: 5509850/baumax
        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();
            }
        }
コード例 #2
0
ファイル: UCLunchBrakes.cs プロジェクト: 5509850/baumax
        public void FireEditEntity(WorkingModel c)
        {
            if (ReadOnly)
            {
                return;
            }
            WorkingModel entity = c;

            if (entity == null)
            {
                entity = FocusedEntity;
            }
            if (entity != null)
            {
                FormLunchModel countryform = new FormLunchModel(entity);
                countryform.Text  = GetLocalized("editLunch");
                countryform.isNew = false;
                if (FocusedEntity != null && gridViewLunch.RowCount > 1)
                {
                    countryform.setReadOnlyTypeLunch(FocusedEntity.IsDurationTime);
                }
                if (countryform.ShowDialog() == DialogResult.OK)
                {
                    _listEntities.ResetItemById(entity.ID);
                }
            }
        }