// GFUser註冊 public int EasyRegister(GFUser viewresult) { string sql = @"INSERT INTO HelpUser( UserID,User_Password,Nickname,Phone,Gender,Email) VALUES( @UserID,@User_Password,@Nickname,@Phone,@Gender,@Email )"; int Id; using (SqlConnection conn = new SqlConnection(this.GetDBConnectionString())) { conn.Open(); SqlCommand cmd = new SqlCommand(sql, conn); cmd.Parameters.Add(new SqlParameter("@UserID", viewresult.UserID)); cmd.Parameters.Add(new SqlParameter("@User_Password", viewresult.User_Password)); cmd.Parameters.Add(new SqlParameter("@Nickname", viewresult.Nickname)); cmd.Parameters.Add(new SqlParameter("@Phone", viewresult.Phone)); cmd.Parameters.Add(new SqlParameter("@Gender", viewresult.Gender)); cmd.Parameters.Add(new SqlParameter("@Email", viewresult.Email)); SqlDataAdapter sqlAdapter = new SqlDataAdapter(cmd); Id = Convert.ToInt32(cmd.ExecuteNonQuery()); conn.Close(); } return(Id); }
public JsonResult EasyRegister(GFUser data) { return(this.Json(lbService.EasyRegister(data))); }
public int EasyRegister(GFUser viewresult) { return(lbDao.EasyRegister(viewresult)); }