예제 #1
0
        private static SupervisoryStatus  GetSupervisoryStatus(DataRow singleRowData)
        {
            // Load Object by dataRow
            SupervisoryStatus obj = new SupervisoryStatus();

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

            return(obj);
        }
예제 #2
0
        public static List <SupervisoryStatus> GetAllSupervisoryStatus()
        {
            List <SupervisoryStatus> listCollection = new List <SupervisoryStatus>();
            SupervisoryStatus        item           = new SupervisoryStatus();
            DataTable dataItems = ExecuteDataTable("spr_GetAllSupervisoryStatus");

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

            return(listCollection);
        }
예제 #3
0
        private static SupervisoryStatus  FillObjectFromRowData(DataRow returnRow)
        {
            SupervisoryStatus obj = new SupervisoryStatus();

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

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

            if (returnRow["Description"] != DBNull.Value)
            {
                obj.SupervisorStatusDescription = returnRow["Description"].ToString();
            }


            return(obj);
        }
예제 #4
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)
      {
          SupervisoryStatus sObj = obj as SupervisoryStatus;

          return((sObj == null) ? false : (this.SupervisorStatusID == sObj.SupervisorStatusID));
      }