protected override async Task OnInitializedAsync() { Saved = false; Guid.TryParse(CustomerId, out var customerId); if (customerId != Guid.Empty) //new Customer is being created { Customer = await CustomerDataService.GetCustomerDetails(customerId); } }
//public List<Country> Countries { get; set; } = new List<Country>(); protected override async Task OnInitializedAsync() { Saved = false; //Countries = (await CountryDataService.GetAllCountries()).ToList(); int.TryParse(CustomerId, out var CustomerID); if (CustomerID == 0) //new Customer is being created { //add some defaults Customer = new Customer { }; } else { Customer = await CustomerDataService.GetCustomerDetails(int.Parse(CustomerId)); } //CountryId = Customer.CountryId.ToString(); //JobCategoryId = Customer.JobCategoryId.ToString(); }
protected override async Task OnInitializedAsync() { Customer = await CustomerDataService.GetCustomerDetails(int.Parse(CustomerId)); }
public CustomerModel GetCustomerDetails(int customerId) { CustomerDataService oDataService = new CustomerDataService(); return(oDataService.GetCustomerDetails(customerId)); }
protected override async Task OnInitializedAsync() { Customer = await CustomerDataService.GetCustomerDetails(new System.Guid(CustomerId)); }