public static TMSVendorDetails Get(System.Int64 vdVendorId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSVendorDetails instance; instance = new TMSVendorDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSVendorDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, vdVendorId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) //throw new ApplicationException("Could not get TMSVendorDetails ID:" + vdVendorId.ToString()+ " from Database."); // Return results. { return(null); } ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom(ds.Tables[0].Rows[0]); return(instance); }
public static TMSVendorDetails[] Search(System.Int64?vdVendorId, System.Int64?vdVendorManagerId, System.String vdVendorDetailsId, System.String vdVendorName, System.String vdReleaventShop, System.String vdContactNo, System.String vdAlternateNumber, System.Int64?vdAddressId, System.String vdShopImage, System.String vdShopMap, System.String vdVendorImage, System.String vdVendorForPrePrimary, System.String vdVendorForPrimary, System.String vdVendorForHighSchool, System.String vdVendorForHouseUniform, System.String vdVendorSchoolUniform, System.String vdVendorSchoolShoes, System.String vdVendorSchoolBooks, System.String vdVendorSchoolBags, System.String vdVendorForBoys, System.String vdVendorForGirls, System.DateTime?vdDate, System.String vdWebsite, System.Int32?vdStatus) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSVendorDetails_SEARCH"; dbCommand = db.GetStoredProcCommand(sqlCommand, vdVendorId, vdVendorManagerId, vdVendorDetailsId, vdVendorName, vdReleaventShop, vdContactNo, vdAlternateNumber, vdAddressId, vdShopImage, vdShopMap, vdVendorImage, vdVendorForPrePrimary, vdVendorForPrimary, vdVendorForHighSchool, vdVendorForHouseUniform, vdVendorSchoolUniform, vdVendorSchoolShoes, vdVendorSchoolBooks, vdVendorSchoolBags, vdVendorForBoys, vdVendorForGirls, vdDate, vdWebsite, vdStatus); ds = db.ExecuteDataSet(dbCommand); ds.Tables[0].TableName = TABLE_NAME; return(TMSVendorDetails.MapFrom(ds)); }
public static TMSVendorDetails[] MapFrom(DataSet ds) { List <TMSVendorDetails> objects; // Initialise Collection. objects = new List <TMSVendorDetails>(); // 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_VendorDetails] in DataSet."); } if (ds.Tables[TABLE_NAME].Rows.Count < 1) { throw new ApplicationException("Table [dbo].[TMS_VendorDetails] is empty."); } // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSVendorDetails instance = new TMSVendorDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return(objects.ToArray()); }
public static DataSet GetSearch(TMSVendorDetails searchObject) { return GetSearch(searchObject.VDVendorId, searchObject.VDVendorManagerId, searchObject.VDVendorDetailsId, searchObject.VDVendorName, searchObject.VDReleaventShop, searchObject.VDContactNo, searchObject.VDAlternateNumber, searchObject.VDAddressId, searchObject.VDShopImage, searchObject.VDShopMap, searchObject.VDVendorImage, searchObject.VDVendorForPrePrimary, searchObject.VDVendorForPrimary, searchObject.VDVendorForHighSchool, searchObject.VDVendorForHouseUniform, searchObject.VDVendorSchoolUniform, searchObject.VDVendorSchoolShoes, searchObject.VDVendorSchoolBooks, searchObject.VDVendorSchoolBags, searchObject.VDVendorForBoys, searchObject.VDVendorForGirls, searchObject.VDDate, searchObject.VDWebsite, searchObject.VDStatus); }
public static DataSet GetSearch(TMSVendorDetails searchObject) { return(GetSearch(searchObject.VDVendorId, searchObject.VDVendorManagerId, searchObject.VDVendorDetailsId, searchObject.VDVendorName, searchObject.VDReleaventShop, searchObject.VDContactNo, searchObject.VDAlternateNumber, searchObject.VDAddressId, searchObject.VDShopImage, searchObject.VDShopMap, searchObject.VDVendorImage, searchObject.VDVendorForPrePrimary, searchObject.VDVendorForPrimary, searchObject.VDVendorForHighSchool, searchObject.VDVendorForHouseUniform, searchObject.VDVendorSchoolUniform, searchObject.VDVendorSchoolShoes, searchObject.VDVendorSchoolBooks, searchObject.VDVendorSchoolBags, searchObject.VDVendorForBoys, searchObject.VDVendorForGirls, searchObject.VDDate, searchObject.VDWebsite, searchObject.VDStatus)); }
public static void Update(TMSVendorDetails tMSVendorDetails, DbTransaction transaction) { tMSVendorDetails.Update(transaction); }
public static void Update(TMSVendorDetails tMSVendorDetails) { tMSVendorDetails.Update(); }
public static TMSVendorDetails[] MapFrom(DataSet ds) { List<TMSVendorDetails> objects; // Initialise Collection. objects = new List<TMSVendorDetails>(); // 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_VendorDetails] in DataSet."); if (ds.Tables[TABLE_NAME].Rows.Count < 1) throw new ApplicationException("Table [dbo].[TMS_VendorDetails] is empty."); // Map DataSet to Instance. foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows) { TMSVendorDetails instance = new TMSVendorDetails(); instance.MapFrom(dr); objects.Add(instance); } // Return collection. return objects.ToArray(); }
public static TMSVendorDetails Get(System.Int64 vdVendorId) { DataSet ds; Database db; string sqlCommand; DbCommand dbCommand; TMSVendorDetails instance; instance = new TMSVendorDetails(); db = DatabaseFactory.CreateDatabase(); sqlCommand = "[dbo].gspTMSVendorDetails_SELECT"; dbCommand = db.GetStoredProcCommand(sqlCommand, vdVendorId); // Get results. ds = db.ExecuteDataSet(dbCommand); // Verification. if (ds == null || ds.Tables[0].Rows.Count == 0) //throw new ApplicationException("Could not get TMSVendorDetails ID:" + vdVendorId.ToString()+ " from Database."); // Return results. return null; ds.Tables[0].TableName = TABLE_NAME; instance.MapFrom( ds.Tables[0].Rows[0] ); return instance; }
public static void Update(TMSVendorDetails tMSVendorDetails, DbTransaction transaction) { tMSVendorDetails.Update(transaction); }
public static void Update(TMSVendorDetails tMSVendorDetails) { tMSVendorDetails.Update(); }