Example #1
0
        public static AssignableContractorList GetAssignedContractors(JobRequest jobrequest)
        {
            string storedProcedureName = "usp_getAssignedContractors";

            MySqlParameter[] parameterList = new MySqlParameter[]
            {
                new MySqlParameter("jobRequestIDIn", jobrequest.JobRequestID)
            };

            MySqlDataReader result = ExecuteReader(storedProcedureName, parameterList);

            AssignableContractorList assignableContractorList = new AssignableContractorList();

            while (result.Read())
            {
                assignableContractorList.Add(new AssignableContractor(
                                                 result.GetInt32("contractorID"),
                                                 result.GetString("firstName"),
                                                 result.GetString("lastName"),
                                                 result.GetString("address"),
                                                 result.GetString("state"),
                                                 new Suburb(result.GetString("suburb")),
                                                 result.GetString("mobile"),
                                                 result.GetString("email"),
                                                 DAL.HasSkillList(new Contractor(result.GetInt32("contractorID"))),
                                                 true,
                                                 result.GetTimeSpan("startTime"),
                                                 result.GetTimeSpan("endTime"),
                                                 result.GetInt32("status")));
            }

            result.Close();

            return(assignableContractorList);
        }
 private void LoadSelectedJobRequest()
 {
     AssignableContractorList = DAL.GetAssignedContractors(SelectedJobRequest);
     foreach (AssignableContractor contractor in DAL.GetAssignableContractors(SelectedJobRequest))
     {
         AssignableContractorList.Add(contractor);
     }
     JobRequestSkillList  = DAL.GetRequiredSkills(SelectedJobRequest);
     NonRequiredSkillList = DAL.GetNonRequiredSkills(SelectedJobRequest);
     EstimatedHours       = SelectedJobRequest.EstimatedHours;
     if (SelectedJobRequest.Status == 0)
     {
         MarkedAsReady = false;
     }
     else
     {
         MarkedAsReady = true;
     }
 }