Exemplo n.º 1
0
        private void AddInfo()
        {
            Users_Model usermodel = new Users_Model();

            usermodel.LoginPwd = Request.Form["txtpwd"];
            usermodel.NickName = Request.Form["txtnick"];
            usermodel.Sex      = Request.Form["txtsex"];
            usermodel.Age      = Convert.ToInt32(Request.Form["txtage"]);
            usermodel.FaceId   = Convert.ToInt32(Request.Form["txtface"]);
            usermodel.Friend   = Convert.ToInt32(Request.Form["txtfriend"]);
            usermodel.Name     = Request.Form["txtname"];
            usermodel.StarId   = Convert.ToInt32(Request.Form["txtstar"]);
            usermodel.BloodId  = Convert.ToInt32(Request.Form["txtblood"]);
            BLL.User_Service userservice = new BLL.User_Service();
            if (userservice.AddUser(usermodel))
            {
                Response.Redirect("Index.aspx");
            }
            else
            {
                Response.Redirect("Error.html");
            }
        }
Exemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            Users_Model usermodel = new Users_Model();

            usermodel.LoginPwd = context.Request["txtpwd"];
            usermodel.NickName = context.Request["txtnick"];
            usermodel.Sex      = context.Request["txtsex"];
            usermodel.Age      = Convert.ToInt32(context.Request["txtage"]);
            usermodel.FaceId   = Convert.ToInt32(context.Request["txtface"]);
            usermodel.Friend   = Convert.ToInt32(context.Request["txtfriend"]);
            usermodel.Name     = context.Request["txtname"];
            usermodel.StarId   = Convert.ToInt32(context.Request["txtstar"]);
            usermodel.BloodId  = Convert.ToInt32(context.Request["txtblood"]);
            BLL.User_Service userSer = new BLL.User_Service();
            if (userSer.AddUser(usermodel))
            {
                context.Response.Write("yes");
            }
            else
            {
                context.Response.Write("no");
            }
        }