예제 #1
0
        public bool ChangeStatus(RequestToAdd request, Status status, Role role, string path)
        {
            request.Status = status;
            User user = new User();

            user.Role = role;
            try
            {
                if (status == Status.Approved && role == Role.Admin)
                {
                    //Patient p = Patients.FirstOrDefault(x => x.IIN == request.Patient.IIN);
                    //if (p != null)
                    // p.Organization = request.Organization;

                    AddToXML.UpdateStudents(request.Student, path);

                    //Organization o = Organizations.FirstOrDefault(x =>
                    //x.Name.Equals(request.Organization.Name));
                    //if (o != null)
                    // o.Patients.Add(request.Patient);
                }
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
예제 #2
0
        public void AddUser(User user, string path)
        {
            AddToXML check = new AddToXML();

            if (check.ReturnAllUsers(path) == false)
            {
                AddToXML.CreateUser(user, path);
            }
            else
            {
                AddToXML.AddUser(user, path);
            }
        }
예제 #3
0
        public void AddCompany(Company company, string path)
        {
            AddToXML check = new AddToXML();

            if (check.ReturnAllUsers(path) == false)
            {
                AddToXML.CreateCompany(company, path);
            }
            else
            {
                AddToXML.AddCompany(company, path);
            }
        }
예제 #4
0
        public static void AddStudentAdmin(Student student, string path)
        {
            AddToXML check = new AddToXML();

            if (check.ReturnAllStudent(path) == false)
            {
                AddToXML.CreateStudent(student, path);
            }
            else
            {
                AddToXML.AddStudent(student, path);
            }
        }