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); }
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); }
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); }
/// <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)); }