Exemplo n.º 1
0
 public ActionResult ReadMoreUesrInfo(int id)
 {
     if (Session["adminname"] != null)
     {
         User_s_tbl ur = dc.User_s_tbl.Find(id);
         ViewData["UserReadMoreInfo"] = ur;
         return(View());
     }
     else
     {
         return(RedirectToAction("Login", "Admin"));
     }
 }
 public ActionResult viewprofile()
 {
     if (Session["UserLogin"] != null)
     {
         int        uid  = Convert.ToInt16(Session["UserLogin"]);
         User_s_tbl utbl = (from n in dc.User_s_tbl where n.User_S_Id == uid select n).FirstOrDefault();
         ViewData["upro"] = utbl;
         return(View());
     }
     else
     {
         return(RedirectToAction("UserLogin", "UserHome"));
     }
 }
        public ActionResult UserReg(FormCollection fc)
        {
            string email = fc["email"];

            var p = (from n in dc.User_s_tbl where n.User_S_Email_Id == email select n).Count();

            if (p == 0)
            {
                string     pass   = fc["pass"];
                string     fname  = fc["fname"];
                string     mname  = fc["mname"];
                string     lname  = fc["lname"];
                string     cpass  = fc["c_pass"];
                string     mob    = fc["mob"];
                string     gender = fc["gender"];
                string     add    = fc["add"];
                string     pin    = fc["pin"];
                User_s_tbl ur     = new User_s_tbl();
                ur.User_S_fName     = fname;
                ur.User_S_mName     = mname;
                ur.User_s_lName     = lname;
                ur.User_S_Password  = pass;
                ur.User_S_Email_Id  = email;
                ur.User_S_Mobile_No = decimal.Parse(mob);
                ur.User_S_Gender    = gender;
                ur.User_reg_date    = Convert.ToString(String.Format("{0:dd-MM-yyyy}", DateTime.Now));
                ur.User_S_City      = fc["city"];
                ur.status           = "Registred";
                ur.User_S_DOB       = Convert.ToString(String.Format("{0:dd-MM-yyyy}", fc["User_S_DOB"]));
                ur.User_S_Address   = add;
                ur.User_S_Pincode   = int.Parse(pin);
                dc.User_s_tbl.Add(ur);
                dc.SaveChanges();
                TempData["ureg"] = "You are Successful Registred";
                return(RedirectToAction("UserLogin", "UserHome"));
            }
            else
            {
                TempData["eid"] = "Enter Unique Email Address";
                return(View());
            }
        }