public ActionResult _InsertSpeakerAjaxEditing() { var item = new Speaker(); if (TryUpdateModel(item)) { //HttpPostedFileBase file = Request.Files["UploadPhoto"]; //int i = ImageController.SaveImage(file, item.UploadPhotoID); //if (i != 0) //{ // item.UploadPhotoID = i; //} //HttpPostedFileBase file = Request.Files["UploadPhoto"]; //if (file != null) //{ // var fileName = Path.GetFileName(file.FileName); // var code = CH.GetDataById<Conferences>(item.ConferenceID).ProjectCode; // string serverpath = "/Uploads/Conferences/" + code; // string path = Server.MapPath(serverpath); // if (!Directory.Exists(path)) // { // Directory.CreateDirectory(path); // } // var physicalPath = Path.Combine(path, fileName); // file.SaveAs(physicalPath); // item.ImgPath = serverpath + "/" + fileName; //} CH.PDCreate <Speaker>(item); } return(Json(new { ConferenceID = item.ConferenceID })); }
public ActionResult _InsertOrganizationAjaxEditing() { var item = new Organization(); if (TryUpdateModel(item)) { CH.PDCreate <Organization>(item); } return(Json(new { ConferenceID = item.ConferenceID })); }