public ChoiceImage Create(ChoiceImage choiceImage) { EChoiceImage eChoiceImage = EChoice(choiceImage); eChoiceImage = _iDChoiceImage.Create(eChoiceImage); return(Choice(eChoiceImage)); }
private ChoiceImage Choice(EChoiceImage eChoiceImage) { ChoiceImage returnChoiceImage = new ChoiceImage { ChoiceId = eChoiceImage.ChoiceId, ChoiceImageId = eChoiceImage.ChoiceImageId, Url = eChoiceImage.Url }; return(returnChoiceImage); }
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)); }
public void Delete(ChoiceImage choiceImage) { _iDChoiceImage.Delete(EChoice(choiceImage)); }
public JsonResult Create(ChoiceImage choiceImage) { _iFChoiceImage.Create(choiceImage); return Json(string.Empty); }