public static TMSPriviledgeUserDetails Get(System.Int64 pudUserId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSPriviledgeUserDetails instance; instance = new TMSPriviledgeUserDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSPriviledgeUserDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, pudUserId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0)// throw new ApplicationException("Could not get TMSPriviledgeUserDetails ID:" + pudUserId.ToString()+ " from Database."); // Return results. { return(null); } ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSPriviledgeUserDetails[] Search(System.Int64?pudUserId, System.Int64?pudUserLoginId, System.String pudUserLoginType, System.String pudTitle, System.String pudFirstName, System.String pudMiddleName, System.String pudLastName, System.String pudHighestDegreeCompletd, System.String pudEmailId, System.String pudMobileNo, System.String pudAddress, System.Int64?pudCountryId, System.Int64?pudStateId, System.Int64?pudCityId, System.Int64?pudAddedById, System.String pudAddedByType, System.String pudUserType, System.DateTime?pudDate, System.Int32?pudStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSPriviledgeUserDetails_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, pudUserId, pudUserLoginId, pudUserLoginType, pudTitle, pudFirstName, pudMiddleName, pudLastName, pudHighestDegreeCompletd, pudEmailId, pudMobileNo, pudAddress, pudCountryId, pudStateId, pudCityId, pudAddedById, pudAddedByType, pudUserType, pudDate, pudStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSPriviledgeUserDetails.MapFrom(ds)); }
public static TMSPriviledgeUserDetails[] MapFrom(DataSet ds) { List <TMSPriviledgeUserDetails> objects; // Initialise Collection. objects = new List <TMSPriviledgeUserDetails>(); // 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_PriviledgeUserDetails] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_PriviledgeUserDetails] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSPriviledgeUserDetails instance = new TMSPriviledgeUserDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static DataSet GetSearch(TMSPriviledgeUserDetails searchObject) { return(GetSearch(searchObject.PUDUserId, searchObject.PUDUserLoginId, searchObject.PUDUserLoginType, searchObject.PUDTitle, searchObject.PUDFirstName, searchObject.PUDMiddleName, searchObject.PUDLastName, searchObject.PUDHighestDegreeCompletd, searchObject.PUDEmailId, searchObject.PUDMobileNo, searchObject.PUDAddress, searchObject.PUDCountryId, searchObject.PUDStateId, searchObject.PUDCityId, searchObject.PUDAddedById, searchObject.PUDAddedByType, searchObject.PUDUserType, searchObject.PUDDate, searchObject.PUDStatus)); }
public static void Update(TMSPriviledgeUserDetails tMSPriviledgeUserDetails, DbTransaction transaction) { tMSPriviledgeUserDetails.Update(transaction); }
public static void Update(TMSPriviledgeUserDetails tMSPriviledgeUserDetails) { tMSPriviledgeUserDetails.Update(); }
public static DataSet GetSearch(TMSPriviledgeUserDetails searchObject) { return GetSearch(searchObject.PUDUserId, searchObject.PUDUserLoginId, searchObject.PUDUserLoginType, searchObject.PUDTitle, searchObject.PUDFirstName, searchObject.PUDMiddleName, searchObject.PUDLastName, searchObject.PUDHighestDegreeCompletd, searchObject.PUDEmailId, searchObject.PUDMobileNo, searchObject.PUDAddress, searchObject.PUDCountryId, searchObject.PUDStateId, searchObject.PUDCityId, searchObject.PUDAddedById, searchObject.PUDAddedByType, searchObject.PUDUserType, searchObject.PUDDate, searchObject.PUDStatus); }
public static TMSPriviledgeUserDetails[] MapFrom(DataSet ds) { List<TMSPriviledgeUserDetails> objects; // Initialise Collection. objects = new List<TMSPriviledgeUserDetails>(); // 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_PriviledgeUserDetails] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_PriviledgeUserDetails] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSPriviledgeUserDetails instance = new TMSPriviledgeUserDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSPriviledgeUserDetails Get(System.Int64 pudUserId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSPriviledgeUserDetails instance; instance = new TMSPriviledgeUserDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSPriviledgeUserDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, pudUserId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0)// throw new ApplicationException("Could not get TMSPriviledgeUserDetails ID:" + pudUserId.ToString()+ " from Database."); // Return results. return null; ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }