Ejemplo n.º 1
0
        public static void ChangeFilter(string user, OneFilter oldfilter, string newname)
        {
            string oldname = oldfilter.Name;

            //переименовывание фильтра
            oldfilter.ChangeName(newname);
            //переименовывание фильтра во всех аккаунтах
            foreach (Account acc in SaveEquip.Accounts.Values)
            {
                acc.AccountFilters.AllSingleFilters[oldfilter.StringID].ChangeName(newname);
            }
            //сохранение базы
            string filename = SaveFilters(oldfilter.Parent.CurValues);

            foreach (Equipment equip in SaveEquip.Equipments.Values)
            {
                foreach (Parameter par in equip.CurParameters.Values)
                {
                    if (par.Filter == oldfilter)
                    {
                        par.SetTextValue();
                    }
                }
            }
            SaveEquip.SaveEquipments();
            //сохранения лога
            Log.ChangeFilter(user, filename, oldname, newname);
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            var host = CreateHostBuilder(args).Build();

            using (var scope = host.Services.CreateScope())
            {
                var services = scope.ServiceProvider;
                SaveEquip.CreateValuesList();

                //List<Equipment> Equipments = new List<Equipment>();
                //Equipments.Add(new Equipment());
                //Equipments.Add(new Equipment());
                //SaveEquip.SaveEquipments(Equipments, "Data2.txt");
                SaveEquip.ReadAccounts(SaveEquip.AccountsFile);
                SaveEquip.ReadEquipments(SaveEquip.OldData);
                if (Program.Change_Base)
                {
                    //дкъ оепеянупюмемхъ аюгш
                    SaveEquip.SaveEquipments();
                }
                Filters.StartFilters = new Filters();
            }
            host.Run();
        }