예제 #1
0
        public IActionResult GorevlendirPersonel(PersonelGorevlendirViewModel model)
        {
            TempData["Active"] = "isemri";
            var user  = _userManager.Users.FirstOrDefault(i => i.Id == model.PersonelId);
            var gorev = _gorevService.GetirAciliyetIdIle(model.GorevId);

            var userModel = new AppUserListViewModel()
            {
                Id      = user.Id,
                Name    = user.Name,
                Picture = user.Picture,
                Surname = user.Surname,
                Email   = user.Email
            };

            var gorevModel = new GorevListViewModel()
            {
                Id       = gorev.Id,
                Aciklama = gorev.Aciklama,
                Aciliyet = gorev.Aciliyet,
                Ad       = gorev.Ad
            };

            var personelModel = new PersonelGorevlendirListViewModel()
            {
                AppUser = userModel,
                Gorev   = gorevModel
            };

            return(View(personelModel));
        }
예제 #2
0
        public IActionResult GorevlendirPersonel(PersonelGorevlendirViewModel model)
        {
            TempData["Active"] = "isemri";
            var user  = _userManager.Users.FirstOrDefault(I => I.Id == model.PersonelId);
            var gorev = _gorevService.GetirAciliyetileId(model.GorevId);

            AppUserListViewModel userModel = new AppUserListViewModel();

            userModel.Id      = user.Id;
            userModel.Name    = user.Name;
            userModel.Picture = user.Picture;
            userModel.SurName = user.Surname;
            userModel.Email   = user.Email;


            GorevListViewModel gorevModel = new GorevListViewModel();

            gorevModel.Id       = gorev.Id;
            gorevModel.Aciklama = gorev.Aciklama;
            gorevModel.Aciliyet = gorev.Aciliyet;
            gorevModel.Ad       = gorev.Ad;


            PersonelGorevlendirListViewModel personelGorevlendirModel = new PersonelGorevlendirListViewModel();

            personelGorevlendirModel.AppUser = userModel;
            personelGorevlendirModel.Gorev   = gorevModel;
            return(View(personelGorevlendirModel));
        }