Example #1
0
        internal void Show()
        {
            Console.Clear();

            var virarea = new Area_date(0, "", "", 0, "");

            Console.WriteLine("Ktory obszar chesz zmodyifikowac");
            Area_date modifiedarea = seracher.Search(0, 1, virarea);

            if (modifiedarea == virarea)
            {
                return;
            }
            Menu Whatchange = new Menu(new string[] { "nazwe", "nazwe rozncujaca", "wyższy obszar", "zakoncz" }, 0, 8);
            var  morechange = Menuform.Menu_yn(0, 13);
            int  more       = 1;

            do
            {
                suportfunction.Show_area_date(modifiedarea, areas);
                int what = Whatchange.Show();
                switch (what)
                {
                case 0:
                    string newname = Console.ReadLine();
                    areas.UpdateName(modifiedarea.Id, newname);
                    break;

                case 1:
                    string newdifname = Console.ReadLine();
                    areas.UpdateDifName(modifiedarea.Id, newdifname);
                    break;

                case 2:
                    string newhigherstring = Console.ReadLine();
                    int    newhigher       = 0;
                    if (Int32.TryParse(newhigherstring, out newhigher))
                    {
                        areas.Updatehigher(modifiedarea.Id, newhigher);
                    }
                    break;

                case 3:
                    more = 1;
                    break;
                }
                if (0 <= what && what <= 3)
                {
                    Console.WriteLine("Czy chesz dokonac wiecej zmian?");
                    more = morechange.Show();
                }
            } while (more == 0);
        }
Example #2
0
        internal void Show()
        {
            Console.Clear();
            var      virarea = new Area_date(0, "", "", 0, "");
            Searcher search  = new Searcher();

            //bool end=false;
            Console.WriteLine("podaj nazwe obszaru jaki dotyczy");
            Area_date selected_area = search.Search(0, 0, virarea);

            if (selected_area == virarea)
            {
                return;
            }
            handcreateDocver(areas, selected_area.Id);
        }
Example #3
0
            internal void Show()
            {
                Console.Clear();
                var virarea = new Area_date(0, "", "", 0, "");

                Console.WriteLine("Podaj nazwe usuwanego prawa");
                var areasel = searcher.Search(0, 0, virarea);

                Console.Clear();
                if (areasel == virarea)
                {
                    return;
                }
                var locallaw = areas.Find_local_law(areasel.Id);
                var doc      = suportfunction.SelectDoc(locallaw, 0, 0);

                areas.DeleteLawver(doc.id);
            }
Example #4
0
        public void Show()
        {
            while ((task > -1 && task != end))
            {
                if (current_area.Type == "Province")
                {
                    po_podktóry = "to";
                }
                else
                {
                    po_podktóry = (current_area.Sex == false ? "ten" : "ta");
                }

                main_menu_string = new string[]
                {
                    $"Sprawdź lokalne prawa w {(current_area.Sex == false ? "tym" : "tej")} {Program.AngPolMiejscownik[current_area.Type]}.",
                    $"Sprawdź prawa w {(current_area.Sex == false ? "tym" : "tej")} {Program.AngPolMiejscownik[current_area.Type]}.",
                    $"sprawdź umowy miedynarodowe w {(current_area.Sex == false ? "tym" : "tej")} {Program.AngPolMiejscownik[current_area.Type]}. ",
                    "Wyszukaj umowy miedzynarodowe",
                    "Znajdź swój obszar.",
                    $"zobacz { current_area.Name } pod który {po_podktóry} {Program.AngPolMianownik[current_area.Type]} podlega.",//current_area.sex==true ? ten : ta plec biologiczno jest zasadniczo determinowa przez obecnosc chromosomu y
                    $"zobacz obszary podległe {(current_area.Sex == false ? "tego" : "tej")} {Program.AngPolCelownik[current_area.Type]}.",
                    "edytuj",
                    "Zakoncz"
                };// mam nadzeje ze sie w przypadkach nie pomyliłem
                //Console.Clear();
                Console.WriteLine(current_area.Name);
                Console.WriteLine(message);
                main_menu.Refresh_string(main_menu_string);

                //main_menu.Wybrany = task;

                task = main_menu.Show();

                Searcher searcher = new Searcher();
                try
                {
                    switch (task)
                    {
                    case 0:
                        FindLocalLaw();
                        break;

                    case 1:
                        FindAllLaw();
                        break;

                    case 2:
                        FindhorLaw();
                        break;

                    case 3:
                        Searchhorlaw();
                        break;

                    case 4:
                        current_area = searcher.Search(main_menu.DlugoscMaxElement, task + main_menu.Posy, current_area);
                        Console.Clear();
                        break;

                    case 5:
                        current_area = admhigher(areas, current_area, message);
                        break;

                    case 6:
                        current_area = admlover();
                        Console.Clear();
                        break;

                    case 7:
                        Edit Edit = new Edit(areas);
                        Edit.Show();
                        Console.Clear();
                        break;

                    case 8:
                        return;
                    }
                    // Console.Clear();
                    Console.SetCursorPosition(0, 10);
                    Console.WriteLine(message);
                    message = "";
                    Console.SetCursorPosition(0, 0);
                }
                finally { };

                /*
                 * catch (Exception e)
                 * {
                 *  message = e.Message;//to chyba nie działa
                 *  try
                 *  {
                 *      StreamWriter streamWriter = File.CreateText("log.ts");
                 *      streamWriter.WriteLine($"{e.Message}");
                 *      streamWriter.Close();
                 *  }
                 *  catch (System.IO.IOException loge)
                 *  {
                 *      message=message+" "+loge.Message;
                 *  }
                 * }
                 */
            }
        }
Example #5
0
        internal void Show()
        {
            Console.Clear();
            var virarea = new Area_date(0, "", "", 0, "");

            Console.WriteLine("ktorego obszaru prawo chesz modyfikować");
            var modarea = searcher.Search(0, 1, virarea);

            if (modarea == virarea)
            {
                return;
            }
            Console.Clear();
            var chosen_law = areas.Find_local_law(modarea.Id);

            Console.Clear();
            var Document = suportfunction.SelectDoc(chosen_law, 0, 5);

            Menu Whatchange = new Menu(new string[] { "tytul", "obszarprzypisany", "opis", "link", "tagi" }, 0, 10);
            var  morechange = Menuform.Menu_yn(Whatchange.DlugoscMaxElement, 8);

            Console.Clear();
            int more = 0;

            do
            {
                int what = Whatchange.Show();
                switch (what)
                {
                case 0:

                    string newname;
                    do
                    {
                        Console.WriteLine("podaj nowy tytuł");
                        newname = Console.ReadLine();
                    } while (!suportfunction.nameverifcation(newname));
                    areas.UpdateTitleVer(Document.id, newname);
                    break;

                case 1:
                    var new_area = searcher.Search(0, 0, virarea);
                    if (virarea != new_area)
                    {
                        areas.Udapteareaselectedver(Document.id, new_area.Id);
                    }
                    break;

                case 2:
                    Console.WriteLine("podaj nowy opis");
                    string newbrief = Console.ReadLine();
                    areas.Udaptebriefver(Document.id, newbrief);
                    break;

                case 3:
                    string newlink;
                    do
                    {
                        Console.WriteLine("podaj nowy opis");
                        newlink = Console.ReadLine();
                    } while (!suportfunction.Linkverfication(newlink));
                    areas.Updatelinkver(Document.id, newlink);
                    break;

                case 4:
                    string tags = suportfunction.Createtags();
                    areas.Updatetagver(Document.id, tags);
                    break;
                }
                Console.WriteLine("Czy chesz dokonac wiecej zmian?");
                more = morechange.Show();
            } while (more == 0);
        }