public IQueryable<LicenseTrialSettings> InsertTrialSettings(LicenseTrialSettings trialSettings)
		{
			int newId;

			//using (ScutexEntities db1 = new ScutexEntities())
			//{
			TrialSetting ts = new TrialSetting();

			Mapper.CreateMap<Model.LicenseTrialSettings, TrialSetting>();
			ts = Mapper.Map<Model.LicenseTrialSettings, TrialSetting>(trialSettings);

			ts.TrialExpirationOptionId = (int)trialSettings.ExpirationOptions;

			db.AddToTrialSettings(ts);
			db.SaveChanges();

			newId = ts.TrialSettingId;
			//}

			return GetTrialSettingsById(newId);
		}
Example #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the TrialSettings EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTrialSettings(TrialSetting trialSetting)
 {
     base.AddObject("TrialSettings", trialSetting);
 }
Example #3
0
 /// <summary>
 /// Create a new TrialSetting object.
 /// </summary>
 /// <param name="trialSettingId">Initial value of the TrialSettingId property.</param>
 /// <param name="licenseId">Initial value of the LicenseId property.</param>
 /// <param name="trialExpirationOptionId">Initial value of the TrialExpirationOptionId property.</param>
 /// <param name="expirationData">Initial value of the ExpirationData property.</param>
 public static TrialSetting CreateTrialSetting(global::System.Int32 trialSettingId, global::System.Int32 licenseId, global::System.Int32 trialExpirationOptionId, global::System.String expirationData)
 {
     TrialSetting trialSetting = new TrialSetting();
     trialSetting.TrialSettingId = trialSettingId;
     trialSetting.LicenseId = licenseId;
     trialSetting.TrialExpirationOptionId = trialExpirationOptionId;
     trialSetting.ExpirationData = expirationData;
     return trialSetting;
 }