コード例 #1
0
        public ActionResult CreateLogin(String userName, String password, String email, String phone, int age, String education, String gender)
        {
            usr_login user = new usr_login();

            Console.WriteLine("userName " + userName);
            Console.WriteLine("password " + password);
            // Console.WriteLine("fastName " + fastName);
            // Console.WriteLine("lastName " + lastName);


            if (!String.IsNullOrEmpty(userName) && !String.IsNullOrEmpty(password) && !String.IsNullOrEmpty(email))
            {
                user.email     = email;
                user.tel       = phone;
                user.usr_id    = userName;
                user.pass      = password;
                user.age       = age;
                user.gender    = gender;
                user.education = education;
                dbContext.Add(user);

                dbContext.SaveChanges();
                ViewBag.MandatoryCheck = "User Created Successfully.";
            }
            else
            {
                ViewBag.MandatoryCheck = "Please enter values for the Mandatory fields marked in *.";
            }

            return(View("Index"));
        }
コード例 #2
0
        public ActionResult LoginResults(String user, String password)
        {
            usr_login user1 = new usr_login();

            user1.usr_id = user;
            user1.pass   = password;

            /*go to plan if user & pass are correct */


            if (!String.IsNullOrEmpty((string)user1.user) && !String.IsNullOrEmpty((string)user1.password))
            {
                return(View("Plan"));
            }
            else
            {
                return(View("Index"));
            }
        }