/// <summary> /// Create a new ListingServiceLocation object. /// </summary> /// <param name="listingServiceLocationId">Initial value of the ListingServiceLocationId property.</param> /// <param name="listingId">Initial value of the ListingId property.</param> /// <param name="cityId">Initial value of the CityId property.</param> /// <param name="stateId">Initial value of the StateId property.</param> /// <param name="countryId">Initial value of the CountryId property.</param> /// <param name="createdOn">Initial value of the CreatedOn property.</param> /// <param name="updatedOn">Initial value of the UpdatedOn property.</param> /// <param name="createdBy">Initial value of the CreatedBy property.</param> /// <param name="updatedBy">Initial value of the UpdatedBy property.</param> /// <param name="isActive">Initial value of the IsActive property.</param> /// <param name="isDeleted">Initial value of the IsDeleted property.</param> public static ListingServiceLocation CreateListingServiceLocation(global::System.Int64 listingServiceLocationId, global::System.Int64 listingId, global::System.Int32 cityId, global::System.Int32 stateId, global::System.Int16 countryId, global::System.DateTime createdOn, global::System.DateTime updatedOn, global::System.Int64 createdBy, global::System.Int64 updatedBy, global::System.Boolean isActive, global::System.Boolean isDeleted) { ListingServiceLocation listingServiceLocation = new ListingServiceLocation(); listingServiceLocation.ListingServiceLocationId = listingServiceLocationId; listingServiceLocation.ListingId = listingId; listingServiceLocation.CityId = cityId; listingServiceLocation.StateId = stateId; listingServiceLocation.CountryId = countryId; listingServiceLocation.CreatedOn = createdOn; listingServiceLocation.UpdatedOn = updatedOn; listingServiceLocation.CreatedBy = createdBy; listingServiceLocation.UpdatedBy = updatedBy; listingServiceLocation.IsActive = isActive; listingServiceLocation.IsDeleted = isDeleted; return listingServiceLocation; }
/// <summary> /// Deprecated Method for adding a new object to the ListingServiceLocation EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToListingServiceLocation(ListingServiceLocation listingServiceLocation) { base.AddObject("ListingServiceLocation", listingServiceLocation); }
public long CreateListingServiceLocation(IServiceLocationDTO serviceLocationDto) { long retVal = GlobalConstants.DefaultCreateId; try { if (serviceLocationDto != null) { using (TransactionScope trans = new TransactionScope()) { using (var TMCDbContext = new TMCContext()) { var listingServiceLocation = new ListingServiceLocation(); listingServiceLocation.ListingId = serviceLocationDto.ListingId; listingServiceLocation.CityId = serviceLocationDto.CityId; TMCDbContext.ListingServiceLocation.AddObject(listingServiceLocation); //todo fill these calues listingServiceLocation.StateId = 1; listingServiceLocation.CountryId = 1; listingServiceLocation.IsCityLevel = true; listingServiceLocation.CreatedOn = DateTime.Now; listingServiceLocation.CreatedBy = 11; listingServiceLocation.UpdatedOn = DateTime.Now; listingServiceLocation.UpdatedBy = 11; listingServiceLocation.IsActive = true; listingServiceLocation.IsDeleted = false; if (TMCDbContext.SaveChanges() > 0) { retVal = listingServiceLocation.ListingServiceLocationId; } } trans.Complete(); } } } catch (Exception ex) { ExceptionManager.HandleException(ex); throw new DACException("Error while creating the listing detail.", ex);//todo } return retVal; }