Example #1
0
        internal static void handcreateDochor(Areas.Areas areas, int lawid)
        {
            string name;

            Console.Clear();
            do
            {
                Console.WriteLine("podaj nazwe");
                name = Console.ReadLine();
            } while (!Editmainfunction.nameverifcation());
            Console.WriteLine("podaj krotki opis");
            string brief = Console.ReadLine();

            Console.WriteLine("podaj link");
            string link = Console.ReadLine();

            if (!areas.IsLaw(link))
            {
                Console.WriteLine("takie prawo istnieje");
                areas.Showdoc(link);
                Console.ReadKey();
                return;
            }

            Console.WriteLine("podaj tagi odzielone przecinkami");
            string tags = Console.ReadLine();

            string[] tagstab = tags.Split(',');
            tags = "";
            for (int i = 0; i < tagstab.Length; i++)
            {
                tags = tags + tagstab[i].Trim() + ", ";
            }
            areas.MakeDocLawhor(lawid, name, brief, link, tags);
        }
Example #2
0
        internal static void Moddocver(Areas.Areas areas, Area_date current_area, int dlugoscMaxElement, int posnewmenu, string message)
        {
            Console.Clear();
            var virarea = new Area_date(0, "", "", 0, "");

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

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

            Console.Clear();
            var Document = Program_function.SelectDoc(chosen_law, 0, 1);

            Menu Whatchange = new Menu(new string[] { "tytul", "obszarprzypisany", "opis", "link", "tagi" }, 0, 8);
            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 (!Editmainfunction.nameverifcation());
                    areas.UpdateTitleVer(Document.id, newname);
                    break;

                case 1:
                    var new_area = Program_function.Search(areas, virarea, dlugoscMaxElement, posnewmenu, message);
                    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 (!Editmainfunction.Linkverfication());
                    areas.Updatelinkver(Document.id, newlink);
                    break;

                case 4:
                    string tags = Editmainfunction.Createtags();
                    areas.Updatetagver(Document.id, tags);
                    break;
                }
                Console.WriteLine("Czy chesz dokonac wiecej zmian?");
                more = morechange.Show();
            } while (more == 0);
        }
Example #3
0
        internal static void Moddochor(Areas.Areas areas, Area_date current_area, int dlugoscMaxElement, int posnewmenu, string message)
        {
            Console.Clear();
            var virarea = new Area_date(0, "", "", 0, "");

            //var modarea = Program_function.Search(areas, virarea, dlugoscMaxElement, posnewmenu, message);
            //if (modarea == virarea) { return; }
            Console.Clear();
            var chosen_law = Program_function.SearchLawhor(areas, current_area, 0, 1, message);

            Console.Clear();
            var Document = Program_function.SelectDoc(chosen_law, 0, 1);

            Console.Clear();
            Menu Whatchange = new Menu(new string[] { "tytul", "opis", "link", "tagi", "powrot" }, 0, 6);
            var  morechange = Menuform.Menu_yn(Whatchange.DlugoscMaxElement, 6);
            int  more       = 0;

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

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

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

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

                case 3:
                    string tags = Editmainfunction.Createtags();
                    areas.Updatetaghor(Document.id, tags);
                    break;

                case 4:
                    return;
                }
                Console.WriteLine("Czy chesz dokonac wiecej zmian?");
                more = morechange.Show();
            } while (more == 0);
        }
Example #4
0
        internal static void edit_select(Areas.Areas areas, Area_date current_area, int DlugoscMaxElement, int posnewmenu, string message)//chyba zrboie z tego klase bo to za duzo kodu;
        {
            int what, dod;

            do
            {
                Console.Clear();
                var menuwhat = new Menu(new string[] { "obszary", "prawo", "powrót" }, 0, 0);
                what = menuwhat.Show();
                var Menudo     = new Menu(new string[] { "dodaj", "modyfikuj", "usun", "powrót", }, 0, 0);
                var Menudoclaw = new Menu(new string[] { "document", "prawo", " powrót" }, 0, 0);

                switch (what)
                {
                case 0:
                    dod = Menudo.Show();
                    switch (dod)
                    {
                    case 0:
                        //reczne tworzenei obszaru
                        EditArea.hand_made_area(areas);
                        break;

                    case 1:
                        EditArea.Modarea(areas, current_area, 0, 0, message);
                        break;

                    case 2:
                        EditArea.DeleteArea(areas, current_area, 0, 0, message);
                        break;

                    case 3:
                        what = 2;
                        break;
                    }
                    break;

                case 1:
                    dod = Menudo.Show();
                    int doc;
                    switch (dod)
                    {
                    case 0:
                        Menudoclaw.Refresh_string(new string[] { "obszary do prawa", "prawo poziome", "powrót" });
                        doc = Menudoclaw.Show();
                        if (doc == 0)
                        {
                            MakeDocument.MakeDocumentto(areas, current_area, 0, 0, message);
                        }
                        else if (doc == 1)
                        {
                            Editmainfunction.MakeLawHor(areas, current_area, 0, 0, message);
                        }
                        break;

                    case 1:
                        doc = Menudoclaw.Show();
                        if (doc == 0)
                        {
                            Menu typeemenu = new Menu(new string[] { "poziome", "pionowe", }, 0, 0);
                            int  typee     = typeemenu.Show();
                            if (typee == 0)
                            {
                                ModDoc.Moddochor(areas, current_area, 0, 0, message);
                            }
                            else if (typee == 1)
                            {
                                ModDoc.Moddocver(areas, current_area, 0, 0, message);
                            }
                        }
                        else if (doc == 1)
                        {
                            Menu typeemenu = new Menu(new string[] { "pionowe", "poziome" }, 0, 0);
                            int  typee     = typeemenu.Show();
                            if (typee == 1)
                            {
                                ModLaw.ModLawver(areas, current_area, 0, 0, message);
                            }
                            else if (typee == 1)
                            {
                                ModLaw.ModLawhor(areas, current_area, 0, 0, message);
                            }
                        }
                        break;

                    case 2:
                        Menu typemenu = new Menu(new string[] { "pionowe", "poziome" }, 0, 0);
                        int  type     = typemenu.Show();
                        if (type == 1)
                        {
                            ModLaw.DelLawver(areas, current_area, 0, 0, message);
                        }
                        else if (type == 2)
                        {
                            ModLaw.DelLawhor(areas, current_area, 0, 0, message);
                        }
                        break;

                    case 3:
                        what = 2;
                        break;
                    }
                    break;
                }
            } while (what != 2 && what != -1);
            //pass
            return;
        }