protected void BtnCreate_Click( object sender, EventArgs e ) { if ( Page.IsValid ) { VatGroup vatGroup = new VatGroup( StoreId, TxtName.Text, 0 ); vatGroup.Save(); base.Redirect( WebUtils.GetPageUrl( Constants.Pages.EditVatGroup ) + "?id=" + vatGroup.Id + "&storeId=" + vatGroup.StoreId ); } }
protected void BtnCreate_Click(object sender, EventArgs e) { if (Page.IsValid) { VatGroup vatGroup = new VatGroup(StoreId, TxtName.Text, 0); vatGroup.Save(); base.Redirect(WebUtils.GetPageUrl(Constants.Pages.EditVatGroup) + "?id=" + vatGroup.Id + "&storeId=" + vatGroup.StoreId); } }
public virtual long?GetVatGroupId(IContent model, VariantPublishedContent variant = null) { long storeId = GetStoreId(model); long?vatGroupId = GetPropertyValue <long?>(model, Constants.ProductPropertyAliases.VatGroupPropertyAlias, variant); //In umbraco a product can have a relation to a delete marked vat group if (vatGroupId != null) { VatGroup vatGroup = VatGroupService.Get(storeId, vatGroupId.Value); if (vatGroup == null || vatGroup.IsDeleted) { vatGroupId = null; } } return(vatGroupId); }
public virtual long?GetVatGroupId(XPathNavigator model, bool useCachedInformation = true) { long storeId = GetStoreId(model, useCachedInformation); long?vatGroupId = GetPropertyValue(model, Constants.ProductPropertyAliases.VatGroupPropertyAlias, useCachedInformation: useCachedInformation).TryParse <long>(); //In umbraco a product can have a relation to a delete marked vat group if (vatGroupId != null) { VatGroup vatGroup = VatGroupService.Get(storeId, vatGroupId.Value); if (vatGroup == null || vatGroup.IsDeleted) { vatGroupId = null; } } return(vatGroupId); }
public override bool Delete(long storeId, long entityId) { VatGroup vatGroup = VatGroupService.Instance.Get(storeId, entityId); return(vatGroup.Delete()); }