示例#1
0
        public ActionResult DeleteStylist(int stylistId)
        {
            Stylist foundStylist = Stylist.Find(stylistId);

            foundStylist.Delete();
            return(RedirectToAction("Index"));
        }
示例#2
0
        public ActionResult Delete(int id)
        {
            Stylist selectedStylist = Stylist.Find(id);

            selectedStylist.Delete(id);
            return(RedirectToAction("Index"));
        }
示例#3
0
        public void Delete_DeletesStylistAssociationsFromDatabase_StylistList()
        {
            //Arrange
            Specialty testSpecialty = new Specialty("Title", "Description");

            testSpecialty.Save();

            string testName      = "Bill";
            string testEmail     = "*****@*****.**";
            string testStartDate = "12/12/2012";

            Stylist testStylist = new Stylist(testName, testEmail, testStartDate);

            testStylist.Save();

            //Act
            testStylist.AddSpecialty(testSpecialty);
            testStylist.Delete();

            List <Stylist> resultSpecialtyStylists = testSpecialty.GetStylists();
            List <Stylist> testSpecialtyStylists   = new List <Stylist> {
            };

            //Assert
            CollectionAssert.AreEqual(testSpecialtyStylists, resultSpecialtyStylists);
        }
        public IActionResult Delete(int id)
        {
            Stylist newStylist = Stylist.Find(id);

            newStylist.Delete();
            return(RedirectToAction("Index"));
        }
示例#5
0
        public ActionResult DeleteStylist(int id)
        {
            Stylist thisStylist = Stylist.Find(id);

            thisStylist.Delete();
            return(RedirectToAction("AllStylists"));
        }
示例#6
0
        public ActionResult Build(int id)
        {
            Stylist thisStylist = Stylist.Find(id);

            thisStylist.Delete();
            return(View("build"));
        }
示例#7
0
        public ActionResult Delete(int stylistId)
        {
            Stylist stylist = Stylist.Find(stylistId);

            stylist.Delete();
            return(View());
        }
        public ActionResult DeleteOne(int stylistId)
        {
            Stylist thisStylist = Stylist.Find(stylistId);

            thisStylist.Delete();
            return(RedirectToAction("Index"));
        }
示例#9
0
        public ActionResult Delete(int id)
        {
            Stylist foundStylist = Stylist.Find(id);

            foundStylist.Delete();
            return(RedirectToAction("Index", "stylist"));
        }
示例#10
0
        public void Delete_DeleteStylistandClientsfromDB_void()
        {
            //arrange
            Stylist newStylist1 = new Stylist("Carol", "Smith");

            newStylist1.Save();
            Client newClient1 = new Client("Tom", "Tomson", "503-555-1234");
            Client newClient2 = new Client("Bill", "Billson", "503-555-1234");

            newClient1.SetStylistId(newStylist1.GetId());
            newClient2.SetStylistId(newStylist1.GetId());
            newClient1.Save();
            newClient2.Save();

            Stylist newStylist2 = new Stylist("Jane", "Fonda");

            newStylist2.Save();
            Client newClient3 = new Client("Tom", "Tomson", "503-555-1234");
            Client newClient4 = new Client("Bill", "Billson", "503-555-1234");

            newClient3.SetStylistId(newStylist2.GetId());
            newClient4.SetStylistId(newStylist2.GetId());
            newClient3.Save();
            newClient4.Save();

            int numExistingClientsControl = 2;

            //act
            newStylist1.Delete();
            int result = Client.GetAllClients().Count;

            //assert
            Assert.AreEqual(numExistingClientsControl, result);
        }
示例#11
0
        public ActionResult Delete(int stylistId)
        {
            Stylist myStylist = Stylist.Find(stylistId);

            myStylist.Delete();
            return(RedirectToAction("Index", "Home"));
        }
示例#12
0
        public void Delete_StylistFromDatabase_Void()
        {
            //Arrange
            List <Stylist> testList = new List <Stylist>();
            Stylist        testStylist;

            testStylist = new Stylist("Buffy the Vampire Slayer");
            testStylist.Save();
            testList.Add(testStylist);

            testStylist = new Stylist("Terminator T-1000");
            testStylist.Save();
            testList.Add(testStylist);

            testStylist = new Stylist("Fred Flintstone");
            testStylist.Save();
            testList.Add(testStylist);

            testStylist = new Stylist("Terminator T-800");
            testStylist.Save();
            testList.Add(testStylist);

            testStylist = new Stylist("George Jetson");
            testStylist.Save();
            testList.Add(testStylist);

            //Act
            Stylist.Delete(3); // Why is Stylist ahead by one? Do I reindex somewhere?!
            testList.RemoveAt(2);

            //Assert
            CollectionAssert.AreEqual(testList, Stylist.GetAll());
        }
        public ActionResult StylistDelete(int stylistId)
        {
            Stylist.Delete(stylistId);
            List <Stylist> allStylist = Stylist.GetAll();

            return(View("Index", allStylist));
        }
示例#14
0
        public ActionResult DeleteStylist(int id)
        {
            Stylist myStylist = Stylist.Find(id);

            myStylist.Delete();
            return(RedirectToAction("Index"));
        }
示例#15
0
        public ActionResult DeleteStylist(int id)
        {
            Stylist thisStylist = Stylist.Find(id);

            thisStylist.Delete();
            return(View());
        }
        public ActionResult Delete(int id)
        {
            Stylist thisStylist = Stylist.Find(id);

            Stylist.Delete(thisStylist.Id);

            return(RedirectToAction("Index"));
        }
示例#17
0
        public ActionResult Delete(string stylistId)
        {
            int     intStylistId = int.Parse(stylistId);
            Stylist foundStylist = Stylist.Find(intStylistId);

            foundStylist.Delete();
            return(RedirectToAction("Index"));
        }
示例#18
0
        public ActionResult Delete(int id)
        {
            Stylist deleteStylist = Stylist.Find(id);

            deleteStylist.Delete();

            return(RedirectToAction("ViewAll"));
        }
示例#19
0
        public void Delete_DeleteStylist()
        {
            Stylist testStylist = new Stylist("James", "(111) 222-3333");

            testStylist.Save();
            testStylist.Delete();
            Assert.AreEqual(0, Stylist.GetAllStylists().Count);
        }
        public ActionResult Delete(int id)
        {
            Stylist foundStylist = Stylist.Search(id);

            foundStylist.Delete();

            return(View("Index", Stylist.GetAll()));
        }
示例#21
0
        public ActionResult Delete(int id)
        {
            Stylist thisStylist = Stylist.Find(id);

            thisStylist.Delete();
            List <Stylist> allStylists = Stylist.GetAll();

            return(View("Index", allStylists));
        }
示例#22
0
        public ActionResult Delete(int stylistId)
        {
            Stylist Stylist = Stylist.Find(stylistId);

            Stylist.Delete();
            List <Stylist> allStylists = Stylist.GetAll();

            return(RedirectToAction("Index", allStylists));
        }
示例#23
0
        public ActionResult DeleteStylist(int id)
        {
            Stylist newStylistId = Stylist.Find(id);

            newStylistId.Delete();
            List <Stylist> allStylists = Stylist.GetAll();

            return(RedirectToAction("Index", allStylists));
        }
示例#24
0
        public ActionResult DeleteStylist(int id)
        {
            Stylist stylist = Stylist.Find(id);

            stylist.Delete();
            List <Stylist> allStylists = Stylist.GetAll();

            return(View("StylistList", allStylists));
        }
示例#25
0
        public ActionResult DeleteStylist(int id)
        {
            Stylist selectStylist = Stylist.Find(id);

            selectStylist.Delete();
            selectStylist.DeleteFromJoin();

            return(View());
        }
示例#26
0
        public ActionResult Delete(int stylistId)
        {
            Dictionary <string, object> model = new Dictionary <string, object>();
            Stylist stylist = Stylist.Find(stylistId);

            stylist.Delete();
            model.Add("stylist", stylist);
            return(View(model));
        }
示例#27
0
        public ActionResult Delete(int id)
        {
            Stylist stylist = Stylist.GetByID(id);

            if (stylist != null)
            {
                stylist.Delete();
            }
            return(Redirect("/stylists"));
        }
示例#28
0
        public ActionResult Destroy(int stylistId)
        {
            Stylist stylist = Stylist.Find(stylistId);

            Console.WriteLine(stylist.Name);
            stylist.Delete();
            List <Stylist> allStylists = Stylist.GetAll();

            return(RedirectToAction("Index", allStylists));
        }
示例#29
0
        public void Delete_DeletesCorrectInstance_GetAllEmpty()
        {
            Stylist newStylist = new Stylist("Cutter", "O'Hare");

            newStylist.Save();
            newStylist.Delete();
            int expected = 0;
            int actual   = Client.GetAll().Count;

            Assert.AreEqual(expected, actual);
        }
        public void Delete_DeletesStylistInDatabase_Stylist()
        {
            Stylist testStylist = new Stylist("Jim", 2067130144, "*****@*****.**", 4, 1);

            testStylist.Save();
            testStylist.Delete();
            List <Stylist> testList2 = new List <Stylist> {
            };

            CollectionAssert.AreEqual(testList2, Stylist.GetAll());
        }