Beispiel #1
0
        private void Manp_Items_Shown(object sender, EventArgs e)
        {
            DataHolder     dataHolder    = new DataHolder();
            IBaseOperation loadOperation = dataHolder.LoadEnumData();

            if (!loadOperation.Successful)
            {
                OnLoadError(loadOperation.Fail);
                return;
            }
            lookUpItemType.Properties.DataSource      = dataHolder.ItemTypes;
            lookupPriceCalcType.Properties.DataSource = dataHolder.LineCalcTypes;

            if (Id == 0)
            {
                Item = new Item();
            }
            else
            {
                // GET DATA
                Operation <Item> op_item = OperationHandler.GetItemById(Id);
                if (!op_item.Successful)
                {
                    OnLoadError(op_item.Fail);
                    return;
                }
                Item = op_item.Value;
                lookUpItemType.Enabled = false;
            }
            bindTool.BindControl(txtGroup1, nameof(Item.Group1));
            bindTool.BindControl(txtGroup2, nameof(Item.Group2));
            bindTool.BindControl(txtGroup3, nameof(Item.Group3));
            bindTool.BindControl(txtGroup4, nameof(Item.Group4));
            bindTool.BindControl(txtItemCode, nameof(Item.ItemCode));
            bindTool.BindControl(txtItemName, nameof(Item.ItemName));
            bindTool.BindControl(lookUpItemType, nameof(Item.ItemTypeId));
            bindTool.BindControl(lookupPriceCalcType, nameof(Item.LineCalcTypeId));
            bindTool.BindControl(spLength, nameof(Item.Length));
            bindTool.BindControl(spWidth, nameof(Item.Width));
            bindTool.BindControl(chkIsLineService, nameof(Item.IsLineService));
            bindTool.DataObject = Item;
        }