예제 #1
0
        private void UpdatePreviousBranch()
        {
            if (previousBranch == null)
            {
                return;
            }

            previousBranch.ValidUntil = selectedBranch.ValidFrom.AddDays(-1);
            previousBranch.IsReadOnly = true;
            dataAccess.UpdateEmployeeBranch(previousBranch);
            previousBranch = null;
        }
예제 #2
0
        private void OnAddedNewBranch(object obj)
        {
            GridViewAddingNewEventArgs e = obj as GridViewAddingNewEventArgs;

            if (e == null)
            {
                return;
            }

            EmployeeBranches.MoveCurrentToFirst();
            previousBranch = EmployeeBranches.CurrentItem as EmployeeBranchEdit;

            e.NewObject = new EmployeeBranchEdit
            {
                EmployeeId      = selectedItem.Id,
                QuantCoBranchId = 1,
                ValidFrom       = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1),
                IsReadOnly      = false
            };
        }