Esempio n. 1
0
        static void Main(string[] args)
        {
            PiContext ctx = new PiContext();
            Course    c   = new Course {
            };

            /*     Patient u = new Patient { Email = "*****@*****.**",
             *     adress = "1 rue de sfax",
             *     UserName="******",
             *     PasswordHash="sameh",
             *     lastName="Garouachi",
             *     birthDate=DateTime.Now,
             *     course=c };
             *   //    ctx.Users.Add(u);
             *   //   ctx.SaveChanges();
             *   //  c.steps
             *   //  SC.Add(c);
             *   ctx.Courses.Add(c);
             *   ctx.Users.Add(u);*/


            List <Appointment> appointments = new List <Appointment>()
            {
                new Appointment {
                    state = State.Done, Date = DateTime.Now
                },
                new Appointment {
                    state = State.Done, Date = DateTime.Now
                },
                new Appointment {
                    state = State.Done, Date = DateTime.Now
                },
                new Appointment {
                    state = State.Done, Date = DateTime.Now
                },
                new Appointment {
                    state = State.Done, Date = DateTime.Now
                },
                new Appointment {
                    state = State.Done, Date = DateTime.Now
                },
                new Appointment {
                    state = State.Done, Date = DateTime.Now
                },
                new Appointment {
                    state = State.Done, Date = DateTime.Now
                }
            };

            ctx.Appointments.AddRange(appointments);
            ctx.SaveChanges();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            PiContext ctx = new PiContext();

            /*  User u = new User { Email = "*****@*****.**",
             * Password= "******",
             * adress = "1 rue de sfax",
             * UserName="******",
             * gender=Gender.
             * female,
             * lastName="Garouachi",
             * birthDate=DateTime.Now};*/
            //    ctx.Users.Add(u);
            //   ctx.SaveChanges();


            Disponibility dispo = new Disponibility {
                startTimeOfDisponibility = DateTime.Now, endTimeOfDisponibility = DateTime.Now
            };
            List <Disponibility> disponibilities = new List <Disponibility>();

            disponibilities.Add(dispo);
            Address DocAdd = new Address {
                country = "France", city = "paris", Street = "Montrouge"
            };

            User doctor1 = new Doctor {
                firstName = "malek", lastName = "malek", PhoneNumber = "99574476", disponibilities = disponibilities, Email = "*****@*****.**", address = DocAdd
            };
            User patient1 = new Patient {
                firstName = "malek1", lastName = "malek1", PhoneNumber = "99574476", Email = "*****@*****.**", address = DocAdd
            };
            Appointment apointment = new Appointment {
                state = State.accepted, doctor = doctor1, patient = patient1, appointementDate = DateTime.Now, reason = "rassi youja3 fiya"
            };
        }
Esempio n. 3
0
        private void AddUsersAndRoles()
        {
            PiContext context     = new PiContext();
            var       UserManager = new UserManager <User>(new UserStore <User>(context));
            var       RoleManager = new RoleManager <IdentityRole>(new RoleStore <IdentityRole>(context));

            if (!RoleManager.RoleExists("Doctor"))
            {
                var roleresult = RoleManager.Create(new IdentityRole("Doctor"));
            }

            if (!RoleManager.RoleExists("Patient"))
            {
                var roleresult = RoleManager.Create(new IdentityRole("Patient"));
            }


            if (!RoleManager.RoleExists("Admin"))
            {
                var roleresult = RoleManager.Create(new IdentityRole("Admin"));
            }

            var user = new User
            {
                UserName = "******",
                Email    = "*****@*****.**"
            };

            string pwd         = "Administration1234$";
            var    adminResult = UserManager.Create(user, pwd);

            if (adminResult.Succeeded)
            {
                UserManager.AddToRole(user.Id, "Admin");
            }
        }
Esempio n. 4
0
 public UsersController(PiContext context)
 {
     _context = context;
 }
Esempio n. 5
0
 public PriceRepository(Func <PiContext> contextMaker)
 {
     this.contextMaker = contextMaker;
     PiContext         = contextMaker.Invoke();
 }
Esempio n. 6
0
 public TestService()
 {
     _picontext = new PiContext();
     _picontext.Database.Initialize(force: false);
 }
Esempio n. 7
0
 public FamiliesController(PiContext context)
 {
     _context = context;
 }
Esempio n. 8
0
 public static void init()
 {
     _context = new PiContext();
 }
Esempio n. 9
0
 public BinanceRepository(PiContext dbContext)
 {
     PiContext = dbContext;
 }
Esempio n. 10
0
 public DatabaseFactory()
 {
     dataContext = new PiContext();
 }
Esempio n. 11
0
 public static void init()
 {
     _context = new PiContext();
     _wb      = new AnswerWebService();
     _pi      = new PiServices();
 }
 public UnitOfWork(IDatabaseFactory dbFactory)
 {
     this.dbFactory = dbFactory;
     dataContext    = dbFactory.DataContext;
 }
 //     IServicePatient Ips;
 //  IServicesDoctor Ids;
 public ServiceAppointment() : base(UOW)
 {
     pc = new PiContext();
     // ps = new ServicePatient();
     // ds = new ServicesDoctor();
 }
Esempio n. 14
0
 public PiServices()
 {
     this._context = new PiContext();
     _context.Database.Initialize(force: false);
 }