private void UpdatePreviousBranch() { if (previousBranch == null) { return; } previousBranch.ValidUntil = selectedBranch.ValidFrom.AddDays(-1); previousBranch.IsReadOnly = true; dataAccess.UpdateEmployeeBranch(previousBranch); previousBranch = null; }
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 }; }