private void SetAutoCompletionForTreatmentsNames()
        {
            var namesCollection = new AutoCompleteStringCollection();

            namesCollection.AddRange(TreatmentManager.GetAllTreatments().Select(t => t.Name).ToArray());
            SetAutoCompleteSourceForTextBox(txtTreatmentName, namesCollection);
        }
 private void btnAddTreatment_Click(object sender, EventArgs e)
 {
     Cursor = Cursors.WaitCursor;
     if (string.IsNullOrEmpty(txtTreatmentName.Text.FullTrim()))
     {
         txtTreatmentName.BackColor = ErrorColor;
         Cursor = Cursors.Default;
         return;
     }
     if (!TreatmentManager.IsTreatmentFoundByName(txtTreatmentName.Text.FullTrim()))
     {
         TreatmentManager.AddTreatment(new Treatment {
             Name = txtTreatmentName.Text.FullTrim()
         });
     }
     Treatments.Add(new ExaminationTreatmentVm
     {
         TreatmentName        = txtTreatmentName.Text.FullTrim(),
         TreatmentDescription = txtTreatmentDescription.Text.FullTrim()
     });
     ClearTreatmentsInputs();
     FillTreatmentsGrid();
     SetAutoCompletionForTreatmentsNames();
     SetAutoCompletionForTreatmentsDescription();
     Cursor = Cursors.Default;
 }
Esempio n. 3
0
        public void DeleteTreatment()
        {
            Treatment treatment = TreatmentFactory.Instance().CreateTreatment(treatmentType, operationRoom, cage, item, DateTime.Now, DateTime.Now, true, "", true, animal, employee, 0);

            TreatmentManager treatmentManager = new TreatmentManager();
            string           treatmentt       = treatmentManager.DeleteTreatment(treatmentID);

            Assert.AreNotEqual("OK", treatmentt);
        }
Esempio n. 4
0
        public void CreateTreatmentTestMethod()
        {
            Treatment treatment = TreatmentFactory.Instance().CreateTreatment(treatmentType, operationRoom, cage, item, DateTime.Now, DateTime.Now, true, "", true, animal, employee, 0);

            TreatmentManager treatmentManager = new TreatmentManager();
            Treatment        treatmentt       = treatmentManager.CreateTreatment(treatment);

            Assert.AreNotEqual(0, treatmentt.treatmentID);
            treatmentID = treatment.treatmentID;
        }
 private void EditTreatment(bool editAnother = false)
 {
     if (string.IsNullOrEmpty(txtTreatmentOldName.Text.FullTrim()))
     {
         txtTreatmentOldName.BackColor = ErrorColor;
         txtTreatmentOldName.Focus();
         return;
     }
     if (string.IsNullOrEmpty(txtTreatmentNewName.Text.FullTrim()))
     {
         txtTreatmentNewName.BackColor = ErrorColor;
         return;
     }
     Treatment = TreatmentManager.GeTreatmentByName(txtTreatmentOldName.Text);
     if (Treatment == null)
     {
         ShowErrorMsg("لا يوجد علاج بهذا الاسم");
     }
     else
     {
         if (txtTreatmentNewName.Text.FullTrim() == txtTreatmentOldName.Text.FullTrim())
         {
             ShowErrorMsg("لا يمكن الحفظ بنفس الاسم");
             return;
         }
         if (TreatmentManager.IsTreatmentFoundByName(txtTreatmentNewName.Text.FullTrim()))
         {
             ShowErrorMsg("يوجد علاج آخر بنفس الاسم");
             return;
         }
         Treatment.Name = txtTreatmentNewName.Text.FullTrim();
         TreatmentManager.UpdateTreatment(Treatment);
         if (!editAnother)
         {
             Close();
         }
         ResetForm();
         txtTreatmentOldName.Focus();
         _treatments = null;
         SetAutoCompletion();
     }
 }
Esempio n. 6
0
 public TreatmentController(ILogger <TreatmentController> logger, TreatmentManager treatmentManager, DogManager dogManager)
 {
     _logger           = logger;
     _treatmentManager = treatmentManager;
     _dogManager       = dogManager;
 }
Esempio n. 7
0
        protected override void Seed(ApplicationDbContext context)
        {
            //default roles
            var superUserRole = new Role
            {
                Name = "SuperUser"
            };
            var staffRole = new Role
            {
                Name = "Staff"
            };
            var userRole = new Role
            {
                Name = "Client"
            };
            var roleManager = new DatabaseContext.Models.RoleManager <Role>(new RoleStore(context));

            roleManager.Create(superUserRole);
            roleManager.Create(staffRole);
            roleManager.Create(userRole);

            //default users
            var UserManager  = new UserManager <User, int>(new UserStore(context));
            var PasswordHash = new PasswordHasher();

            //SuperUser
            if (!context.Users.Any(u => u.UserName == "*****@*****.**"))
            {
                var user = new User
                {
                    UserName     = "******",
                    Email        = "*****@*****.**",
                    PasswordHash = PasswordHash.HashPassword("123456")
                };

                UserManager.Create(user);
                UserManager.AddToRole(user.Id, superUserRole.Name);
            }

            //staff Dr.Akula
            if (!context.Users.Any(u => u.UserName == "*****@*****.**"))
            {
                var user = new User
                {
                    UserName     = "******",
                    Email        = "*****@*****.**",
                    PasswordHash = PasswordHash.HashPassword("123456")
                };

                UserManager.Create(user);
                UserManager.AddToRole(user.Id, staffRole.Name);
            }

            //User Alice
            if (!context.Users.Any(u => u.UserName == "*****@*****.**"))
            {
                var user = new User
                {
                    UserName       = "******",
                    Email          = "*****@*****.**",
                    PasswordHash   = PasswordHash.HashPassword("123123"),
                    LockoutEnabled = false
                };

                UserManager.Create(user);
                UserManager.AddToRole(user.Id, userRole.Name);
            }

            //User Carry
            if (!context.Users.Any(u => u.UserName == "*****@*****.**"))
            {
                var user = new User
                {
                    UserName       = "******",
                    Email          = "*****@*****.**",
                    PasswordHash   = PasswordHash.HashPassword("123123"),
                    LockoutEnabled = false
                };

                UserManager.Create(user);
                UserManager.AddToRole(user.Id, userRole.Name);
            }

            //default clinic
            if (!context.Clinics.Any(n => n.BusinessName == "Miricos Aesthetics Clinic"))
            {
                var now   = DateTime.Now;
                var hours = new List <ClinicHours>()
                {
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 10, 0, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 19, 0, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 10, 0, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 19, 0, 0, 0),
                        Day = DayOfWeek.Tuesday
                    },
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 10, 0, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 19, 0, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 10, 0, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 19, 0, 0, 0),
                        Day = DayOfWeek.Wednesday
                    },
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 10, 0, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 19, 0, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 10, 0, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 19, 0, 0, 0),
                        Day = DayOfWeek.Thursday
                    },
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 10, 0, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 19, 0, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 10, 0, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 19, 0, 0, 0),
                        Day = DayOfWeek.Friday
                    },
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 10, 0, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 16, 0, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 10, 0, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 16, 0, 0, 0),
                        Day = DayOfWeek.Saturday
                    }
                };
                var clinicManager = new ClinicManager();
                var newClinic     = clinicManager.CreateOrUpdate(new Clinic
                {
                    BusinessName                  = "Miricos Aesthetics Clinic",
                    ShortName                     = "MAS",
                    BusinessAddress               = "Level 2, 340 Collins Street, Melbourne VIC 3000",
                    OwnersName                    = "Ricky Lee",
                    OwnersEmailAddress            = "*****@*****.**",
                    OwnersPhoneNumber             = "+61435782764",
                    BusinessWebsiteAddress        = "www.miricos.com.au",
                    EmailAddressForOnlineBookings = "*****@*****.**",
                    DirectPhoneToTheLocation      = "03 9913 7362",
                    ContactPerson                 = "Kitshi Hui",
                    StoreManagerPhoneNumber       = "03 9913 7362",
                    WebsiteLocationAddress        = "Level 2, 340 Collins Street, Melbourne VIC 3000",
                    IsActive          = true,
                    City              = "Melbourne",
                    State             = "VIC 3000",
                    Address           = "Level 2, 340 Collins Street, Melbourne VIC 3000",
                    Email             = "*****@*****.**",
                    Hours             = hours,
                    BankAccountName   = "Miricos Pty Ltd.",
                    BankBsb           = "013257",
                    BankAccountNumber = "398887026"
                });
            }

            if (!context.Clinics.Any(n => n.BusinessName == "Esteem Hair Beauty Spa"))
            {
                var now   = DateTime.Now;
                var hours = new List <ClinicHours>()
                {
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 17, 30, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 17, 30, 0, 0),
                        Day = DayOfWeek.Monday
                    },
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 17, 30, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 17, 30, 0, 0),
                        Day = DayOfWeek.Tuesday
                    },
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 19, 0, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 19, 0, 0, 0),
                        Day = DayOfWeek.Wednesday
                    },
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 21, 0, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 21, 0, 0, 0),
                        Day = DayOfWeek.Thursday
                    },
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 17, 30, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 17, 30, 0, 0),
                        Day = DayOfWeek.Friday
                    },
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 8, 30, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 16, 0, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 8, 30, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 16, 0, 0, 0),
                        Day = DayOfWeek.Saturday
                    }
                };
                var clinicManager = new ClinicManager();
                var newClinic     = clinicManager.CreateOrUpdate(new Clinic
                {
                    BusinessName                  = "Esteem Hair Beauty Spa",
                    ShortName                     = "EHBS",
                    BusinessAddress               = "Shop 15 Tattersalls Centre 510 - 536 High Street Penrith NSW 2750",
                    ABN                           = "73518997490",
                    OwnersName                    = "Martin Lazare",
                    OwnersEmailAddress            = "*****@*****.**",
                    OwnersPhoneNumber             = "402068707",
                    BusinessWebsiteAddress        = "www.esteemhairbeautyspa.com.au",
                    EmailAddressForOnlineBookings = "*****@*****.**",
                    DirectPhoneToTheLocation      = "(02) 47223250",
                    ContactPerson                 = "Martin Lazare",
                    StoreManagerPhoneNumber       = "402068707",
                    WebsiteLocationAddress        = "Shop 15 Tattersalls Centre 510 - 536 High Street Penrith NSW 2750",
                    IsActive                      = true,
                    City                          = "Penrith",
                    State                         = "NSW 2750",
                    Address                       = "Shop 15 Tattersalls Centre 510 - 536 High Street Penrith NSW 2750",
                    Email                         = "*****@*****.**",
                    Hours                         = hours,
                    BankAccountName               = "Esteem Hair Beauty Spa",
                    BankBsb                       = "12429",
                    BankAccountNumber             = "457356912",
                    HowToFind                     = "Centrally Located on High Street Penrtih across the road from Trade Secret and within 2 minutes walk of Westfield shopping centre. Best parking union lane carpark behind the tattersalls centre."
                });
            }

            if (!context.Clinics.Any(n => n.BusinessName == "Sunlounge tanning and beauty"))
            {
                var now   = DateTime.Now;
                var hours = new List <ClinicHours>()
                {
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 17, 0, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 17, 0, 0, 0),
                        Day = DayOfWeek.Tuesday
                    },
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 17, 0, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 17, 0, 0, 0),
                        Day = DayOfWeek.Wednesday
                    },
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 17, 0, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 17, 0, 0, 0),
                        Day = DayOfWeek.Thursday
                    },
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 21, 0, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 21, 0, 0, 0),
                        Day = DayOfWeek.Friday
                    },
                    new ClinicHours
                    {
                        BookingOpenHour  = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        BookingCloseHour = new DateTime(now.Year, now.Month, now.Day, 17, 0, 0, 0),
                        OpenHour         = new DateTime(now.Year, now.Month, now.Day, 9, 0, 0, 0),
                        CloseHour        = new DateTime(now.Year, now.Month, now.Day, 17, 0, 0, 0),
                        Day = DayOfWeek.Saturday
                    }
                };
                var clinicManager = new ClinicManager();
                var newClinic     = clinicManager.CreateOrUpdate(new Clinic
                {
                    BusinessName                  = "Sunlounge tanning and beauty",
                    ShortName                     = "STB",
                    BusinessAddress               = "43 the parade norwood SA 5067",
                    ABN                           = "30605284124",
                    OwnersName                    = "Daniel Borg",
                    OwnersEmailAddress            = "*****@*****.**",
                    OwnersPhoneNumber             = "405529989",
                    BusinessWebsiteAddress        = "sunloungetanningandbeauty.com.au",
                    EmailAddressForOnlineBookings = "*****@*****.**",
                    DirectPhoneToTheLocation      = "08 83626211",
                    ContactPerson                 = "Amy Minervini",
                    StoreManagerPhoneNumber       = "08 83626211",
                    WebsiteLocationAddress        = "sunloungetanningandbeauty.com.au",
                    IsActive                      = true,
                    City                          = "Norwood",
                    State                         = "SA 5067",
                    Address                       = "43 the parade norwood SA 5067",
                    Email                         = "sunloungetanningandbeauty.com.au",
                    Hours                         = hours,
                    BankAccountName               = "Rejuv cosmedical",
                    BankBsb                       = "065-115",
                    BankAccountNumber             = "1040 7681",
                    HowToFind                     = "On the cnr of the Parade and Sydenham road Norwood."
                });
            }

            //Treatment category
            if (!context.TreatmentCategories.Any(n => n.Name == "Whitening"))
            {
                var manager    = new TreatmentCategoryManager();
                var categoryId = manager.CreateOrUpdate(new TreatmentCategory()
                {
                    Description = "Whitening",
                    Name        = "Whitening",
                    PictureUrl  = "Whitening"
                });

                var treatmentManager = new TreatmentManager();
                var url = "http://drperrone.com/blog/wp-content/uploads/2012/06/smiles-300x300.jpg";
                treatmentManager.CreateOrUpdate(new Treatment()
                {
                    Name                = "Whitening",
                    Description         = "Whitening",
                    PictureUrl          = url,
                    Price               = 120,
                    TreatmentCategoryId = categoryId
                });
            }
        }
        public ActionResult Treatments()
        {
            List <TreatmentViewModel> models = new TreatmentManager().GetAllTreatmentsWithServiceName();

            return(View("Treatments", models));
        }
        public ActionResult GetBaseTreatments()
        {
            List <Treatment> models = new TreatmentManager().GetTreatments();

            return(View("Treatments", models));
        }
        public ActionResult Delete(Guid treatmentGuid)
        {
            int result = new TreatmentManager().Destroy(treatmentGuid);

            return(RedirectToAction("Treatments"));
        }
 public ActionResult Update(Treatment model)
 {
     model = new TreatmentManager().Update(model);
     return(RedirectToAction("Treatments"));
 }
        public ActionResult Update(Guid treatmentGuid)
        {
            Treatment model = new TreatmentManager().Read(treatmentGuid);

            return(View("Update", model));
        }
        // GET: Treatment
        public ActionResult _Treatment(Guid serviceGuid)
        {
            Treatment model = new TreatmentManager().Read(serviceGuid);

            return(PartialView("_Treatment", model));
        }