public static TMSFeesAndPaymentDetails Get(System.Int64 sfpDetailsId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSFeesAndPaymentDetails instance; instance = new TMSFeesAndPaymentDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSFeesAndPaymentDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, sfpDetailsId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) { throw new ApplicationException("Could not get TMSFeesAndPaymentDetails ID:" + sfpDetailsId.ToString() + " from Database."); } // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSFeesAndPaymentDetails[] Search(System.Int64?sfpDetailsId, System.Int64?sfpStudentLoginId, System.Int64?sfpStandardId, System.Int64?sfpDivisionId, System.Double?sfpTotalFees, System.Double?sftPaidFees, System.Double?sfpRemainingFees, System.String sfpMonth, System.String sfpYear, System.DateTime?sfpTransactionDate, System.Int64?sfpAddedById, System.String sfpAddedByRemark, System.String sfpOtherRemark, System.DateTime?sfpDate, System.Int32?sfpStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSFeesAndPaymentDetails_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, sfpDetailsId, sfpStudentLoginId, sfpStandardId, sfpDivisionId, sfpTotalFees, sftPaidFees, sfpRemainingFees, sfpMonth, sfpYear, sfpTransactionDate, sfpAddedById, sfpAddedByRemark, sfpOtherRemark, sfpDate, sfpStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSFeesAndPaymentDetails.MapFrom(ds)); }
public static TMSFeesAndPaymentDetails[] MapFrom(DataSet ds) { List <TMSFeesAndPaymentDetails> objects; // Initialise Collection. objects = new List <TMSFeesAndPaymentDetails>(); // 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_FeesAndPaymentDetails] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_FeesAndPaymentDetails] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSFeesAndPaymentDetails instance = new TMSFeesAndPaymentDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static TMSFeesAndPaymentDetails[] MapFrom(DataSet ds) { List<TMSFeesAndPaymentDetails> objects; // Initialise Collection. objects = new List<TMSFeesAndPaymentDetails>(); // 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_FeesAndPaymentDetails] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_FeesAndPaymentDetails] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSFeesAndPaymentDetails instance = new TMSFeesAndPaymentDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSFeesAndPaymentDetails Get(System.Int64 sfpDetailsId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSFeesAndPaymentDetails instance; instance = new TMSFeesAndPaymentDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSFeesAndPaymentDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, sfpDetailsId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) throw new ApplicationException("Could not get TMSFeesAndPaymentDetails ID:" + sfpDetailsId.ToString()+ " from Database."); // Return results. ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }