public ActionResult AdminCreateAccountPhotoGrapher(PhotoGrapher pht)
        {
            if (ModelState.IsValid)
            {
                var isExist    = em.PhotoGrapherEmail(pht.Email);
                var isUsername = us.Phtusername(pht.UserName);

                if (isExist)
                {
                    ModelState.AddModelError("EmailExist", "Email already exist");
                    return(View(pht));
                }

                else if (isUsername)
                {
                    ModelState.AddModelError("UsernameExist", "Username already exist");
                    return(View(pht));
                }

                else
                {
                    ph.AddPhotoGrapher(pht);

                    return(Redirect("/Admin/allPhotographer"));
                }
            }

            return(View(pht));
        }
Esempio n. 2
0
        //When Register PhotoGrapher Add
        public bool AddPhotoGrapher(PhotoGrapher pht_Add)
        {
            Db.Set <PhotoGrapher>().Add(pht_Add);
            // Add_basicProfile(pht_Add.Email);
            Db.SaveChanges();



            return(true);
        }