public ActionResult Create()
        {
            var viewModel = new CreditTypeViewModel()
            {
                SubTypes = _creditTypesService.GetCreditSubTypes().Select(x => new SelectListItem()
                {
                    Value = x.Id.ToString(),
                    Text = x.Name
                })
            };

            return PartialView("CreatePartial", viewModel);
        }
        public ActionResult Create(CreditTypeViewModel viewModel)
        {
            viewModel.SubTypes = _creditTypesService.GetCreditSubTypes().Select(x => new SelectListItem()
            {
                Value = x.Id.ToString(),
                Text = x.Name
            });

            if (!ModelState.IsValid)
            {
                return PartialView("CreatePartial", viewModel);
            }

            var creditType = new CreditType()
            {
               Id = Guid.NewGuid(),
               Created = DateTime.Now,
               Name = viewModel.Name,
               Percent = viewModel.Percent,
               PayCount = viewModel.PayCount,
               StartSumPercent = viewModel.StartSumPercent,
               Info = viewModel.Info,
               Active = true,
               CreditSubTypeId = viewModel.SubTypeId
            };

            var res = _creditTypesService.Create(creditType);
            if (res)
            {
                ViewBag.Result = true;
                ViewBag.ResultMsg = "credit type created";
            }
            else
            {
                ViewBag.Result = false;
                ViewBag.ResultMsg = "credit type not created";
            }

            return PartialView("CreatePartial", viewModel);
        }
        public ActionResult Show(Guid id)
        {
            var creditType = _creditTypesService.Get(id);
            var viewModel = new CreditTypeViewModel()
            {
                Id = creditType.Id,
                Name = creditType.Name,
                Percent = creditType.Percent,
                StartSumPercent = creditType.StartSumPercent,
                PayCount = creditType.PayCount,
                Info = creditType.Info,
                IsActive = creditType.Active
            };

            return PartialView("ShowPartial", viewModel);
        }