Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Добавяне на Банкови сметки
        /// </summary>
        /// <returns></returns>
        public IActionResult Add()
        {
            SetBreadcrums(0);
            SetViewBag();
            var model = new CourtBankAccount()
            {
                CourtId  = userContext.CourtId,
                IsActive = true
            };

            return(View(nameof(Edit), model));
        }
Exemplo n.º 3
0
        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));
        }