public void SelectCustomer(int customerId) { if (securityManager.CanChangeSelectedCustomer()) { if (securityManager.CanChangeSelectedClient()) { CffClient client = clientRepository.GetCffClientByCustomerId(customerId); CffCustomer customer = customerRepository.GetCffCustomerByCustomerId(customerId); if (client != null && customer != null) { // view.Client = client; // view.Customer = customer; } } else { CffCustomer customer = customerRepository.GetCffCustomerByClientIdAndCustomerId(view.Client.Id, customerId); if (customer != null) { // view.Customer = customer; } } } }
public void LockDown(int?clientId, int?customerId) { if (!userService.ValidateClientCustomerSelection(clientId, customerId, principal)) { redirectionService.SelectDefaultAssociationAndRedirectToDashboard(principal.CffUser); } view.ToggleEditNextCallDueDateButton(securityManager.CanEditNextCallDueDate()); view.ToggleClientSearchControl(securityManager.CanChangeSelectedClient()); view.ToggleCustomerSearchControl(securityManager.CanChangeSelectedCustomer()); }
public void SelectClientCustomerAndRedirectToDashboard(int clientId, int customerId) { if (securityManager.CanChangeSelectedCustomer()) { ICffClient client = clientRepository.GetCffClientByClientId(clientId); CffCustomer customer = customerRepository.GetCffCustomerByCustomerId(customerId); view.Client = client; view.Customer = (ICffCustomer)customer; view.RedirectTo(DashboardUrl + "?Client=" + clientId + "&Customer=" + customerId + "&ViewID=" + QueryString.ViewIDValue); } }
public void Decorate() { string fieldName = parameter.FieldName; if (fieldName.Equals("Batch") && securityManager.CanViewReleaseTab()) { BatchRecord record = grid.GetRow(parameter.RowIndex) as BatchRecord; if (record != null && record.IsInvoice) { Decorate(Cff_WebResource.batchNumberLinkTooltip); } } else if (fieldName.Equals("ClientName") && securityManager.CanChangeSelectedClient()) { Decorate(Cff_WebResource.clientNameLinkTooltip); } else if (fieldName.Equals("CustomerName") && securityManager.CanChangeSelectedCustomer()) { Decorate(Cff_WebResource.customerNameLinkTooltip); } }