Example #1
0
        public ActionResult Duzenle(int firmaId)
        {
            var firmaFromDb    = _firmaRepository.FirmaGetir(firmaId);
            var firmaViewModel = Mapper.Map <Firma, FirmaViewModel>(firmaFromDb);

            firmaViewModel.GumrukKodlari = BolgeKodGetir();
            firmaViewModel.IsDisabled    = true;
            return(View(firmaViewModel));
        }
Example #2
0
        public async Task <ActionResult> FirmaKullaniciDuzenle(FirmaKullaniciViewModel firmaKullaniciViewModel)
        {
            if (ModelState.IsValid)
            {
                var firmaKullanici = Mapper.Map <FirmaKullaniciViewModel, FirmaKullanici>(firmaKullaniciViewModel);
                await _userRepository.FirmaKullaniciKaydetGuncelle(firmaKullanici);

                var firma            = _firmaRepository.FirmaGetir(Convert.ToInt32(firmaKullaniciViewModel.FirmaId));
                var irtibatPersoneli = _userRepository.GumrukKullanicilariGetir().FirstOrDefault(kullanici => kullanici.Id == firma.GumrukKullaniciId);
                await new MailHelper().SendMail(irtibatPersoneli.Email, string.Format(Resources.FirmaKullaniciOnayMailMsg, firmaKullanici.Adi, firmaKullanici.Soyadi));
                return(RedirectToAction("KullaniciTalepInfo"));
            }
            else
            {
                var fkViewModel = new FirmaKullaniciViewModel
                {
                    Firmalar = _firmaRepository.FirmaListesi()
                };
                return(View("YeniKullanici", fkViewModel));
            }
        }
Example #3
0
        private GorevlendirmeViewModel GorevlendirmeViewModelGetir(int id)
        {
            var firmaFromDb            = _firmaRepository.FirmaGetir(id);
            var currentGumrukKullanici = (GumrukKullanici)Session["CurrentGumrukKullanici"];
            var gorevlendirmeViewModel = new GorevlendirmeViewModel
            {
                FirmaId                   = firmaFromDb.FirmaId,
                VergiNo                   = firmaFromDb.VergiNo.ToString(),
                GumrukKullaniciId         = firmaFromDb.GumrukKullaniciId ?? 0,
                GorevlendirmeFirmaListesi = new List <GorevlendirmeFirmaViewModel>
                {
                    new GorevlendirmeFirmaViewModel
                    {
                        FirmaId  = firmaFromDb.FirmaId,
                        FirmaAdi = firmaFromDb.Adi
                    }
                },
                GorevlendirmKullaniciListesi = _userRepository.GorevlendirilecekKullanicilariGetir(currentGumrukKullanici.BolgeKodu)
            };

            return(gorevlendirmeViewModel);
        }