Ejemplo n.º 1
0
        public async Task <ActionResult> CreateAsync(BankaCreateViewModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var addBank = new Banka
                    {
                        Emri = model.Emri,
                        Kodi = model.Kodi
                    };

                    var result = await bankRepository.AddAsync(addBank);

                    alertService.Success("Banka u shtua me sukses!");

                    return(RedirectToAction("Index"));
                }
                catch
                {
                    alertService.Danger("Diqka shkoi gabim, provoni perseri!");
                    return(View(model));
                }
            }
            alertService.Information("Plotesoni te gjitha fushat!");
            return(View(model));
        }