void BuildList() { //ConditionTypes cond = ConditionTypes.Empty; Array values = Enum.GetValues(typeof(ConditionTypes)); //for (int i = 0; i < values.Length ; i++) foreach (ConditionTypes cond in values) { //cond = (ConditionTypes)values.[i]; if (ConditionHelper.IsEmptyCondition(cond)) { this.Add(new BaseWMItemView(cond, null, this)); } else if (ConditionHelper.IsSpecialDaysCondition(cond)) { this.Add(new SpecialDayWMItemView(cond, 0, this)); } else if (ConditionHelper.IsDoubleCondition(cond)) { this.Add(new DoubleWMItemView(cond, 0, this)); } else if (ConditionHelper.IsLGDoubleCondition(cond)) { this.Add(new LGDoubleWMItemView(cond, 0, this)); } else if (ConditionHelper.IsIntegerCondition(cond)) { this.Add(new IntegerWMItemView(cond, 0, this)); } else if (ConditionHelper.IsInteger2Condition(cond)) { this.Add(new IntegerWMItemView(cond, 0, this)); } else if (ConditionHelper.IsTimesCondition(cond)) { this.Add(new TimesWMItemView(cond, String.Empty, this)); } else if (ConditionHelper.IsEveryItemCondition(cond)) { this.Add(new EveryItemWMItemView(cond, 0, this)); } else if (cond == ConditionTypes.WorkingOnSunday) { this.Add(new IntegerWMItemView(cond, 1, this)); } else if (cond == ConditionTypes.WorkingOnSaturdayOrSunday) { this.Add(new IntegerWMItemView(cond, 1, this)); } else if (cond == ConditionTypes.SaldoOnCertainWeeks) { this.Add(new SaldoZeroOnCertainWeekWMItemView(cond, "", this)); } } }
private void gridView_ShowingEditor(object sender, CancelEventArgs e) { if (gridView.FocusedColumn == gridColumn_WMConditionValue) { BaseWMItemView item = (BaseWMItemView)gridView.GetRow(gridView.FocusedRowHandle); if (item == null) { e.Cancel = true; return; } if (ConditionHelper.IsEmptyCondition(item.Type) || !item.Checked) { e.Cancel = true; return; } } }
private void gridView_CustomRowCellEdit(object sender, CustomRowCellEditEventArgs e) { BaseWMItemView item = (BaseWMItemView)gridView.GetRow(e.RowHandle); if (item == null) { return; } if (e.Column == gridColumn_WMConditionValue) { if ((item.Type & ConditionTypes.TimeBetweenPreviousDayWorkingTime) != ConditionTypes.Empty) { e.RepositoryItem = repositoryItemSpinEditBetweenDay; return; } if ((item.Type & ConditionTypes.DurationOfWorkingDay) != ConditionTypes.Empty) { e.RepositoryItem = repositoryItemSpinEditDurationOfWorkingDays; return; } if (ConditionHelper.IsSpecialDaysCondition(item.Type)) { e.RepositoryItem = repositoryItemPopupContainerEdit1; } else if (ConditionHelper.IsTimesCondition(item.Type)) { e.RepositoryItem = repositoryItemTextEdit1; } else if (ConditionHelper.IsEveryItemCondition(item.Type)) { e.RepositoryItem = repositoryItemPopupContainerEditEveryItem; } else if (ConditionHelper.IsEmptyCondition(item.Type)) { e.RepositoryItem = null; } else if (ConditionHelper.IsLGDoubleCondition(item.Type)) { e.RepositoryItem = repositoryItemPopupContainerEdit2; } else if (ConditionHelper.IsIntegerCondition(item.Type)) { e.RepositoryItem = repositoryItemSpinEdit1; } else if (ConditionHelper.IsInteger2Condition(item.Type)) { e.RepositoryItem = repositoryItemSpinEditSaldo; } else if (item.Type == ConditionTypes.WorkingOnSaturdayOrSunday) { e.RepositoryItem = repositoryItemCountSaturdayOrSunday; } else if (item.Type == ConditionTypes.WorkingOnSunday) { e.RepositoryItem = repositoryItemCountSunday; } else if (item.Type == ConditionTypes.SaldoOnCertainWeeks) { e.RepositoryItem = repositoryItemPopupContainerEditSaldoEqualValueonCertainWeeks; //repositoryItemTextEditSalsoZeroOnCertainWeeks; } else { e.RepositoryItem = repositoryItemSpinEditBetweenDay; } } }