Exemplo n.º 1
0
        public ChoiceImage Create(ChoiceImage choiceImage)
        {
            EChoiceImage eChoiceImage = EChoice(choiceImage);

            eChoiceImage = _iDChoiceImage.Create(eChoiceImage);
            return(Choice(eChoiceImage));
        }
Exemplo n.º 2
0
        private ChoiceImage Choice(EChoiceImage eChoiceImage)
        {
            ChoiceImage returnChoiceImage = new ChoiceImage
            {
                ChoiceId      = eChoiceImage.ChoiceId,
                ChoiceImageId = eChoiceImage.ChoiceImageId,

                Url = eChoiceImage.Url
            };

            return(returnChoiceImage);
        }
Exemplo n.º 3
0
        private EChoiceImage EChoice(ChoiceImage choiceImage)
        {
            EChoiceImage returnEChoiceImage = new EChoiceImage
            {
                ChoiceId      = choiceImage.ChoiceId,
                ChoiceImageId = choiceImage.ChoiceImageId,

                Url = choiceImage.Url
            };

            return(returnEChoiceImage);
        }
 public ActionResult ChoiceAddImage(ChoiceImage choiceImage, int choiceId, HttpPostedFileBase file)
 {
     if (file.ContentLength > 0)
     {
         var fileName = Path.GetFileName(file.FileName);
         fileName = fileName.Split('\\').Last(); //This will fix problems when uploading using IE
         var path = Path.Combine(Server.MapPath("~/Content/Images"), fileName);
         file.SaveAs(path);
         choiceImage.Url = path;
     }
     _iFChoiceImage.Create(choiceImage);
     return(Json(string.Empty));
 }
        //[HttpPost]
        //public JsonResult Update(ChoiceImage choiceImage)
        //{
        //    return Json(_iFChoiceImage.Update(choiceImage));
        //}
        #endregion

        #region Delete
        public JsonResult Delete(ChoiceImage choiceImage)
        {
            _iFChoiceImage.Delete(choiceImage);
            return(Json(string.Empty));
        }
Exemplo n.º 6
0
 public void Delete(ChoiceImage choiceImage)
 {
     _iDChoiceImage.Delete(EChoice(choiceImage));
 }
Exemplo n.º 7
0
 public JsonResult Create(ChoiceImage choiceImage)
 {
     _iFChoiceImage.Create(choiceImage);
     return Json(string.Empty);
 }