internal static void Searchhorlaw(Areas.Areas areas, Area_date current_area, int dlugoscMaxElement, int v, string message)
        {
            Console.SetCursorPosition(dlugoscMaxElement, v);
            string     name       = Console.ReadLine();
            HorLawdata law        = areas.Search_hor_law(name);
            Menu       selectmenu = Menu_form_area.Law_to_menu(law, dlugoscMaxElement, v + 1);

            selectmenu.Shower = new Showernoclear();
            //selectmenu.
            Console.SetCursorPosition(dlugoscMaxElement, v);
            var selected = SelectDoc(selectmenu, law);

            Console.Clear();
            if (selected.id == new Document().id)
            {
                return;
            }
            //var selected= SelectDoc(all_law, DlugoscMaxElement, posnewmenu, ConsoleColor.Blue, ConsoleColor.Yellow, ConsoleColor.DarkMagenta, ConsoleColor.Gray);

            //Console.WriteLine(law.Name);
            Console.WriteLine(selected.title);
            Console.WriteLine(selected.reference);
            Console.ReadKey();
            Console.Clear();
        }
Exemple #2
0
        internal void Searchhorlaw()
        {
            Console.SetCursorPosition(main_menu.DlugoscMaxElement, main_menu.Posy);
            string     name       = Console.ReadLine();
            HorLawdata law        = areas.Search_hor_law(name);
            Menu       selectmenu = Menu_form_area.Law_to_menu(law, main_menu.DlugoscMaxElement, main_menu.Posy);

            selectmenu.Shower = new Showernoclear();
            //selectmenu.
            Console.SetCursorPosition(main_menu.DlugoscMaxElement, main_menu.Posy);
            var selected = suportfunction.SelectDoc(selectmenu, law);

            Console.Clear();
            if (selected.id == new Document().id)
            {
                return;
            }
            //var selected= SelectDoc(all_law, DlugoscMaxElement, posnewmenu, ConsoleColor.Blue, ConsoleColor.Yellow, ConsoleColor.DarkMagenta, ConsoleColor.Gray);

            //Console.WriteLine(law.Name);
            Console.WriteLine(selected.title);
            Console.WriteLine(selected.reference);
            Console.ReadKey();
            Console.Clear();
        }
Exemple #3
0
        internal static void delarea_horlaw(Areas.Areas areas, HorLawdata law)
        {
            Console.Clear();
            var selectdoc   = Menu_form_area.Law_to_menu(law, 0, 0);
            int selecteddoc = selectdoc.Show();

            if (selecteddoc == 0 || selecteddoc == 1)
            {
                return;
            }
            areas.DeleteDochorlaw(law.List_document[selecteddoc - 1].id, law.Id);
        }
Exemple #4
0
        internal Area_date admlover()
        {
            //Console.Clear();
            List <Area_date> area_lover_list = areas.Get_adm_lover(current_area);
            Menu             menulover       = Menu_form_area.List_to_menu(area_lover_list, main_menu.DlugoscMaxElement, main_menu.Posy);
            int selectedLover = menulover.Show();

            if (selectedLover == 0 || selectedLover == -1)
            {
                return(current_area);
            }
            else //if (selectedLover >= 1 && selectedLover <= area_lover_list.Count)
            {
                return(area_lover_list[selectedLover - 1]);
            }
            //Console.ReadKey();
        }
        internal static Area_date admlover(Areas.Areas areas, Area_date current_area, int DlugoscMaxElement, int posnewmenu)
        {
            //Console.Clear();
            List <Area_date> area_lover_list = areas.Get_adm_lover(current_area);
            Menu             menulover       = Menu_form_area.List_to_menu(area_lover_list, DlugoscMaxElement, posnewmenu);
            int selectedLover = menulover.Show();

            if (selectedLover == 0 || selectedLover == -1)
            {
                return(current_area);
            }
            else //if (selectedLover >= 1 && selectedLover <= area_lover_list.Count)
            {
                return(area_lover_list[selectedLover - 1]);
            }
            //Console.ReadKey();
        }
Exemple #6
0
        internal Area_date Search(int posx, int posy, Area_date current_area)
        {
            Console.SetCursorPosition(posx, posy);

            string           area_name  = Console.ReadLine();
            List <Area_date> area_list  = areas.Search(area_name);//area jest od 0
            Menu             menusearch = Menu_form_area.List_to_menu(area_list, posx + area_name.Length, posy + 1);
            int selected = menusearch.Show();

            if (selected == 0 || selected == -1)
            {
                return(current_area);
            }
            else //if (selected >= 1 && selected <= area_list.Count)
            {
                return(area_list[selected - 1]);
            }
        }
        internal static Area_date Search(Areas.Areas areas, Area_date currentArea, int DlugoscMaxElement, int posnewmenu, string message)
        {
            Console.SetCursorPosition(DlugoscMaxElement, posnewmenu);

            string           area_name  = Console.ReadLine();                                                                           //ej i tak działa mimo ze nie ma try catch
            List <Area_date> area_list  = areas.Search(area_name);                                                                      //area jest od 0
            Menu             menusearch = Menu_form_area.List_to_menu(area_list, DlugoscMaxElement + area_name.Length, posnewmenu + 1); //tutaj area jest od 1
            int selected = menusearch.Show();

            if (selected == 0 || selected == -1)
            {
                return(currentArea);
            }
            else     //if (selected >= 1 && selected <= area_list.Count)
            {
                return(area_list[selected - 1]);
            }
        }
Exemple #8
0
        internal void FindLocalLaw()//main_menu.DlugoscMaxElement menuposy + task)
        {
            VerLawdata      local_law  = areas.Find_local_law(current_area.Id);
            List <Document> DocWithTag = suportfunction.TagSearch(local_law, main_menu.DlugoscMaxElement, main_menu.Posy - 2);
            Menu            selectmenu = Menu_form_area.DocList_to_menu(DocWithTag, main_menu.DlugoscMaxElement, main_menu.Posy);

            selectmenu.Shower = new Showernoclear();
            Document selected = suportfunction.SelectDoc(selectmenu, local_law);

            //return selected.title+" "+selected.reference;
            Console.Clear();
            if (selected.id != 0)
            {
                //Console.SetCursorPosition(DlugoscMaxElement+selectmenu.DlugoscMaxElement,posnewmenu);
                Console.Write(selected.title + " " + selected.reference);
                Console.ReadKey();
                Console.Clear();
            }
        }
Exemple #9
0
        internal void FindAllLaw()
        {
            VerLawdata      all_law    = areas.Find_all_law(current_area);
            List <Document> DocWithTag = suportfunction.TagSearch(all_law, main_menu.DlugoscMaxElement, main_menu.Posy - 2);
            Menu            selectmenu = Menu_form_area.DocList_to_menu(DocWithTag, main_menu.DlugoscMaxElement, main_menu.Posy);

            selectmenu.Shower = new Showernoclear();
            var selected = suportfunction.SelectDoc(selectmenu, all_law);

            //var selected= SelectDoc(all_law, DlugoscMaxElement, posnewmenu, ConsoleColor.Blue, ConsoleColor.Yellow, ConsoleColor.DarkMagenta, ConsoleColor.Gray);
            //Console.SetCursorPosition(DlugoscMaxElement + selectmenu.DlugoscMaxElement, posnewmenu);
            Console.Clear();
            if (selected.id != 0)
            {
                Console.Write(selected.title + " " + selected.reference);
                Console.ReadKey();

                Console.Clear();
            }
        }
        internal static void FindAllLaw(Areas.Areas areas, Area_date current_area, int DlugoscMaxElement, int posnewmenu, string message)
        {
            VerLawdata      all_law    = areas.Find_all_law(current_area);
            List <Document> DocWithTag = TagSearch(all_law, DlugoscMaxElement, posnewmenu - 2);
            Menu            selectmenu = Menu_form_area.DocList_to_menu(DocWithTag, DlugoscMaxElement, posnewmenu);

            selectmenu.Shower = new Showernoclear();
            var selected = SelectDoc(selectmenu, all_law);

            //var selected= SelectDoc(all_law, DlugoscMaxElement, posnewmenu, ConsoleColor.Blue, ConsoleColor.Yellow, ConsoleColor.DarkMagenta, ConsoleColor.Gray);
            //Console.SetCursorPosition(DlugoscMaxElement + selectmenu.DlugoscMaxElement, posnewmenu);
            Console.Clear();
            if (selected.id != 0)
            {
                Console.Write(selected.title + " " + selected.reference);
                Console.ReadKey();

                Console.Clear();
            }
        }
        internal Document SelectDoc(HorLawdata local_law, int DlugoscMaxElement, int posnewmenu, ConsoleColor backcol_hos, ConsoleColor forecol_hos, ConsoleColor backcol, ConsoleColor forecol)
        {
            Menu selectlaw = Menu_form_area.Law_to_menu(local_law, DlugoscMaxElement, posnewmenu);

            return(SelectDoc(selectlaw, local_law));
        }