public ProdCatalogPage2(UnicontaBaseEntity sourceData, bool isEdit = true) : base(sourceData, isEdit) { InitializeComponent(); if (!isEdit) { editRow = (ProdCatalogClient)StreamingManager.Clone(sourceData); } InitPage(); }
void InitPage() { layoutControl = layoutItems; if (LoadedRow == null && editRow == null) { frmRibbon.DisableButtons("Delete"); editRow = CreateNew() as ProdCatalogClient; } layoutItems.DataContext = editRow; cbCountry.ItemsSource = Enum.GetValues(typeof(Uniconta.Common.CountryCode)); frmRibbon.OnItemClicked += frmRibbon_BaseActions; }
public override void SetParameter(IEnumerable <ValuePair> Parameters) { foreach (var rec in Parameters) { if (string.Compare(rec.Name, "Catalog", StringComparison.CurrentCultureIgnoreCase) == 0) { var cache = api.GetCache(typeof(Uniconta.DataModel.ProdCatalog)) ?? api.LoadCache(typeof(Uniconta.DataModel.ProdCatalog)).GetAwaiter().GetResult(); master = (ProdCatalogClient)cache.Get(rec.Value); } } base.SetParameter(Parameters); }
public async void Unselect(ProdCatalogClient selectedItem) { if (selectedItem?.Selected == true) { var res = await api.Delete(new ProdCompany() { _CompanyId = api.CompanyId, _ProdId = selectedItem.RowId }); if (res != ErrorCodes.Succes) { Uniconta.ClientTools.Util.UtilDisplay.ShowErrorCode(res); } else { selectedItem.Selected = false; } } }
public ProdItemPage(UnicontaBaseEntity _master) : base(_master) { master = _master as ProdCatalogClient; InitPage(); }