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(); }
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" }; }
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"); } }
public UsersController(PiContext context) { _context = context; }
public PriceRepository(Func <PiContext> contextMaker) { this.contextMaker = contextMaker; PiContext = contextMaker.Invoke(); }
public TestService() { _picontext = new PiContext(); _picontext.Database.Initialize(force: false); }
public FamiliesController(PiContext context) { _context = context; }
public static void init() { _context = new PiContext(); }
public BinanceRepository(PiContext dbContext) { PiContext = dbContext; }
public DatabaseFactory() { dataContext = new PiContext(); }
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(); }
public PiServices() { this._context = new PiContext(); _context.Database.Initialize(force: false); }