Example #1
0
        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 }));
        }
Example #2
0
        public ActionResult _InsertOrganizationAjaxEditing()
        {
            var item = new Organization();

            if (TryUpdateModel(item))
            {
                CH.PDCreate <Organization>(item);
            }
            return(Json(new { ConferenceID = item.ConferenceID }));
        }