private static OrgPositionType GetOrgPositionType(DataRow singleRowData)
        {
            // Load Object by dataRow
            OrgPositionType orgpositiontype = new OrgPositionType();

            try
            {
                orgpositiontype = FillObjectFromRowData(singleRowData);
            }
            catch (Exception ex)
            {
                HandleException(ex);
            }

            return(orgpositiontype);
        }
        public OrgPositionType GetOrgPositionType(long loadByID)
        {
            // Load Object by ID
            DataTable       returnTable;
            OrgPositionType orgpositiontype = new OrgPositionType();

            try
            {
                returnTable     = ExecuteDataTable("spr_GetOrgPositionTypeByID", loadByID);
                orgpositiontype = loadData(returnTable);
            }
            catch (Exception ex)
            {
                HandleException(ex);
            }

            return(orgpositiontype);
        }
        public static List <OrgPositionType> GetAllOrgPositionTypes()
        {
            List <OrgPositionType> listCollection = new List <OrgPositionType>();
            OrgPositionType        item           = new OrgPositionType();
            DataTable dataItems = ExecuteDataTable("spr_GetAllOrgPositionTypes");

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

            return(listCollection);
        }
        private static OrgPositionType FillObjectFromRowData(DataRow returnRow)
        {
            OrgPositionType OrgPosType = new OrgPositionType();

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

            if (returnRow["OrgPositionType"] != DBNull.Value)
            {
                OrgPosType.OrgPositionTypeDesc = returnRow["OrgPositionType"].ToString();
            }

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


            return(OrgPosType);
        }
Exemple #5
0
        /// <summary>
        /// Determines whether the specified System.Object is equal to the current object.
        /// </summary>
        /// <param name="obj">The System.Object to compare with the current object.</param>
        /// <returns>Returns true if the specified System.Object is equal to the current object; otherwise, false.</returns>
        public override bool Equals(Object obj)
        {
            OrgPositionType OrgPositionobj = obj as OrgPositionType;

            return((OrgPositionobj == null) ? false : (this.OrgPositionTypeID == OrgPositionobj.OrgPositionTypeID));
        }