private void Fill() { WarePriceGroupsLogic groups = new WarePriceGroupsLogic(manager); if (mode == "edit") { WarePriceGroup group = groups.Get(Convert.ToInt32(id)); if (group != null) { NameTB.Text = group.Name; DefaultExtraPercentNUD.Value = Convert.ToInt32(group.DefaultExtraPercent); ActiveCB.Checked = group.Active; } } }
private void FillPriceGroups() { WarePriceGroupsLogic priceGroups = new WarePriceGroupsLogic(manager); //SortableBindingList<WarePriceGroup> view = new SortableBindingList<WarePriceGroup>(viewList); if (WareLUE.EditValue != null) { int wareId = ((int)(WareLUE.EditValue)); PriceGroupsCBE.Properties.DataSource = priceGroups.GetAll(wareId); PriceGroupsCBE.Properties.ValueMember = "ID"; PriceGroupsCBE.Properties.DisplayMember = "Name"; WarePriceGroup priceGroup = priceGroups.GetAll(wareId).FirstOrDefault(); if ((priceGroup != null) & (mode == "new")) { PriceGroupsCBE.EditValue = priceGroup.ID; } //PriceGroupsCBE.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", 0, "Назва")); } }