public ActionResult Create() { CustomerManagingViewModel viewModel = new CustomerManagingViewModel(); viewModel.Customer = new Customer(); viewModel.CustomerStatuses = customerStatuses.Collection(); viewModel.CustomerNotes = customerNotes.Collection(); return(View(viewModel)); }
public ActionResult Edit(string Id) { Customer customer = context.Find(Id); if (customer == null) { return(HttpNotFound($"Customer with {Id} not exist in database")); } else { CustomerManagingViewModel viewModel = new CustomerManagingViewModel(); viewModel.Customer = customer; viewModel.CustomerStatuses = customerStatuses.Collection(); return(View(viewModel)); } }
public ActionResult Details(string id) { var customer = context.Find(id); if (customer == null) { return(HttpNotFound($"Customer with {id} not exist in database")); } CustomerManagingViewModel viewModel = new CustomerManagingViewModel(); viewModel.Customer = customer; viewModel.CustomerStatuses = customerStatuses.Collection(); viewModel.CustomerNotes = customerNotes.Collection().Where(note => note.CustomerId == id); return(View(viewModel)); }