public ActionResult MethodForRuslan() { Doctor newAdmin; Role newRole; if (!IsHaveAdmin_MethotForRuslan()) { newAdmin = new Doctor(); newAdmin.Email = "*****@*****.**"; newAdmin.Password = PasswordHasher.GetHashPassword("123"); newAdmin.Name = "Admin"; newAdmin.ConfirmAdmin = true; newAdmin.ConfirmEmail = true; _repository.AddDoctor(newAdmin); FillDataBase(); } if (!IsHaveRoles_MethodForRuslan()) { newRole = new Role(); newRole.Name = "Admin"; newRole.Code = "Admin"; _repository.AddRole(newRole); } Doctor currentDoctor = _repository.GetDoctorByName("Admin"); Role currentRole = _repository.GetRoleByName("Admin"); _repository.MakeAdmin(currentDoctor.ID, currentRole.ID); return View(); }
partial void DeleteDoctor(Doctor instance);
partial void UpdateDoctor(Doctor instance);
partial void InsertDoctor(Doctor instance);
private void FillDataBase() { Client firstClient = new Client(); firstClient.Name = "Митрон П.Е."; firstClient.Email = "*****@*****.**"; _repository.AddClient(firstClient); firstClient = _repository.GetClientByName(firstClient.Name); Pet firstPet = new Pet(); firstPet.Name = "Шарик"; firstPet.Kind = "Собака"; firstPet.Master = firstClient.ID; _repository.AddPet(firstPet); Pet secondPet = new Pet(); secondPet.Name = "Борис"; secondPet.Kind = "Кот"; secondPet.Master = firstClient.ID; _repository.AddPet(secondPet); Doctor firstDoctor = new Doctor(); firstDoctor = new Doctor(); firstDoctor.Email = "[email protected]"; firstDoctor.Password = PasswordHasher.GetHashPassword("123"); firstDoctor.Name = "Викторов П.М."; firstDoctor.ConfirmAdmin = true; firstDoctor.ConfirmEmail = true; _repository.AddDoctor(firstDoctor); Procedure firstProcedure = new Procedure(); firstProcedure.Title = "Прививка"; firstProcedure.Cost = 15000; _repository.AddProcedure(firstProcedure); Schedule firstSchedule = new Schedule(); firstSchedule.Date = DateTime.Now.AddDays(1).Date; firstSchedule.Doctor = _repository.GetDoctorByName("Викторов П.М.").ID; firstSchedule.Pet = _repository.GetPetnByName("Борис").ToList()[0].ID; //firstSchedule.Procedure = 1; firstSchedule.Title = "Плановый прием"; firstSchedule.Text = "Сделать прививку"; firstSchedule.Time = "10:30"; _repository.AddSchedule(firstSchedule); }
private void SaveClient(Doctor newDoctor) { _repository.AddDoctor(newDoctor); }
private bool SendEmail(Doctor currentDoctor) { MailSandler mail = new MailSandler(); return mail.SendEmail(string.Format("Для завершения регистрации перейдите по ссылке: {0}", Url.Action("ConfirmEmail", "Doctor", new { doctorID = currentDoctor.ID }, Request.Url.Scheme)), currentDoctor.Email); }