public IActionResult Edit(ApolloEditViewModel model) { if (ModelState.IsValid) { var apolloRow = _apolloRepository.GetById(model.Id); apolloRow.Id = model.Id; apolloRow.Name = model.Name; apolloRow.IndustrySegment = model.IndustrySegment; apolloRow.IndustryVertical = model.IndustryVertical; apolloRow.AccountSTID = model.AccountSTID; apolloRow.AccountSTName = model.AccountSTName; apolloRow.TopParentSTID = model.TopParentSTID; apolloRow.TopParentSTName = model.TopParentSTName; apolloRow.OrganizationID = model.OrganizationID; apolloRow.OPSIID = model.OPSIID; apolloRow.PRMID = model.PRMID; apolloRow.BusinessRelationshipID = model.BusinessRelationshipID; apolloRow.TaxIdentifier = model.TaxIdentifier; var updatedApolloRow = _apolloRepository.Update(apolloRow); if (updatedApolloRow != null && updatedApolloRow.Id != 0) { return(RedirectToAction("Index")); } } return(View(model)); }
public IActionResult Edit(int id) { var apolloRow = _apolloRepository.GetById(id); var model = new ApolloEditViewModel() { Id = apolloRow.Id, Name = apolloRow.Name, IndustrySegment = apolloRow.IndustrySegment, IndustryVertical = apolloRow.IndustryVertical, AccountSTID = apolloRow.AccountSTID, AccountSTName = apolloRow.AccountSTName, //TopParentSTID = (int)apolloRow.TopParentSTID , TopParentSTName = apolloRow.TopParentSTName, OrganizationID = apolloRow.OrganizationID, OPSIID = apolloRow.OPSIID, PRMID = apolloRow.PRMID, BusinessRelationshipID = apolloRow.BusinessRelationshipID, TaxIdentifier = apolloRow.TaxIdentifier }; return(View(model)); }