public static TMSExtraActivity Get(System.Int64 exActivityID) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSExtraActivity instance; instance = new TMSExtraActivity(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSExtraActivity_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, exActivityID); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) { throw new ApplicationException("Could not get TMSExtraActivity ID:" + exActivityID.ToString() + " from Database."); } // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSExtraActivity[] Search(System.Int64?exActivityID, System.Int64?exActyvityType, System.String exActivity, System.String exAddedBy, System.DateTime?exDate, System.Int32?exStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSExtraActivity_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, exActivityID, exActyvityType, exActivity, exAddedBy, exDate, exStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSExtraActivity.MapFrom(ds)); }
public static TMSExtraActivity[] MapFrom(DataSet ds) { List <TMSExtraActivity> objects; // Initialise Collection. objects = new List <TMSExtraActivity>(); // Validation. if (ds == null) { throw new ApplicationException("Cannot map to dataset null."); } else if (ds.Tables[TABLE_NAME].Rows.Count == 0) { return(objects.ToArray()); } if (ds.Tables[TABLE_NAME] == null) { throw new ApplicationException("Cannot find table [dbo].[TMS_ExtraActivity] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_ExtraActivity] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSExtraActivity instance = new TMSExtraActivity(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static DataSet GetSearch(TMSExtraActivity searchObject) { return(GetSearch(searchObject.ExActivityID, searchObject.EXActyvityType, searchObject.EXActivity, searchObject.EXAddedBy, searchObject.EXDate, searchObject.EXStatus)); }
public static DataSet GetSearch(TMSExtraActivity searchObject) { return GetSearch(searchObject.ExActivityID, searchObject.EXActyvityType, searchObject.EXActivity, searchObject.EXAddedBy, searchObject.EXDate, searchObject.EXStatus); }
public static void Update(TMSExtraActivity tMSExtraActivity, DbTransaction transaction) { tMSExtraActivity.Update(transaction); }
public static void Update(TMSExtraActivity tMSExtraActivity) { tMSExtraActivity.Update(); }
public static void Update(TMSExtraActivity tMSExtraActivity, DbTransaction transaction) { tMSExtraActivity.Update(transaction); }
public static void Update(TMSExtraActivity tMSExtraActivity) { tMSExtraActivity.Update(); }
public static TMSExtraActivity[] MapFrom(DataSet ds) { List<TMSExtraActivity> objects; // Initialise Collection. objects = new List<TMSExtraActivity>(); // Validation. if (ds == null) throw new ApplicationException("Cannot map to dataset null."); else if (ds.Tables[TABLE_NAME].Rows.Count == 0) return objects.ToArray(); if (ds.Tables[TABLE_NAME] == null) throw new ApplicationException("Cannot find table [dbo].[TMS_ExtraActivity] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_ExtraActivity] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSExtraActivity instance = new TMSExtraActivity(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSExtraActivity Get(System.Int64 exActivityID) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSExtraActivity instance; instance = new TMSExtraActivity(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSExtraActivity_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, exActivityID); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) throw new ApplicationException("Could not get TMSExtraActivity ID:" + exActivityID.ToString()+ " from Database."); // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }