Example #1
0
 public void AddVacancie(Vacancie vacancie)
 {
     vacancies.Add(vacancie);
 }
Example #2
0
 public void AddBid(Vacancie vacancie)
 {
     forBid.Add(vacancie);
 }
Example #3
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = System.Text.Encoding.UTF8;
            CV cv1 = new CV
            {
                Speciality = "Developer",
                Score      = 601,
                School     = "Baki",
                Skills     = "C++ C#",
                Companies  = "Step IT :)",
                Language   = "English",
                IsDegree   = false
            };
            CV cv2 = new CV
            {
                Speciality = "Designer",
                Score      = 618,
                School     = "Gence",
                Skills     = "Adobe Photoshop",
                Companies  = "Google:)",
                Language   = "English",
                IsDegree   = true
            };


            CV cv3 = new CV
            {
                Speciality = "Marketing",
                Score      = 546,
                School     = "Gence",
                Skills     = "Market and İlustrator",
                Companies  = "Freelance",
                Language   = "English",
                IsDegree   = true
            };


            CV cv4 = new CV
            {
                Speciality = "Designer",
                Score      = 500,
                School     = "Sumqayit",
                //Skills = "Photoshopu",
                Skills    = "Adobe Photoshop",
                Companies = "Freelance",
                Language  = "English German",
                IsDegree  = true
            };

            //CV cv5 = new CV
            //{
            //    Speciality = "Designer",
            //    Score = 500,
            //    School = "Sumqayit",
            //    //Skills = "Photoshopu",
            //    Skills = "Marketing",
            //    Companies = "Freelance",
            //    Language = "English German",
            //    IsDegree = true
            //};


            Vacancie vacancie1 = new Vacancie
            {
                Work         = "Designer",
                Field        = "Web",
                City         = "Baku",
                Price        = 1000,
                HasEducation = true,
                Experience   = 1,
                Text         = "Sosial şəbəkələr üçün postalrın hazırlanması"
            };

            Vacancie vacancie2 = new Vacancie
            {
                Work         = "Designer",
                Field        = "Artist",
                City         = "Baku",
                Price        = 700,
                HasEducation = false || true,
                Experience   = 2,
                Text         = "Rəssamlıq işlərinin görülməsi"
            };

            Vacancie vacancie3 = new Vacancie
            {
                Work         = "IT",
                Field        = "Developer",
                City         = "Baku",
                Price        = 2000,
                HasEducation = true,
                Experience   = 3,
                Text         = "C# Net Developer"
            };

            Vacancie vacancie4 = new Vacancie
            {
                Work         = "IT",
                Field        = "System Controller",
                City         = "Gence",
                Price        = 600,
                HasEducation = true || false,
                Experience   = 3,
                Text         = "Supporting server, desktop and network infrastructure of customers"
            };

            Worker worker1 = new Worker
            {
                Name       = "Vaqif",
                Surname    = "Vaqifli",
                City       = "Baki",
                Phone      = "+994509983438",
                Age        = 20,
                Field      = "IT",
                WorkerName = "worker1",
                Password   = "******"
            };


            Worker worker2 = new Worker
            {
                Name       = "Aysel",
                Surname    = "Ayselli",
                City       = "Gence",
                Phone      = "+99434243",
                Age        = 21,
                Field      = "Designer",
                WorkerName = "worker2",
                Password   = "******"
            };


            Worker worker3 = new Worker
            {
                Name    = "Kamil",
                Surname = "Kamilli",
                // City = "Baki",
                City       = "Sumqayit",
                Phone      = "+994354453",
                Age        = 20,
                Field      = "Designer",
                WorkerName = "worker3",
                Password   = "******"
            };

            List <Vacancie> vacancies = new List <Vacancie>();

            vacancies.Add(vacancie1);
            vacancies.Add(vacancie2);
            vacancies.Add(vacancie3);
            vacancies.Add(vacancie4);
            //foreach (var item in vacancies)
            //{
            //    Console.WriteLine(item.Work);
            //}

            ////User user = new User();

            worker1.AddCv(cv1);
            //worker1.Detail();
            //worker1.UpdateCvById(1);
            //worker1.Detail();
            worker2.AddCv(cv2);
            worker2.AddCv(cv3);
            worker3.AddCv(cv4);
            //worker3.AddCv(cv5);
            Worker   worker   = new Worker();
            Employer employer = new Employer();



            Employer employer1 = new Employer
            {
                Name       = "Eli",
                Surname    = "Elili",
                City       = "Baki",
                Phone      = "+99434643",
                Age        = 21,
                WorkerName = "employer1",
                Password   = "******"
            };

            Employer employer2 = new Employer
            {
                Name       = "Ali",
                Surname    = "Alili",
                City       = "Bakii",
                Phone      = "+85393",
                Age        = 21,
                WorkerName = "employer2",
                Password   = "******"
            };

            Employer employer3 = new Employer
            {
                Name       = "Veli",
                Surname    = "Velili",
                City       = "Sumqayit",
                Phone      = "+58833",
                Age        = 21,
                WorkerName = "employer3",
                Password   = "******"
            };

            employer1.AddVacancie(vacancie1);
            employer2.AddVacancie(vacancie2);
            employer3.AddVacancie(vacancie3);
            employer3.AddVacancie(vacancie4);


            List <Worker> workers = new List <Worker>();

            workers.Add(worker1);
            workers.Add(worker2);
            workers.Add(worker3);



            List <Employer> employers = new List <Employer>();

            employers.Add(employer1);
            employers.Add(employer2);
            employers.Add(employer3);



            Database database = new Database();

            database.AddWorker(worker1);
            database.AddWorker(worker2);
            database.AddWorker(worker3);
            database.AddEmployers(employer1);
            database.AddEmployers(employer2);
            database.AddEmployers(employer3);


            AdminLogin aw = new AdminLogin(worker, database);
            //aw.Control();
            AdminLogin ae = new AdminLogin(employer, database);
            //ae.Control();



            WorkerLogin workerLogin = new WorkerLogin(employer, database);
            //workerLogin.Control();



            EmployerLogin employerLogin = new EmployerLogin(worker, database);
            //employerLogin.Control();

            Admin admin = new Admin()
            {
                Name = "Raul"
            };


            //Files.JsonSerializeWorker(workers);
            //Files.JsonDeSerializeWorker();
            //Files.JsonSerializeEmployer(employers);
            //Files.JsonSerializeVacancie(vacancies);
            //Files.JsonDeSerializeEmployer();
            // Console.ReadLine();

            while (true)
            {
                Console.WriteLine("1)Admin");
                Console.WriteLine("2)Worker");
                Console.WriteLine("3)Employer");
                Console.WriteLine("4)Close Program");
                string selectt = Console.ReadLine();
                int    select;
                if (int.TryParse(selectt, out int num))
                {
                    select = int.Parse(selectt);
                    while (select != 1 && select != 2 && select != 3 && select != 4)
                    {
                        Console.Clear();
                        Console.WriteLine("Input again");
                        break;
                    }
                }
                else
                {
                    Console.Clear();
                    Console.WriteLine("Input again");
                    continue;
                }

                switch ((TypeLogin)select)
                {
                case TypeLogin.Admin:
                {
                    Log.SignIn(admin.Username, admin.PasswordHash);
                    while (true)
                    {
                        Console.WriteLine("1)Control Worker\n2)Control Employer\n" +
                                          "3)Show Notification\n4)Exit");
                        string choicee = Console.ReadLine();
                        int    choice;
                        if (int.TryParse(choicee, out int nu))
                        {
                            choice = int.Parse(choicee);

                            if (choice != 1 && choice != 2 && choice != 3 && choice != 4)
                            {
                                Console.Clear();
                                Console.WriteLine("Input again");
                                //break;
                            }
                            else if (choice == 1)
                            {
                                aw.Control();
                                continue;
                            }
                            else if (choice == 2)
                            {
                                ae.Control();
                                continue;
                            }
                            else if (choice == 3)
                            {
                                //Console.WriteLine("****WorkerNotfication****");
                                aw.ShowNotf();
                                Console.ReadLine();
                                //Console.WriteLine("****EmployerNotfication****");
                                //ae.ShowNotf();
                            }
                            else
                            {
                                break;
                            }
                        }
                        else
                        {
                            Console.Clear();
                            Console.WriteLine("Input again");
                            continue;
                        }
                    }
                }
                break;

                case TypeLogin.Worker:
                {
                    workerLogin.Control();
                    continue;
                }
                break;

                case TypeLogin.Employer:
                {
                    employerLogin.Control();
                    continue;
                }
                break;

                case TypeLogin.CloseProgram:
                {
                    var notf = database.notifications;
                    //Files.JsonSerializeNotf(notf);
                    return;
                }
                }
            }


            // employerLogin.VacancieControl();


            //employer2.ShowEmployersVacancie();
        }