<commit_before>package com.dutproject.cinemaproject.controller.schedule;

import com.dutproject.cinemaproject.controller.BaseServlet;
import com.dutproject.cinemaproject.model.bean.schedule.Schedule;
import com.dutproject.cinemaproject.model.bo.schedule.ScheduleBO;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class CreateScheduleServlet
 */
@WebServlet(name = "CreateSchedule", urlPatterns = { "/CreateSchedule" })
public class CreateScheduleServlet extends BaseServlet {
	private static final long serialVersionUID = 1L;

	@Override
	protected void doWork(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		/*check login with schedule manager account*/
		if (!ScheduleManagementHelper.isLogined(request, response)) {
			request.getRequestDispatcher("/Logout").forward(request, response);
			return;
		}
		
		String str_filmId = request.getParameter("filmId");
		String str_roomId = request.getParameter("roomId");
		String str_date = request.getParameter("date");
		String str_startTime = request.getParameter("startTime");
		String str_endTime = request.getParameter("endTime");
		
		int filmId = Integer.parseInt(str_filmId);
		int roomId = Integer.parseInt(str_roomId);
		int startTime = Integer.parseInt(str_startTime);
		int endTime = Integer.parseInt(str_endTime);
		
		int startTimeInSeconds = 0;
		int endTimeInSeconds = 0;
		
		Schedule schedule = new Schedule(filmId, roomId, startTimeInSeconds, endTimeInSeconds);
		ScheduleBO scheduleBO = new ScheduleBO();
		scheduleBO.createSchedule(schedule);
	}

}<commit_msg>- complete create schedule servlet<commit_after>package com.dutproject.cinemaproject.controller.schedule;

import com.dutproject.cinemaproject.controller.BaseServlet;
import com.dutproject.cinemaproject.model.bean.schedule.Schedule;
import com.dutproject.cinemaproject.model.bo.schedule.ScheduleBO;
import com.dutproject.cinemaproject.utils.schedule.Converter;

import java.io.IOException;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class CreateScheduleServlet
 */
@WebServlet(name = "CreateSchedule", urlPatterns = { "/CreateSchedule" })
public class CreateScheduleServlet extends BaseServlet {
	private static final long serialVersionUID = 1L;

	@Override
	protected void doWork(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		/*check login with schedule manager account*/
		if (!ScheduleManagementHelper.isLogined(request, response)) {
			request.getRequestDispatcher("/Logout").forward(request, response);
			return;
		}
		
		String str_date = request.getParameter("date");
		String str_startTime = request.getParameter("startTime");
		String str_endTime = request.getParameter("endTime");
		
		int filmId = Integer.parseInt(request.getParameter("filmId"));
		int roomId = Integer.parseInt(request.getParameter("roomId"));
		Date startTime = Converter.stringToDate(str_startTime + " " + str_date);
		Date endTime = Converter.stringToDate(str_endTime + " " + str_date);
		
		int startTimeInSeconds = Converter.dateToInt(startTime);
		int endTimeInSeconds = Converter.dateToInt(endTime);
		
		Schedule schedule = new Schedule(filmId, roomId, startTimeInSeconds, endTimeInSeconds);
		ScheduleBO scheduleBO = new ScheduleBO();
		boolean isSuccessful = scheduleBO.createSchedule(schedule);
		
		request.setAttribute("isCreatedSuccessfully", isSuccessful);
		request.getRequestDispatcher("/ScheduleManagement").forward(request, response);
	}

}
{'fraction_non_alphanumeric': 0.10038910505836576, 'fraction_numerical': 0.0010376134889753567, 'mean_word_length': 6.23452157598499, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5456540', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1069, 'n_words': 218}