Пример #1
0
        public static PositionWorkflowStatusCollection SearchPositionsDescription(long positionDescriptionID, int PDCreatorID, int organizationCodeID)
        {
            PositionWorkflowStatusCollection PWSCollection = new PositionWorkflowStatusCollection();

            try
            {
                DbCommand commandWrapper = GetDbCommand("spr_SearchPositionDescriptions");

                if (positionDescriptionID == -1)
                {
                    commandWrapper.Parameters.Add(new SqlParameter("@positionDescriptionID", DBNull.Value));
                }
                else
                {
                    commandWrapper.Parameters.Add(new SqlParameter("@positionDescriptionID", positionDescriptionID));
                }

                if (PDCreatorID == -1)
                {
                    commandWrapper.Parameters.Add(new SqlParameter("@PDCreatorID", DBNull.Value));
                }
                else
                {
                    commandWrapper.Parameters.Add(new SqlParameter("@PDCreatorID", PDCreatorID));
                }

                if (organizationCodeID == -1)
                {
                    commandWrapper.Parameters.Add(new SqlParameter("@organizationCodeID", DBNull.Value));
                }
                else
                {
                    commandWrapper.Parameters.Add(new SqlParameter("@organizationCodeID", organizationCodeID));
                }

                PWSCollection = PositionWorkflowStatus.GetCollection(ExecuteDataTable(commandWrapper));
            }
            catch (Exception ex)
            {
                HandleException(ex);
            }

            return(PWSCollection);
        }
Пример #2
0
        internal static PositionWorkflowStatusCollection GetCollection(DataTable dataItems)
        {
            PositionWorkflowStatusCollection listCollection = new PositionWorkflowStatusCollection();
            PositionWorkflowStatus           current        = null;

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

            return(listCollection);
        }