public UsersWindows()
        {
            InitializeComponent();
            lblNss.Visibility = Visibility.Collapsed;
            txtNss.Visibility = Visibility.Visible;
            txtPassword.Visibility = Visibility.Collapsed;
            lblPassword.Visibility = Visibility.Collapsed;


            user = new User();
            service = new Service();
            speciality = new Speciality();

            usuario = new Usuarios();

            users = user.GetAll();
            userGrid.ItemsSource = users;

            services = service.GetAll();
            

            specialities = speciality.GetAll();


        }
        public MedicsWindow()
        {
            InitializeComponent();

            medico = new Medicos();

            medic = new Medic();
            service = new Service();
            speciality = new Speciality();


            medics = medic.GetAll();
            medicsGrid.ItemsSource = medics.ToArray();

            services = service.GetAll();
            foreach (ServicioMedico service in services)
            {
                comboService.Items.Add(service.nombre + " - " + service.descripcion);
            }

            specialities = speciality.GetAll();
            foreach (Especialidades speciality in specialities)
            {
                comboSpeciality.Items.Add(speciality.nombre + " - " + speciality.descripcion);
            }


        }
示例#3
0
        public void GetAll_SpecialityEmptyAtFirst_0()
        {
            //Arrange, Act
            int result = Speciality.GetAll().Count;

            //Assert
            Assert.AreEqual(0, result);
        }
        public void GetAll_TakeAllSpecialties_List()
        {
            List <Speciality> newList = new List <Speciality> {
            };
            List <Speciality> result  = Speciality.GetAll();

            CollectionAssert.AreEqual(newList, result);
        }
        public void GetAll_NumberOfSpecialities_0()
        {
            //Arrange, Act
            int result = Speciality.GetAll().Count;

            //Assert
            Assert.AreEqual(0, result);
        }
示例#6
0
        public ActionResult AllSpecialities()
        {
            List <Speciality> allSpecialities = new List <Speciality> {
            };

            allSpecialities = Speciality.GetAll();
            return(View(allSpecialities));
        }
示例#7
0
        public void GetAll_ReturnsEmptyListFromDatabase_SpecialityList()
        {
            List <Speciality> newList = new List <Speciality> {
            };
            List <Speciality> result  = Speciality.GetAll();

            CollectionAssert.AreEqual(newList, result);
        }
示例#8
0
        public ActionResult Create(string name)
        {
            Speciality newSpeciality = new Speciality(name);

            newSpeciality.Save();
            List <Speciality> allSpecialities = Speciality.GetAll();

            return(RedirectToAction("Index"));
        }
        public ActionResult Index(string specialityName)
        {
            Speciality speciality = new Speciality(specialityName);

            speciality.Save();
            List <Speciality> allSpecialities = Speciality.GetAll();

            return(View(allSpecialities));
        }
示例#10
0
        public ActionResult StylistDetail(int id)
        {
            Speciality newSpeciality = new Speciality();

            ViewBag.Specialities    = newSpeciality.SpecialitiesOfStylist(id);
            ViewBag.AllSpecialities = Speciality.GetAll();
            ViewBag.AllClients      = Client.FindAllClientByStylistId(id);
            return(View(Stylist.Find(id)));
        }
示例#11
0
        public ActionResult Create()
        {
            Speciality newSpeciality = new Speciality(Request.Form["newDescription"]);

            newSpeciality.Save();
            List <Speciality> allSpecialties = Speciality.GetAll();

            return(RedirectToAction("First", allSpecialties));
        }
        public ActionResult Create(string description)
        {
            Speciality newSpeciality = new Speciality(description);

            newSpeciality.Save();
            List <Speciality> allSpecialities = Speciality.GetAll();

            return(View("Index", allSpecialities));
        }
示例#13
0
        public void Save_DatabaseAssignsIdToStylist_Id()
        {
            Speciality testSpeciality = new Speciality("Cut");

            testSpeciality.Save();
            Speciality savedSpeciality = Speciality.GetAll()[0];
            int        result          = savedSpeciality.GetId();
            int        testId          = testSpeciality.GetId();

            Assert.AreEqual(testId, result);
        }
        public override Controller Execute(Controller controller)
        {
            var specs = Speciality.GetAll();

            for (int i = 0; i < specs.Count; i++)
            {
                Console.WriteLine($" {i}. {specs[i].Name};");
            }

            return(controller);
        }
示例#15
0
        public void Save_SavesSpecialityToDatabase_SpecialityList()
        {
            Speciality testSpeciality = new Speciality("Cut");

            testSpeciality.Save();
            List <Speciality> result   = Speciality.GetAll();
            List <Speciality> testList = new List <Speciality> {
                testSpeciality
            };

            CollectionAssert.AreEqual(testList, result);
        }
        public void GetAll_ReturnsSpecialties_SpecialtiesList()
        {
            Speciality newSpecialty = new Speciality("Family");

            newSpecialty.Save();
            List <Speciality> newList = new List <Speciality> {
                newSpecialty
            };
            List <Speciality> result = Speciality.GetAll();

            CollectionAssert.AreEqual(newList, result);
        }
示例#17
0
        public ActionResult AddStyletoStylist(int id)
        {
            string specialityId = Request.Form["specialityId"];

            Speciality newSpeciality = new Speciality();

            newSpeciality.Stylist_Specialities_Save(id, Int32.Parse(specialityId));

            ViewBag.Specialities    = newSpeciality.SpecialitiesOfStylist(id);
            ViewBag.AllSpecialities = Speciality.GetAll();
            return(RedirectToAction("StylistDetail"));
        }
        public ActionResult Show(int id)
        {
            Stylist newStylist = Stylist.Find(id);

            ViewBag.Clients       = Client.GetAll();
            ViewBag.Specialities  = Speciality.GetAll();
            ViewBag.Stylist       = Stylist.Find(id);
            ViewBag.Clients1      = newStylist.GetClients();
            ViewBag.Specialities1 = newStylist.GetSpecialities();

            return(View());
        }
        public ActionResult AddSpeciality(int id, int specialityId)
        {
            Stylist newStylist = Stylist.Find(id);

            newStylist.AddSpeciality(Speciality.Find(specialityId));
            ViewBag.Clients       = Client.GetAll();
            ViewBag.Specialities  = Speciality.GetAll();
            ViewBag.Stylist       = Stylist.Find(id);
            ViewBag.Clients1      = newStylist.GetClients();
            ViewBag.Specialities1 = newStylist.GetSpecialities();

            return(View("Show"));
        }
示例#20
0
        public ActionResult Details(int id)
        {
            List <Stylist>              allStylists     = Stylist.GetAll();
            Stylist                     foundStylist    = Stylist.Find(id);
            List <Speciality>           allSpecialities = Speciality.GetAll();
            Dictionary <string, object> model           = new Dictionary <string, object>()
            {
            };

            model.Add("stylist", foundStylist);
            model.Add("list", allStylists);
            model.Add("specialityList", allSpecialities);
            return(View(model));
        }
示例#21
0
        public void Saves_SavestoDatabase_GetAll_Speciality_List()
        {
            Speciality testIt = new Speciality("test2");

            //Act
            testIt.Save();
            List <Speciality> result   = Speciality.GetAll();
            List <Speciality> testList = new List <Speciality> {
                testIt
            };

            //Assert
            CollectionAssert.AreEqual(testList, result);
        }
示例#22
0
        public ActionResult Show(int id)
        {
            Dictionary <string, object> model        = new Dictionary <string, object>();
            Stylist           stylist                = Stylist.Find(id);
            List <Speciality> allSpecialities        = Speciality.GetAll();
            List <Client>     allClients             = Client.GetAll();
            List <Speciality> allStylistSpecialities = stylist.GetSpecialities();

            model.Add("allStylistSpecialities", allStylistSpecialities);
            model.Add("stylist", stylist);
            model.Add("allSpecialities", allSpecialities);
            model.Add("allClients", allClients);
            return(View(model));
        }
示例#23
0
        public override Controller Execute(Controller controller)
        {
            var faculty = controller.Faculty;

            Console.Write("Enter the course of the stream( ");
            foreach (var c in faculty.GetCourses())
            {
                Console.Write($"{c.Number} ");
            }
            Console.Write("): ");

            var str = Console.ReadLine();

            while (!int.TryParse(str, out int number) ||
                   !faculty.Contains(number))
            {
                Console.Write("Enter the available course number: ");
                str = Console.ReadLine();
            }

            int n      = Convert.ToInt32(str);
            var course = faculty.GetCourse(n);

            Console.WriteLine("Choose the speciality: ");
            var specs = Speciality.GetAll();

            for (int i = 0; i < specs.Count; i++)
            {
                Console.WriteLine($"{i}. {specs[i].Name};");
            }
            Console.Write("-> ");

            str = Console.ReadLine();
            while (!int.TryParse(str, out int number) ||
                   !(number > -1 && number < specs.Count))
            {
                Console.Write("Choose the available speciality number: ");
                str = Console.ReadLine();
            }

            var spec = specs[Convert.ToInt32(str)];

            var stream = new Stream(spec, course);

            course.AddStream(stream);
            Console.WriteLine("The stream is succesfully added!");


            return(controller);
        }
        public void GetAllSpecialities_ReturnAllSpecialities()
        {
            Speciality newSpeciality = new Speciality("Hairmaster");

            newSpeciality.Save();
            Speciality newSpeciality1 = new Speciality("Nailmaster");

            newSpeciality1.Save();
            List <Speciality> allSpecialities = new List <Speciality> {
                newSpeciality, newSpeciality1
            };
            List <Speciality> result = Speciality.GetAll();

            CollectionAssert.AreEqual(result, allSpecialities);
        }
        public void ClearAll_ReturnEmptyList()
        {
            Speciality newSpeciality = new Speciality("Hairmaster");

            newSpeciality.Save();
            Speciality newSpeciality1 = new Speciality("Nailmaster");

            newSpeciality1.Save();
            Speciality.ClearAll();
            List <Speciality> allSpecialities = Speciality.GetAll();
            List <Speciality> result          = new List <Speciality> {
            };

            CollectionAssert.AreEqual(allSpecialities, result);
        }
        public ActionResult Index(int activeId = 1)
        {
            string stylistsTab     = "nav-link active";
            string stylistsDiv     = "tab-pane fade show active";
            string clientsTab      = "nav-link";
            string clientsDiv      = "tab-pane fade";
            string specialitiesTab = "nav-link";
            string specialitiesDiv = "tab-pane fade";

            if (activeId == 2)
            {
                stylistsTab     = "nav-link";
                stylistsDiv     = "tab-pane fade";
                clientsTab      = "nav-link active";
                clientsDiv      = "tab-pane fade show active";
                specialitiesTab = "nav-link";
                specialitiesDiv = "tab-pane fade";
            }
            else if (activeId == 3)
            {
                stylistsTab     = "nav-link";
                stylistsDiv     = "tab-pane fade";
                clientsTab      = "nav-link";
                clientsDiv      = "tab-pane fade";
                specialitiesTab = "nav-link active";
                specialitiesDiv = "tab-pane fade show active";
            }

            List <Stylist>    allStylists     = Stylist.GetAll();
            List <Client>     allClients      = Client.GetAll();
            List <Speciality> allSpecialities = Speciality.GetAll();

            Dictionary <string, object> model = new Dictionary <string, object> {
            };

            model.Add("stylistList", allStylists);
            model.Add("clientList", allClients);
            model.Add("specialityList", allSpecialities);

            model.Add("stylistsTab", stylistsTab);
            model.Add("stylistsDiv", stylistsDiv);
            model.Add("clientsTab", clientsTab);
            model.Add("clientsDiv", clientsDiv);
            model.Add("specialitiesTab", specialitiesTab);
            model.Add("specialitiesDiv", specialitiesDiv);

            return(View(model));
        }
        public void Save_SaveSpeciality_List()
        {
            //Arrange
            Speciality testSpeciality = new Speciality("Cut");

            testSpeciality.Save();

            //Act
            List <Speciality> result   = Speciality.GetAll();
            List <Speciality> testList = new List <Speciality> {
                testSpeciality
            };

            //Assert
            CollectionAssert.AreEqual(testList, result);
        }
示例#28
0
        public ActionResult specialty(int id)
        {
            Dictionary <string, object> model = new Dictionary <string, object>();

            Stylist           selectedStylist    = Stylist.Find(id);
            List <Client>     selectedClients    = Client.GetClientsById(id);
            List <Speciality> stylistSpecialties = selectedStylist.GetSpecialties();
            List <Speciality> allSpecialties     = Speciality.GetAll();

            model.Add("selectedStylist", selectedStylist);
            model.Add("selectedClients", selectedClients);
            model.Add("stylistSpecialties", stylistSpecialties);
            model.Add("allSpecialties", allSpecialties);

            return(View(model));
        }
示例#29
0
        public ActionResult Details(int id)
        {
            Stylist       foundStylist   = Stylist.Find(id);
            List <Client> stylistClients = foundStylist.GetClients();

            Dictionary <string, object> model = new Dictionary <string, object>();

            model.Add("stylist", foundStylist);
            model.Add("clients", stylistClients);

            List <Speciality> stylistSpecialities = foundStylist.GetSpecialities();
            List <Speciality> allSpecialities     = Speciality.GetAll();

            model.Add("stylistSpecialities", stylistSpecialities);
            model.Add("allSpecialities", allSpecialities);

            return(View(model));
        }
        public MedicsWindow()
        {
            InitializeComponent();

            medico = new Medicos();

            medic = new Medic();
            service = new Service();
            speciality = new Speciality();


            medics = medic.GetAll();
            medicsGrid.ItemsSource = medics.ToArray();

            services = service.GetAll();


            specialities = speciality.GetAll();


        }
示例#31
0
        public void GetAll_DBstartsEmpty_Empty()
        {
            int count = Speciality.GetAll().Count;

            Assert.AreEqual(0, count);
        }
示例#32
0
 public void Get_String()
 {
     Speciality.GetAll();
 }
示例#33
0
        public ActionResult Index()
        {
            List <Speciality> allSpecialities = Speciality.GetAll();

            return(View(allSpecialities));
        }