Пример #1
0
        private void UpdateEx()
        {
            _dtUpdateEx = DateTime.Now;
            if (CurrentSelectInstancesItem == null)
            {
                return;
            }
            if (CurrentSelectInstancesItem.Id < MenuIdControlAssign.MenuInstanceKeyIdMin)
            {
                return;
            }
            //var fff = new DataHoldingExtend.MenuInstancesHoldingExtend();
            //fff.DeleteMenuInstances(CurrentSelectInstancesItem.Value);

            //Base_MenuControl.Services.ServerInstanceRoot.DeleteMenuInstances(CurrentSelectInstancesItem.Value);
            CurrentSelectInstancesItem.IdClassic = CurrenSelectClassicItem.Value;
            //fff.AddMenuInstances(CurrentSelectInstancesItem.Value, CurrentSelectInstancesItem.Name,
            //                     CurrentSelectInstancesItem.Key,
            //                     CurrentSelectInstancesItem.IdClassic);

            //fff.WriteUpdateDb();
            ServerInstanceRoot.UpdateMenuInstances(CurrentSelectInstancesItem.Id,
                                                   CurrentSelectInstancesItem.Name,
                                                   CurrentSelectInstancesItem.Key,
                                                   CurrentSelectInstancesItem.IdClassic);
            OnSelectInstancesChangeforList();
        }
Пример #2
0
        private void AddEx()
        {
            _dtaddEx = DateTime.Now;
            var intValId  = ServerInstanceRoot.GetMaxAviableInstancesId();
            var instances = new MenuInstancesViewModel()
            {
                Id        = intValId,
                IdClassic = -1,
                Key       = DateTime.Now.ToString(CultureInfo.InvariantCulture).Trim(),
                Name      = "NewMenu"
            };

            //var fff = new DataHoldingExtend.MenuInstancesHoldingExtend();
            //fff.AddMenuInstances(instances.Value, instances.Name, instances.Key, instances.IdClassic);
            //fff.WriteUpdateDb(instances.Value);
            ServerInstanceRoot.UpdateMenuInstances(instances.Id, instances.Name, instances.Key,
                                                   instances.IdClassic);

            //Base_MenuControl.Services.ServerInstanceRelation.AddMenuInstanceRelation(0, 0, 1, "NewMenu", instances.Value);


            foreach (var t in InstancesItems)
            {
                if (t.Id == intValId)
                {
                    CurrentSelectInstancesItem = t;
                    return;
                }
            }
            InstancesItems.Add(instances);
            CurrentSelectInstancesItem = instances;
        }