private bool migrate_CourtBankAccount(MigrationData item) { var data = item.Data.Split('|'); try { var model = new CourtBankAccount() { CourtId = item.CourtId, Iban = data[0], Label = data[1], MoneyGroupId = int.Parse(data[2]), IsActive = true, DateStart = DefaultDateFrom }; repo.Add(model); repo.SaveChanges(); model.OrderNumber = model.Id; repo.SaveChanges(); return(true); } catch (Exception ex) { var error = ex.Message; return(false); } }
/// <summary> /// Добавяне на Банкови сметки /// </summary> /// <returns></returns> public IActionResult Add() { SetBreadcrums(0); SetViewBag(); var model = new CourtBankAccount() { CourtId = userContext.CourtId, IsActive = true }; return(View(nameof(Edit), model)); }
public IActionResult Edit(CourtBankAccount model) { SetViewBag(); if (!ModelState.IsValid) { SetBreadcrums(model.Id); return(View(nameof(Edit), model)); } var currentId = model.Id; if (service.CourtBankAccount_SaveData(model)) { this.SaveLogOperation(currentId == 0, model.Id); SetSuccessMessage(MessageConstant.Values.SaveOK); return(RedirectToAction(nameof(Edit), new { id = model.Id })); } else { SetErrorMessage(MessageConstant.Values.SaveFailed); } SetBreadcrums(model.Id); return(View(nameof(Edit), model)); }