src/java/Servlet/ServletBuying.java
@Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
            String urunAdi = request.getParameter("urunAdi");
            float ucret = Float.parseFloat(request.getParameter("ucret"));
            float kdv = Float.parseFloat(request.getParameter("kdv"));
            int adet = Integer.parseInt(request.getParameter("adet"));
            String musteriAdi = request.getParameter("musteriAdi");
            String sirketAdi = request.getParameter("sirketAdi");
            String telefon = request.getParameter("tel");
            HttpSession session=request.getSession(); 
            int x = (int) session.getAttribute("id");
            Buying alis = new Buying(urunAdi, ucret, kdv, adet, musteriAdi, sirketAdi, telefon, x);
            StokList stoklist = new StokList(urunAdi, ucret, kdv, adet, x);
            UserDatabase regUser = new UserDatabase(Conn.getConnection());
            
            if (regUser.urunKayit(alis, stoklist)) {
                String mesaj = "mesaj";
                session.setAttribute("mesaj",mesaj); 
               response.sendRedirect("buying.jsp");
            } else {
                response.sendRedirect("error.jsp");
            }    
        
        processRequest(request, response);
    }
/**
     * Handles the HTTP <code>POST</code> method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
Handles the HTTP POST method.
@param request servlet request
@param response servlet response
@throws ServletException if a servlet-specific error occurs
@throws IOException if an I/O error occurs
Handles the HTTP POST method . @param request servlet request @param response servlet response @throws ServletException if a servlet - specific error occurs @throws IOException if an I / O error occurs
@Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
            String urunAdi = request.getParameter("urunAdi");
            float ucret = Float.parseFloat(request.getParameter("ucret"));
            float kdv = Float.parseFloat(request.getParameter("kdv"));
            int adet = Integer.parseInt(request.getParameter("adet"));
            String musteriAdi = request.getParameter("musteriAdi");
            String sirketAdi = request.getParameter("sirketAdi");
            String telefon = request.getParameter("tel");
            HttpSession session=request.getSession(); 
            int x = (int) session.getAttribute("id");
            Buying alis = new Buying(urunAdi, ucret, kdv, adet, musteriAdi, sirketAdi, telefon, x);
            StokList stoklist = new StokList(urunAdi, ucret, kdv, adet, x);
            UserDatabase regUser = new UserDatabase(Conn.getConnection());
            if (regUser.urunKayit(alis, stoklist)) {
                String mesaj = "mesaj";
                session.setAttribute("mesaj",mesaj); 
               response.sendRedirect("buying.jsp");
            } else {
                response.sendRedirect("error.jsp");
            }    
        processRequest(request, response);
    }
@ Override protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { String urunAdi = request . getParameter ( "urunAdi" ) ; float ucret = Float . parseFloat ( request . getParameter ( "ucret" ) ) ; float kdv = Float . parseFloat ( request . getParameter ( "kdv" ) ) ; int adet = Integer . parseInt ( request . getParameter ( "adet" ) ) ; String musteriAdi = request . getParameter ( "musteriAdi" ) ; String sirketAdi = request . getParameter ( "sirketAdi" ) ; String telefon = request . getParameter ( "tel" ) ; HttpSession session = request . getSession ( ) ; int x = ( int ) session . getAttribute ( "id" ) ; Buying alis = new Buying ( urunAdi , ucret , kdv , adet , musteriAdi , sirketAdi , telefon , x ) ; StokList stoklist = new StokList ( urunAdi , ucret , kdv , adet , x ) ; UserDatabase regUser = new UserDatabase ( Conn . getConnection ( ) ) ; if ( regUser . urunKayit ( alis , stoklist ) ) { String mesaj = "mesaj" ; session . setAttribute ( "mesaj" , mesaj ) ; response . sendRedirect ( "buying.jsp" ) ; } else { response . sendRedirect ( "error.jsp" ) ; } processRequest ( request , response ) ; }
Handles the HTTP <code>POST</code> method.
Handles the HTTP <code > POST< / code > method .