コード例 #1
0
        public ActionResult UserLogin(FormCollection collection)
        {
            if (ModelState.IsValid)
            {
                int ret = 0;
                int userid = 0;
                string username = "";
                UserPhotoGalleryMaster objUserPhotoGalleryMaster = new UserPhotoGalleryMaster();
                objUserPhotoGalleryMaster.Email = collection["Email"].ToString();
                objUserPhotoGalleryMaster.Password = collection["Password"].ToString();
                ret = objUserPhotoGalleryService.LoginUser(objUserPhotoGalleryMaster, out userid, out username);


                if (ret > 0)
                {
                    Session["Userid"] = userid;
                    Session["UserName"] = username;
                    return RedirectToAction("Index", "ManagePhotoGallery");
                }
                else
                {
                    ViewBag.Msg = "Invalid login Details";
                }
            }
            return View();
        }
コード例 #2
0
        public ActionResult RegisterUser(FormCollection collection)
        {
            UserPhotoGalleryMaster objUserPhotoGalleryMaster = new UserPhotoGalleryMaster();
            objUserPhotoGalleryMaster.UserName = collection["Username"].ToString();
            objUserPhotoGalleryMaster.Email = collection["Email"].ToString();
            objUserPhotoGalleryMaster.Password = collection["Password"].ToString();

            objUserPhotoGalleryService.RegisterUser(objUserPhotoGalleryMaster);
            return View();
        }
コード例 #3
0
 public ActionResult Index(FormCollection collection)
 {
     string userid = Session["Userid"].ToString();
     HttpPostedFileBase file = Request.Files["ImageData"];
     UserPhotoGalleryMaster objUserPhotoGalleryMaster = new UserPhotoGalleryMaster();
     objUserPhotoGalleryMaster.ImageName = collection["ImageName"].ToString();
     objUserPhotoGalleryMaster.Fk_UserId = Convert.ToInt32(userid);
     objUserPhotoGalleryMaster.Image = ConvertToBytes(file);
     objUserPhotoGalleryService.UploadAlbums(objUserPhotoGalleryMaster);
     return View(objUserPhotoGalleryService.GetAlbums(Convert.ToInt32(userid)).ToList());
 }