Project_Marmelade.WorkPlanFilterData.GetEmployeeShift C# (CSharp) Method

GetEmployeeShift() public method

public GetEmployeeShift ( ) : List
return List
        public List<string> GetEmployeeShift()
        {
            List<string> workShiftTypes = new List<string>();
            try
            {
                conn.Open();
                SqlCommand sqlcmd = new SqlCommand("getEmployeeType", conn);
                sqlcmd.CommandType = CommandType.StoredProcedure;

                DataTable table = new DataTable();
                SqlDataAdapter adapter = new SqlDataAdapter(sqlcmd);
                adapter.Fill(table);
                SqlDataReader reader = sqlcmd.ExecuteReader();
                reader.Read();
                foreach (DataRow row in table.Rows)
                {
                    string aWorkShiftTypes = row["idEmployeeType"].ToString() +","+ row["typeName"].ToString();
                    workShiftTypes.Add(aWorkShiftTypes);
                }
                conn.Close();
                return workShiftTypes;
            }
            catch (Exception e)
            {
                return workShiftTypes;
                throw e;
            }
        }
        public List<string> GetTypeOfEmployee()

Usage Example

 public List<string> GetEmployeeShift()
 {
     WorkPlanFilterData newData = new WorkPlanFilterData();
     return newData.GetEmployeeShift();
 }