예제 #1
0
        private void repositoryItemPopupContainerEditSaldoEqualValueonCertainWeeks_QueryPopUp(object sender, CancelEventArgs e)
        {
            BaseWMItemView item = (BaseWMItemView)gridView.GetRow(gridView.FocusedRowHandle);

            if (item != null)
            {
                SetWeeksData(item);
            }
        }
예제 #2
0
        private void repositoryItemCheckEdit1_CheckedChanged(object sender, EventArgs e)
        {
            BaseWMItemView item = (BaseWMItemView)gridView.GetRow(gridView.FocusedRowHandle);

            if (item != null)
            {
                item.Checked = (bool)gridView.EditingValue;
            }
        }
예제 #3
0
        private void repositoryItemPopupContainerEdit1_CloseUp(object sender, CloseUpEventArgs e)
        {
            BaseWMItemView item = (BaseWMItemView)gridView.GetRow(gridView.FocusedRowHandle);

            if (item != null && (item is SpecialDayWMItemView))
            {
                SpecialDayWMItemView itemDays = (item as SpecialDayWMItemView);
                itemDays.DayMasks = GetStateMonths();
            }
        }
예제 #4
0
        private void repositoryItemPopupContainerEditEveryItem_QueryPopUp(object sender, CancelEventArgs e)
        {
            BaseWMItemView item = (BaseWMItemView)gridView.GetRow(gridView.FocusedRowHandle);

            if (item != null && (item is EveryItemWMItemView))
            {
                EveryItemWMItemView itemWm = (item as EveryItemWMItemView);
                SetEveryItemControlState(itemWm);
            }
        }
예제 #5
0
        private void repositoryItemPopupContainerEditEveryItem_CloseUp(object sender, CloseUpEventArgs e)
        {
            BaseWMItemView item = (BaseWMItemView)gridView.GetRow(gridView.FocusedRowHandle);

            if (item != null && (item is EveryItemWMItemView))
            {
                EveryItemWMItemView itemWm = (item as EveryItemWMItemView);
                GetEveryItemControlState(itemWm);
                gridView.RefreshData();
            }
        }
예제 #6
0
        public void UpdateWeekData()
        {
            BaseWMItemView item = (BaseWMItemView)gridView.GetRow(gridView.FocusedRowHandle);
            SaldoZeroOnCertainWeekWMItemView condition = item as SaldoZeroOnCertainWeekWMItemView;

            if (condition != null)
            {
                condition.Compare = radioGroupOperatorWeeks.SelectedIndex;
                condition.Hours   = Convert.ToInt32(spinEditHours.Value);
                condition.AssignWeekNumbers(textEditWeeks.Text);
            }
        }
예제 #7
0
        private void gridView_RowStyle(object sender, RowStyleEventArgs e)
        {
            BaseWMItemView item = (BaseWMItemView)gridView.GetRow(e.RowHandle);

            if (item == null)
            {
                return;
            }

            if (item.Checked)
            {
                e.Appearance.BackColor = Color.GreenYellow;
            }
        }
예제 #8
0
        void SetWeeksData(BaseWMItemView item)
        {
            SaldoZeroOnCertainWeekWMItemView condition = item as SaldoZeroOnCertainWeekWMItemView;

            if (condition != null)
            {
                radioGroupOperatorWeeks.SelectedIndex = condition.Compare;
                spinEditHours.Value = condition.Hours;
                textEditWeeks.Text  = condition.ArrayToString();
            }
            else
            {
                spinEditHours.Value = 0m;
                textEditWeeks.Text  = String.Empty;
            }
        }
예제 #9
0
        private void gridView_CustomUnboundColumnData(object sender, CustomColumnDataEventArgs e)
        {
            BaseWMItemView item = (BaseWMItemView)gridView.GetRow(e.RowHandle);

            if (item == null)
            {
                return;
            }
            if (e.IsGetData)
            {
                e.Value = item.DisplayString;
            }
            else
            {
                item.Value = e.Value;
            }
        }
예제 #10
0
        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;
                }
            }
        }
예제 #11
0
        void wnlist_OnChangeState(BaseWMItemView item)
        {
            ConditionTypes cts = wnlist.State;

            editWorkingTimeFactor.Enabled = spinEditFixedAmount.Enabled = checkEdit_ApplyAdditionalCharge.Enabled = !ConditionHelper.IsOnlyMessageCondition(cts);
        }
예제 #12
0
        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;
                }
            }
        }