private SupplierRating GetSupplierRating(DataRow dr) { if (dr == null) { return(null); } SupplierRating sr = new SupplierRating(); sr.SupplierRatingOID = Convert.ToInt32(dr["SupplierRatingOID"]); sr.RatingName = Convert.ToString(dr["RatingName"]); return(sr); }
public SupplierRating FindSupplierRatingBySupplierRatingOID(Nullable <int> SupplierRatingOID) { if (!SupplierRatingOID.HasValue) { return(null); } string strCmd = @"select SupplierRatingOID, RatingName from dbo.SupplierRating where SupplierRatingOID = @SupplierRatingOID"; List <SqlParameter> parameters = new List <SqlParameter>(); parameters.Add(SqlHelper.CreateParameter("@SupplierRatingOID", SqlDbType.Int, SupplierRatingOID)); DataTable dt = SqlHelper.AdapterFill(strCmd, parameters); if (dt.Rows.Count == 0) { return(null); } SupplierRating sr = this.GetSupplierRating(dt.Rows[0]); return(sr); }