Ejemplo n.º 1
0
        public ActionResult FileUpload(AddImagesModel model)
        {
            string text = "";

            if (model.file != null)
            {
                string path = System.IO.Path.Combine(
                    Server.MapPath("~/Images"), "");
                ObjectFactory factory  = new ObjectFactory(repository);
                IAddImage     addImage = factory.CreateObject(model.type.ToString());
                text = addImage.AddPathToEntity(model.Id, path);

                if (text == "")
                {
                    return(View("AddImagesToMany"));
                }


                model.file.SaveAs(path + text);
            }

            if (text.Contains("Hotel"))
            {
                return(RedirectToAction("EditHotel", new { id = text[6] }));
            }
            else
            {
                return(RedirectToAction("EditResort", new { id = text[7] }));
            }
        }
Ejemplo n.º 2
0
        public ActionResult AddPictures(int Id, int type)
        {
            AddImagesModel model = new AddImagesModel();

            model.Id   = Id;
            model.type = (AddPictureType)type;

            return(View("AddImages", model));
        }