public Programme Programme(ModelTrim trim)
        {
            ProgrammeDataStore ds = new ProgrammeDataStore("system");
            Programme retVal = new Programme();

            retVal = ds.ProgrammeGet(trim.ProgrammeId);
            return retVal;
        }
        public bool ModelTrimSave(ModelTrim obj)
        {
            bool retVal = true;
            string procName = (obj.IsNew ? "dbo.OXO_ModelTrim_New" : "dbo.OXO_ModelTrim_Edit");

			using (IDbConnection conn = DbHelper.GetDBConnection())
            {
				try
				{
                    obj.Save(CurrentCDSID);

					var para = new DynamicParameters();

					para.Add("@p_Programme_Id", obj.ProgrammeId, DbType.Int32);
					para.Add("@p_Name", obj.Name, DbType.String, size: 500);
                    para.Add("@p_Abbreviation", obj.Abbreviation, DbType.String, size: 50);
					para.Add("@p_Level", obj.Level, DbType.String, size: 500);
                    para.Add("@p_DPCK", obj.DPCK, DbType.String, size: 10);
					para.Add("@p_Active", obj.Active, DbType.Boolean);
                    if (obj.IsNew)
                    {
                        para.Add("@p_Created_By", obj.CreatedBy, DbType.String, size: 8);
                        para.Add("@p_Created_On", obj.CreatedOn, DbType.DateTime);
                    }
                    para.Add("@p_Updated_By", obj.UpdatedBy, DbType.String, size: 8);
                    para.Add("@p_Last_Updated", obj.LastUpdated, DbType.DateTime);
                    para.Add("@p_Id", obj.Id, DbType.Int32, ParameterDirection.InputOutput);
   
					conn.Execute(procName, para, commandType: CommandType.StoredProcedure);

					if (obj.Id == 0)
					{
						obj.Id = para.Get<int>("@p_Id");
					}

				}
				catch (Exception ex)
				{
                    Log.Error(ex);
                    throw;
				}
			}

            return retVal;
            
        }
 public TrimMapping()
 {
     Trim = new EmptyModelTrim();
 }
 public TrimMapping()
 {
     Trim = new EmptyModelTrim();
 }
 public ForecastTrimMapping()
 {
     ForecastVehicleTrim = new ModelTrim();
     ComparisonVehicleTrimMappings = Enumerable.Empty<ModelTrim>().ToList();
 }
 public ForecastTrimMapping()
 {
     ForecastVehicleTrim           = new ModelTrim();
     ComparisonVehicleTrimMappings = Enumerable.Empty <ModelTrim>().ToList();
 }