Exemplo n.º 1
0
        private static WorkScheduleType FillObjectFromRowData(DataRow returnRow)
        {
            WorkScheduleType WorkSchedule = new WorkScheduleType();

            if (returnRow["WorkScheduleTypeID"] != DBNull.Value)
            {
                WorkSchedule.WorkScheduleTypeID = (int)returnRow["WorkScheduleTypeID"];
            }

            if (returnRow["WorkScheduleTypeAbbrev"] != DBNull.Value)
            {
                WorkSchedule.WorkScheduleTypeAbbrev = returnRow["WorkScheduleTypeAbbrev"].ToString();
            }

            if (returnRow["WorkScheduleTypeDesc"] != DBNull.Value)
            {
                WorkSchedule.WorkScheduleTypeDesc = returnRow["WorkScheduleTypeDesc"].ToString();
            }


            if (returnRow["IsActive"] != DBNull.Value)
            {
                WorkSchedule.IsActive = (bool)returnRow["IsActive"];
            }

            if (returnRow["DisplayAs"] != DBNull.Value)
            {
                WorkSchedule.DisplayAs = returnRow["DisplayAs"].ToString();
            }

            return(WorkSchedule);
        }
Exemplo n.º 2
0
        public static List <WorkScheduleType> GetAllWorkScheduleTypes()
        {
            List <WorkScheduleType> listCollection = new List <WorkScheduleType>();

            DataTable dataItems = ExecuteDataTable("spr_GetAllWorkScheduleTypes");

            if (dataItems != null)
            {
                for (int i = 0; i < dataItems.Rows.Count; i++)
                {
                    WorkScheduleType item = new WorkScheduleType();
                    item = GetWorkScheduleType(dataItems.Rows[i]);
                    listCollection.Add(item);
                }
            }
            else
            {
                throw new Exception("You cannot create a Work Schedule Type collection from a null data table.");
            }

            return(listCollection);
        }