public void StartAddService()
        {
            var inputDialoge = new dlgInput {
                inputLabel = "New Service Name", inputId = _vm.MaxServiceId()
            };

            inputDialoge.ShowDialog();
            if (string.IsNullOrEmpty(inputDialoge.inputValue))
            {
                return;
            }
            var newServiceType = new IntegrationServiceType
            {
                IntegrationServiceTypeId = inputDialoge.inputId,
                Name         = inputDialoge.inputValue,
                Descr        = inputDialoge.inputValue,
                IsActive     = true,
                CreatedBy    = -1,
                ModifiedBy   = -1,
                ModifiedDate = DateTime.UtcNow,
            };

            _vm.AddService(newServiceType);
            var newServiceNode = new TreeNode
            {
                Text             = $"{newServiceType.IntegrationServiceTypeId}-{newServiceType.Name}",
                ImageKey         = "blank.png",
                SelectedImageKey = "blank.png",
                Tag         = newServiceType,
                ToolTipText = MakeToolTip(newServiceType),
            };

            tvServices.Nodes.Insert(tvServices.Nodes.Count - 1, newServiceNode);
        }
Example #2
0
        private void btnAddNewProduct_Click(object sender, EventArgs e)
        {
            var inputDialoge = new dlgInput
            {
                inputLabel = "New TEXT Setting Name",
                inputId    = _vm.MaxFieldId(),
                //IntegrationServiceType = IntegrationServiceType
            };

            inputDialoge.ShowDialog();
            dfcProducts.DataSource = null;

            var newSetting = new IntegrationSettingType
            {
                Name          = inputDialoge.inputValue,
                Code          = inputDialoge.inputValue.ToUpper().Replace(" ", "_"),
                Descr         = inputDialoge.inputValue,
                DataEntryType = "TEXT",
                DefatulValue  = "",
                Restrictions  = "",
            };

            _vm.AddSettingType(newSetting);
            IntegrationSettingTypes.Add(newSetting);
            dfcProducts.DataSource    = IntegrationSettingTypes;
            dfcProducts.DisplayMember = "Name";
        }