public void ReturnEntryInformation(ShowEntryEditableResponseModel response) { UpdateEntryViewModel updateEntryViewModel = new UpdateEntryViewModel(); //Case updateEntryViewModel.caseID = response.caseID.ToString(); // updateEntryViewModel.realtorID = Convert.ToDecimal(response.realtorID.ToString()); updateEntryViewModel.creationDate = response.creationDate.ToString(); updateEntryViewModel.closedDate = response.closedDate.ToString(); updateEntryViewModel.price = Convert.ToDecimal(response.price); //Property updateEntryViewModel.estimatedPrice = Convert.ToDecimal(response.estimatedPrice); //Property and Address updateEntryViewModel.postalCode = Convert.ToDecimal(response.postalCode); updateEntryViewModel.addressLine1 = response.addressLine1; //Address updateEntryViewModel.addressLine2 = response.addressLine2; updateEntryViewModel.ownershipCost = Convert.ToDecimal(response.ownershipCost); updateEntryViewModel.exteriorArea = Convert.ToDecimal(response.exteriorArea); updateEntryViewModel.interiorArea = Convert.ToDecimal(response.interiorArea); updateEntryViewModel.buildYear = Convert.ToDecimal(response.buildYear); _frontEnd.EntryToTextBoxes(updateEntryViewModel); }
public void ConfirmEntryCreation(UpdateEntryResponseModel response) { UpdateEntryViewModel updateEntryViewModel = new UpdateEntryViewModel(); updateEntryViewModel.UpdateSuccess = response.EntryUpdatedSuccesfully; _frontEnd.ShowUpdateStatus(updateEntryViewModel); }
public IActionResult Update(UpdateEntryViewModel model) { if (!ModelState.IsValid) { model.Categories = CategoriesSelectListItems(model.ID); model.Parties = PartiesSelectListItems(model.ID); return(View(model)); } var dto = Db.Get <Entry>(model.ID); var updated = dto.WithUpdates( categoryID: model.CategoryID, partyID: model.PartyID, date: model.Date, amount: model.Amount.Value, note: model.Note ); Db.InsertOrUpdate(updated); UnitOfWork.CommitChanges(); return(RedirectTo <HomeController>(c => c.Index())); }
public void ShowUpdateStatus(UpdateEntryViewModel updateEntryViewModel) { if (updateEntryViewModel.UpdateSuccess == true) { MessageBox.Show("Case updated"); } else { MessageBox.Show("Error"); } }
public IActionResult Update(int id) { var dto = Db.Get <Entry>(id); var model = new UpdateEntryViewModel { ID = dto.ID, CategoryID = dto.CategoryID, PartyID = dto.PartyID, Date = dto.Date, Amount = dto.Amount, Note = dto.Note, Categories = CategoriesSelectListItems(dto.AccountID), Parties = PartiesSelectListItems(dto.AccountID) }; return(View(model)); }
public void EntryToTextBoxes(UpdateEntryViewModel showEditAbleEntryViewModel) { //Case numericUpDown_RealtorID.Value = showEditAbleEntryViewModel.realtorID; textBox_CreationDate.Text = showEditAbleEntryViewModel.creationDate; textBox_CloseDate.Text = showEditAbleEntryViewModel.closedDate; numericUpDown_Price.Value = showEditAbleEntryViewModel.price; //Property numericUpDown_EstimatedPrice.Value = showEditAbleEntryViewModel.estimatedPrice; //Property and Address numericUpDown_PostalCode.Value = showEditAbleEntryViewModel.postalCode; textBox_AddressLine1.Text = showEditAbleEntryViewModel.addressLine1; //Address textBox_AddressLine2.Text = showEditAbleEntryViewModel.addressLine2; numericUpDown_OwnerShipCost.Value = showEditAbleEntryViewModel.ownershipCost; numericUpDown_ExteriorArea.Value = showEditAbleEntryViewModel.exteriorArea; numericUpDown_InteriorArea.Value = showEditAbleEntryViewModel.interiorArea; numericUpDown_BuildYear.Value = showEditAbleEntryViewModel.buildYear; }