public ActionResult EditTestMasterProfile(Test_Master test_Master, HttpPostedFileBase ProfileImage)
        {
            TestMasterManager tm = new TestMasterManager();

            if (ModelState.IsValid)
            {
                if (ProfileImage != null &&
                    (ProfileImage.ContentType == "image/jpeg" ||
                     ProfileImage.ContentType == "image/jpg" ||
                     ProfileImage.ContentType == "image/png"))
                {
                    string filename = $"user_{test_Master.UserId}.{ProfileImage.ContentType.Split('/')[1]}";

                    ProfileImage.SaveAs(Server.MapPath($"~/Images/User_Images/{filename}"));
                    test_Master.user_picturepath = filename;
                }
                BusinessLayerResult <Test_Master> res = tm.UpdateProfile(test_Master);
                if (res.Errors.Count > 0)
                {
                    ErrorViewModel Errmsgs = new ErrorViewModel()
                    {
                        Items          = res.Errors,
                        Title          = "Profil Güncellenemedi",
                        RedirectingUrl = "/Home/EditTestMasterProfile"
                    };
                    return(View("Error", Errmsgs));
                }
                Session["login"] = res.Result;
                return(RedirectToAction("ShowTestMasterProfile"));
            }
            return(View(tm.GetTestMasterById(test_Master.UserId).Result));
        }
Exemple #2
0
        public ActionResult LookTestMasterProfile(int?id)
        {
            TestMasterManager tm = new TestMasterManager();
            BusinessLayerResult <Test_Master> res = tm.GetTestMasterById(id.Value);

            if (res.Errors.Count > 0)
            {
                ErrorViewModel ErrnotifyObj = new ErrorViewModel()
                {
                    Title = "Hata Oluştu",
                    Items = res.Errors
                };
                return(View("Error", ErrnotifyObj));
            }
            return(View(res.Result));
        }
        public ActionResult EditTestMasterProfile()
        {
            Test_Master       currentTestMaster = Session["login"] as Test_Master;
            TestMasterManager cm = new TestMasterManager();
            BusinessLayerResult <Test_Master> res = cm.GetTestMasterById(currentTestMaster.UserId);

            if (res.Errors.Count > 0)
            {
                ErrorViewModel ErrnotifyObj = new ErrorViewModel()
                {
                    Title = "Hata Oluştu",
                    Items = res.Errors
                };
                return(View("Error", ErrnotifyObj));
            }
            return(View(res.Result));
        }
        public ActionResult TestMasterLogin(TestMasterLoginViewModel model)
        {
            if (ModelState.IsValid)
            {
                TestMasterManager tm = new TestMasterManager();
                BusinessLayerResult <Test_Master> res = tm.LoginTestMaster(model);
                if (res.Errors.Count > 0)
                {
                    if (res.Errors.Find(x => x.Code == ErrorMessageCode.UserIsNotActive) != null)
                    {
                        ViewBag.SetLink = "http://localhost:53605/Home/TestMasterActivate/" + res.Result.ActivateGuid.ToString();
                    }

                    res.Errors.ForEach(x => ModelState.AddModelError("", x.Message));
                    return(View(model));
                }
                Session["login"] = res.Result;                //Session'a kullanıcı bilgi saklama..
                return(RedirectToAction("Index", "Job_Adv")); //Yönlendirme
            }

            return(View());
        }
        public ActionResult TestMasterActivate(Guid id)
        {
            TestMasterManager tmm = new TestMasterManager();
            BusinessLayerResult <Test_Master> res = tmm.ActivateTestMaster(id);

            if (res.Errors.Count > 0)
            {
                ErrorViewModel ErrnotifyObj = new ErrorViewModel()
                {
                    Title = "Geçersiz İşlem",
                    Items = res.Errors
                };
                return(View("Error", ErrnotifyObj));
            }
            OkViewModel OkntfyObj = new OkViewModel()
            {
                Title          = "Hesap Aktifleştiridi.",
                RedirectingUrl = "/Home/Index"
            };

            OkntfyObj.Items.Add("Hesabınız Aktifleştiridi.. Aramıza Hoşgeldin !");
            return(View("Ok", OkntfyObj));
        }
        public ActionResult TestMasterRegister(TestMasterRegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                TestMasterManager tmm = new TestMasterManager();
                BusinessLayerResult <Test_Master> res = tmm.RegisterTestMaster(model);

                if (res.Errors.Count > 0)
                {
                    res.Errors.ForEach(x => ModelState.AddModelError("", x.Message));
                    return(View(model));
                }

                OkViewModel ntfobj = new OkViewModel()
                {
                    Title          = "Kayıt Başarılı",
                    RedirectingUrl = "/Home/Index",
                };
                ntfobj.Items.Add("Lütfen e-posta adresinize gönderdiğimiz aktivasyon linkine tıklayarak hesabınızı aktive ediniz..");
                return(View("Ok", ntfobj));
            }
            return(View(model));
        }
Exemple #7
0
        public ActionResult Applicants(SelectAdvTestMasterViewModel tm)
        {
            if (ModelState.IsValid)
            {
                TestMasterManager tmm = new TestMasterManager();
                if (tm == null)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                }

                Job_Adv job_Adv = jobAdvManager.Find(x => x.JobAdvId == tm.Adv_Id);
                if (job_Adv == null)
                {
                    return(HttpNotFound());
                }
                job_Adv.SelectedTestMaster = tmm.GetTestMasterById(tm.selectedTestMasterId).Result;

                if (jobAdvManager.Update(job_Adv) > 0)
                {
                    foreach (var item in jobAppManager.List(x => x.Job_Adv.JobAdvId == job_Adv.JobAdvId))
                    {
                        jobAppManager.Delete(item);
                    }
                    Test_Master selectedTM = tmm.GetTestMasterById(tm.selectedTestMasterId).Result;
                    OkViewModel OkntfyObj  = new OkViewModel()
                    {
                        Title              = "Atama Başarılı..",
                        RedirectingUrl     = "/Job_Adv/Details/" + tm.Adv_Id,
                        RedirectingTimeout = 3000
                    };
                    OkntfyObj.Items.Add("Test Master " + selectedTM.user_name + " " + selectedTM.user_surname + " Başarılı bir şekilde " + job_Adv.job_adv_title + " görevine atandı..!");
                    return(View("Ok", OkntfyObj));
                }
            }
            return(View(tm));
        }