/// <summary> /// Saves a record to the car_type table. /// </summary> public virtual void Update(CartypeInfo cartypeInfo) { try { new CartypeTFM().Update(cartypeInfo); } catch (Exception ex) { //Provider.Log.Error(ex, "TFM.Biz.Implements.Cartype - Update" + ex.Message); throw; } }
/// <summary> /// Saves a record to the car_type table. /// </summary> public virtual void Insert(CartypeInfo cartypeInfo) { try { new CartypeTFM().Insert(cartypeInfo); } catch (Exception ex) { //Log error by TFM framwork here //Provider.Log.Error(ex, "TFM.Biz.Implements.Cartype - Insert" + ex.Message); throw; } }
/// <summary> /// Saves a record to the car_type table. /// </summary> public virtual void Insert(CartypeInfo cartypeInfo) { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@name", cartypeInfo.Name), new SqlParameter("@note", cartypeInfo.Note), new SqlParameter("@weight", cartypeInfo.Weight), new SqlParameter("@seat", cartypeInfo.Seat), new SqlParameter("@capacity", cartypeInfo.Capacity) }; cartypeInfo.Typeid = (int) SqlClientUtility.ExecuteScalar(connectionStringName, CommandType.StoredProcedure, "car_type_Insert", parameters); }
/// <summary> /// Creates a new instance of the car_type class and populates it with data from the specified SqlDataReader. /// </summary> protected virtual CartypeInfo MakeCartypeInfo(SqlDataReader dataReader) { CartypeInfo cartypeInfo = new CartypeInfo(); cartypeInfo.Typeid = SqlClientUtility.GetInt32(dataReader,DbConstants.CAR_TYPE.TYPEID, 0); cartypeInfo.Name = SqlClientUtility.GetString(dataReader,DbConstants.CAR_TYPE.NAME, String.Empty); cartypeInfo.Note = SqlClientUtility.GetString(dataReader,DbConstants.CAR_TYPE.NOTE, String.Empty); cartypeInfo.Weight = SqlClientUtility.GetString(dataReader,DbConstants.CAR_TYPE.WEIGHT, String.Empty); cartypeInfo.Seat = SqlClientUtility.GetString(dataReader,DbConstants.CAR_TYPE.SEAT, String.Empty); cartypeInfo.Capacity = SqlClientUtility.GetString(dataReader,DbConstants.CAR_TYPE.CAPACITY, String.Empty); return cartypeInfo; }
/// <summary> /// Updates a record in the car_type table. /// </summary> public virtual void Update(CartypeInfo cartypeInfo) { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@typeid", cartypeInfo.Typeid), new SqlParameter("@name", cartypeInfo.Name), new SqlParameter("@note", cartypeInfo.Note), new SqlParameter("@weight", cartypeInfo.Weight), new SqlParameter("@seat", cartypeInfo.Seat), new SqlParameter("@capacity", cartypeInfo.Capacity) }; SqlClientUtility.ExecuteNonQuery(connectionStringName, CommandType.StoredProcedure, "car_type_Update", parameters); }