Esempio n. 1
0
        public ActionResult Update(CosmeticServiceModel cosmeticServicemodel)
        {
            if (!ModelState.IsValid)
            {
                return(View("Update", cosmeticServicemodel));
            }
            ;

            CosmeticService cosmeticService = new CosmeticService();

            cosmeticService.Id          = cosmeticServicemodel.Id.HasValue ? cosmeticServicemodel.Id.Value : 0;
            cosmeticService.Nameservice = cosmeticServicemodel.Nameservice;
            cosmeticService.Price       = cosmeticServicemodel.Price;
            cosmeticServiceService.Edit(cosmeticService);

            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        public ActionResult Update(BookingCosmeticServiceModel bookingCosmeticServiceModel)
        {
            if (!ModelState.IsValid)
            {
                return(View("Update", bookingCosmeticServiceModel));
            }
            ;

            BookingCosmeticService bookingCosmeticService = new BookingCosmeticService();

            bookingCosmeticService.Id          = bookingCosmeticServiceModel.Id.HasValue ? bookingCosmeticServiceModel.Id.Value : 0;
            bookingCosmeticService.Nameservice = bookingCosmeticServiceModel.Nameservice;
            bookingCosmeticService.Price       = bookingCosmeticServiceModel.Price;
            bookingCosmeticService.VisitData   = bookingCosmeticServiceModel.VisitData;
            bookingCosmeticService.MasterName  = bookingCosmeticServiceModel.MasterName;
            bookingCosmeticService.FirstName   = bookingCosmeticServiceModel.FirstName;
            bookingCosmeticService.LastName    = bookingCosmeticServiceModel.LastName;
            bookingCosmeticService.Phone       = bookingCosmeticServiceModel.Phone;
            cosmeticServiceService.Edit(bookingCosmeticService);

            return(RedirectToAction("Index"));
        }