public async Task <dynamic> AddComponentAsync(AddAddress addComponent, int instituteId) { var componentGroup = new LocationAddressModel() { InstituteId = instituteId, CountryId = addComponent.CountryId, StateId = addComponent.StateId, CityId = addComponent.CityId, Address1 = addComponent.Address1, Address2 = addComponent.Address2, ZipCode = addComponent.ZipCode, Description = addComponent.Description, }; iMSDbContext.LocationAddressModels.Add(componentGroup); await iMSDbContext.SaveChangesAsync(); return(new { HasError = false, Id = componentGroup.Id, Message = "Address added successfully" }); }
public ActionResult Location(Guid id, QueryModel oq, QueryModel cq, bool?showOpen) { IPagedList <ClosedWorkOrderModel> closedOrders = _workOrderService.GetLocationClosedWorkOrdersModels(cq, id); IPagedList <OpenWorkOrderModel> openOrders = _workOrderService.GetLocationOpenWorkOrdersModels(oq, id); LocationAddressModel location = _workOrderService.GetLocationInfo(id); LocationInfoModel locationInfo = _workOrderService.GetSpecificLocationInfo(id); var locationItems = _locationService.GetSingleLocation(id).Select(l => new SelectListItem { Value = l.Id.ToString(), Text = l.Name }).ToList(); locationItems.Insert(0, new SelectListItem()); var model = new LocationDetailsModel(Url) { LocationOpenOrders = openOrders, LocationClosedOrders = closedOrders, ShowOpen = showOpen ?? true, Locations = locationItems, ClosedWorkOrdersQuery = cq, OpenWorkOrdersQuery = oq, Address1 = location.Address1, Address2 = location.Address2, City = location.City, State = location.State, PostalCode = location.PostalCode, Name = location.Name, LocationInfo = locationInfo, LocationAddress = location }; ViewData["ReturnToListUrl"] = TempData.ContainsKey("ReturnToListUrl") ? TempData["ReturnToListUrl"] : Url.Action("Index"); return(View(model)); }
public BulkProviderLocationModel() { address = new LocationAddressModel(); }