public static void UpdateStoreWixSiteUrl(this WebStores entity, WixStoreUrlToken token) { entity.WixSiteUrl = token.WixSiteUrl; entity.SiteUrl = token.WixSiteUrl; entity.UpdateOn = DateTime.Now; entity.UpdatedBy = DtoExtensions.CurrentUserId; }
public static WidgetWebStoreDTO Entity2WidgetStoreDto(this WebStores entity) { return(new WidgetWebStoreDTO { WebStoreID = entity.StoreID , WebStoreName = entity.StoreName , GoogleAnalyticCode = entity.GoogleAnalyticCode , MetaTags = entity.MetaTags , Description = entity.Description , OwnerUserID = entity.OwnerUserID , TrackingID = entity.TrackingID , CurrencyId = entity.DefaultCurrencyId , Status = Utils.ParseEnum <WebStoreEnums.StoreStatus>(entity.StatusId) , WixInstanceID = entity.WixInstanceId != null?entity.WixInstanceId.ToString() : string.Empty , FontColor = entity.FontColor , BackgroundColor = entity.BackgroundColor , TabsFontColor = entity.TabsFontColor , IsTransParent = entity.IsTransparent != null && Convert.ToBoolean(entity.IsTransparent) , IsShowBorder = entity.IsShowBorder != null && Convert.ToBoolean(entity.IsShowBorder) , IsShowTitleBar = entity.IsShowTitleBar != null && Convert.ToBoolean(entity.IsShowTitleBar) , LastUpdate = Convert.ToDateTime(entity.UpdateOn ?? entity.AddOn) , UniqueId = entity.uid.ToString() , WixSiteUrl = entity.WixSiteUrl }); }
public static void UpdateStoreEntity(this WebStores entity, BaseWebStoreDTO dto) { entity.StoreName = dto.Name; entity.TrackingID = dto.TrackingID; entity.DefaultCurrencyId = dto.DefaultCurrencyId ?? Constants.DEFAULT_CURRENCY_ID; entity.UpdateOn = DateTime.Now; entity.UpdatedBy = DtoExtensions.CurrentUserId; }
public static BaseEntityDTO Entity2BaseEntityDto(this WebStores entity) { return(new BaseEntityDTO { id = entity.StoreID , name = entity.StoreName , Uid = entity.uid }); }
//public static WebStores EditDto2StoreEntity(this WixSettingsToken dto, int ownerId) //{ // return new WebStores // { // OwnerUserID = ownerId // ,TrackingID = dto.TrackingID // ,uid = Guid.NewGuid() // ,StatusId = (int)WebStoreEnums.StoreStatus.Published // ,DefaultCurrencyId = Constants.DEFAULT_CURRENCY_ID // ,StoreName = dto.StoreName // ,Description = "" // ,MetaTags = "" // ,FontColor = dto.FontColor // ,BackgroundColor = dto.BackgroundColor // ,TabsFontColor = dto.TabsFontColor // ,IsShowBorder = dto.IsShowBorder // ,IsTransparent = dto.IsTransparent // ,AddOn = DateTime.Now // ,CreatedBy = DtoExtensions.CurrentUserId // ,WixInstanceId = dto.InstanceId != null ? new Guid(dto.InstanceId) : new Guid() // }; //} //public static WebStores WixReigster2WebStores(this WixRegisterStoreDTO token) //{ // return new WebStores // { // OwnerUserID = token.UserId // ,TrackingID = token.InstanceId.ToString() // ,WixInstanceId = token.InstanceId // ,uid = Guid.NewGuid() // ,StoreName = token.StoreName // ,StatusId = (short)WebStoreEnums.StoreStatus.Draft // ,DefaultCurrencyId = Constants.DEFAULT_CURRENCY_ID // ,Description = string.Empty // ,MetaTags = string.Empty // ,AddOn = DateTime.Now // ,CreatedBy = DtoExtensions.CurrentUserId // }; //} public static void UpdateStoreEntity(this WebStores entity, WebStoreEditDTO dto) { entity.StoreName = dto.StoreName; entity.TrackingID = dto.TrackingID; entity.StatusId = (short)dto.Status; entity.Description = dto.Description; entity.DefaultCurrencyId = dto.CurrencyId; entity.MetaTags = dto.MetaTags; entity.UpdateOn = DateTime.Now; entity.UpdatedBy = DtoExtensions.CurrentUserId; }
public static WebStoreEditDTO Entity2StoreEditDto(this WebStores entity) { return(new WebStoreEditDTO { StoreId = entity.StoreID , TrackingID = entity.TrackingID , Uid = entity.uid , StoreName = entity.StoreName , CurrencyId = entity.DefaultCurrencyId ?? Constants.DEFAULT_CURRENCY_ID , Description = entity.Description , MetaTags = entity.MetaTags , Status = Utils.ParseEnum <WebStoreEnums.StoreStatus>(entity.StatusId.ToString()) , WixUid = entity.WixInstanceId }); }
public static WebStores CloneStoreEntity(this WebStores entity, string storeName, string trackingId) { return(new WebStores { OwnerUserID = entity.OwnerUserID , TrackingID = trackingId , uid = Guid.NewGuid() , StoreName = storeName , StatusId = (short)WebStoreEnums.StoreStatus.Published , RegistrationSourceId = entity.RegistrationSourceId , Description = entity.Description , MetaTags = entity.MetaTags , DefaultCurrencyId = entity.DefaultCurrencyId , AddOn = DateTime.Now , CreatedBy = DtoExtensions.CurrentUserId }); }
private void UpdateStoreRegistrationSource(WebStores entity, CommonEnums.eRegistrationSources source) { entity.RegistrationSourceId = (byte)source; WebStoreRepository.UnitOfWork.CommitAndRefreshChanges(); }