예제 #1
0
파일: CSS.cs 프로젝트: bwaddell/BAISTRepo
    public bool DeleteEventData(Event eve)
    {
        bool Confirmation;
        EvaluationDirector Controller = new EvaluationDirector();

        Confirmation = Controller.DeleteEventData(eve);
        return(Confirmation);
    }
예제 #2
0
파일: CSS.cs 프로젝트: bwaddell/BAISTRepo
    public List <Evaluation> GetEvaluatorEvaluations(int EventID, int EvaluatorID)
    {
        List <Evaluation>  EvaluatorEvents = new List <Evaluation>();
        EvaluationDirector Controller      = new EvaluationDirector();

        EvaluatorEvents = Controller.GetEvaluationsForEventEvaluator(EventID, EvaluatorID);
        return(EvaluatorEvents);
    }
예제 #3
0
파일: CSS.cs 프로젝트: bwaddell/BAISTRepo
    public List <Evaluation> GetCurrentEventData(Event currentEvent)
    {
        List <Evaluation>  evals      = new List <Evaluation>();
        EvaluationDirector Controller = new EvaluationDirector();

        evals = Controller.GetCurrentEventData(currentEvent);
        return(evals);
    }
예제 #4
0
파일: CSS.cs 프로젝트: bwaddell/BAISTRepo
    /// <summary>
    /// Function is called from front end to add evaluation
    /// data to SQL Server
    /// </summary>
    public bool AddEvaluation(Evaluation evaluation) //change name later??
    {
        bool Confirmation             = false;
        EvaluationDirector Controller = new EvaluationDirector();

        Confirmation = Controller.CreateEvaluation(evaluation);

        return(Confirmation);
    }
예제 #5
0
파일: CSS.cs 프로젝트: bwaddell/BAISTRepo
    public List <Evaluation> GetEventData(int EventID)
    {
        //List<Evaluator> evaluators = new List<Evaluator>();
        List <Evaluation>  evaluations = new List <Evaluation>();
        EvaluationDirector Controller  = new EvaluationDirector();

        evaluations = Controller.GetAllEventData(EventID);

        return(evaluations);
    }
예제 #6
0
    public List <Evaluator> GetEvaluatorsForEvent(int eventID)
    {
        List <Evaluator>   listOfEvaluators = new List <Evaluator>();
        EvaluationDirector evalD            = new EvaluationDirector();

        ConnectionStringSettings webSettings = ConfigurationManager.ConnectionStrings["localdb"];
        SqlConnection            DataBaseCon = new SqlConnection(webSettings.ConnectionString);

        DataBaseCon.ConnectionString = webSettings.ConnectionString;

        try
        {
            DataBaseCon.Open();

            SqlCommand CommandGet = new SqlCommand();
            CommandGet.Connection  = DataBaseCon;
            CommandGet.CommandType = CommandType.StoredProcedure;
            CommandGet.CommandText = "GetEventEvaluators";

            SqlParameter GetParameter = new SqlParameter();
            GetParameter.ParameterName = "@EventID";
            GetParameter.SqlDbType     = SqlDbType.Int;
            GetParameter.Direction     = ParameterDirection.Input;
            GetParameter.Value         = eventID;
            CommandGet.Parameters.Add(GetParameter);

            DataSet myDataSet = new DataSet();
            myDataSet.DataSetName = "GetEvaluators";
            myDataSet.Tables.Add("Evaluators");

            SqlDataAdapter myDataAdapter = new SqlDataAdapter();
            myDataAdapter.SelectCommand = CommandGet;
            myDataAdapter.Fill(myDataSet, "Evaluators");


            DataTable myDataTable = new DataTable();
            myDataTable = myDataSet.Tables["Evaluators"];

            int numrows = myDataTable.Rows.Count;


            foreach (DataRow dataRow in myDataTable.Rows)
            {
                Evaluator evaluator = new Evaluator();

                evaluator.EvaluatorID = Convert.ToInt32(dataRow["EvaluatorID"]);

                if (dataRow["Name"] != DBNull.Value)
                {
                    evaluator.Name = dataRow["Name"].ToString();
                }
                if (dataRow["VotingCriteria"] != DBNull.Value)
                {
                    evaluator.Criteria = dataRow["VotingCriteria"].ToString();
                }

                listOfEvaluators.Add(evaluator);

                //call GetEvaluationsForEventEvaluator
                evaluator.EvaluatorEvaluations =
                    evalD.GetEvaluationsForEventEvaluator(eventID, evaluator.EvaluatorID);
            }
        }
        catch (Exception)
        {
        }
        finally
        {
            DataBaseCon.Close();
        }
        return(listOfEvaluators);
    }