/// <summary> /// Saves a record to the car_groups table. /// </summary> public virtual void Update(CargroupsInfo cargroupsInfo) { try { new CargroupsTFM().Update(cargroupsInfo); } catch (Exception ex) { //Provider.Log.Error(ex, "TFM.Biz.Implements.Cargroups - Update" + ex.Message); throw; } }
/// <summary> /// Saves a record to the car_groups table. /// </summary> public virtual void Insert(CargroupsInfo cargroupsInfo) { try { new CargroupsTFM().Insert(cargroupsInfo); } catch (Exception ex) { //Log error by TFM framwork here //Provider.Log.Error(ex, "TFM.Biz.Implements.Cargroups - Insert" + ex.Message); throw; } }
/// <summary> /// Saves a record to the car_groups table. /// </summary> public virtual void Insert(CargroupsInfo cargroupsInfo) { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@groupid", cargroupsInfo.Groupid), new SqlParameter("@name", cargroupsInfo.Name), new SqlParameter("@description", cargroupsInfo.Description), new SqlParameter("@min_weight", cargroupsInfo.Min_weight), new SqlParameter("@max_weight", cargroupsInfo.Max_weight), new SqlParameter("@min_seat", cargroupsInfo.Min_seat), new SqlParameter("@max_seat", cargroupsInfo.Max_seat), new SqlParameter("@min_capacity", cargroupsInfo.Min_capacity), new SqlParameter("@max_capacity", cargroupsInfo.Max_capacity) }; SqlClientUtility.ExecuteNonQuery(connectionStringName, CommandType.StoredProcedure, "car_groups_Insert", parameters); }
/// <summary> /// Creates a new instance of the car_groups class and populates it with data from the specified SqlDataReader. /// </summary> protected virtual CargroupsInfo MakeCargroupsInfo(SqlDataReader dataReader) { CargroupsInfo cargroupsInfo = new CargroupsInfo(); cargroupsInfo.Groupid = SqlClientUtility.GetInt32(dataReader,DbConstants.CAR_GROUPS.GROUPID, 0); cargroupsInfo.Name = SqlClientUtility.GetString(dataReader,DbConstants.CAR_GROUPS.NAME, String.Empty); cargroupsInfo.Description = SqlClientUtility.GetString(dataReader,DbConstants.CAR_GROUPS.DESCRIPTION, String.Empty); cargroupsInfo.Min_weight = SqlClientUtility.GetString(dataReader,DbConstants.CAR_GROUPS.MIN_WEIGHT, String.Empty); cargroupsInfo.Max_weight = SqlClientUtility.GetString(dataReader,DbConstants.CAR_GROUPS.MAX_WEIGHT, String.Empty); cargroupsInfo.Min_seat = SqlClientUtility.GetString(dataReader,DbConstants.CAR_GROUPS.MIN_SEAT, String.Empty); cargroupsInfo.Max_seat = SqlClientUtility.GetString(dataReader,DbConstants.CAR_GROUPS.MAX_SEAT, String.Empty); cargroupsInfo.Min_capacity = SqlClientUtility.GetString(dataReader,DbConstants.CAR_GROUPS.MIN_CAPACITY, String.Empty); cargroupsInfo.Max_capacity = SqlClientUtility.GetString(dataReader,DbConstants.CAR_GROUPS.MAX_CAPACITY, String.Empty); return cargroupsInfo; }