public ActionResult GetUniversityDropDownList() { var bsUniversity = new BLUniversity(); var universityList = bsUniversity.GetUniversitySelectListItem(0, int.MaxValue); return(Json(universityList, JsonRequestBehavior.AllowGet)); }
public ActionResult LoadUniversityPictureUrl(int universityId) { var result = true; var blUniversity = new BLUniversity(); var jsonData = new { universityPictureUrl = blUniversity.GetUniversityPictureUrl(universityId) ?? "", success = result, message = "Your University picture updated." }; return(Json(jsonData, JsonRequestBehavior.AllowGet)); //return View("../Author/PersonEdit", model); }
public ActionResult UploadUniversityImage(int universityId, string oldUniversityPictureUrl, HttpPostedFileBase uploadedUniversityPicture) { var result = true; var blUniversity = new BLUniversity(); string universityPictureUrl = string.Empty; try { if (ModelState.IsValid) { Image image = Image.FromStream(uploadedUniversityPicture.InputStream); Bitmap bitmap = new Bitmap(image); ResizePicture(ref bitmap); universityPictureUrl = UIHelper.UploadPictureFile(bitmap, uploadedUniversityPicture.FileName, uploadedUniversityPicture.ContentLength, uploadedUniversityPicture.ContentType, "/Resources/Uploaded/Universities/" + CurrentUserId.Replace("-", "")); result = blUniversity.UploadUniversityImage(universityId, universityPictureUrl); } } catch (Exception ex) { result = false; } //if (result != false && !string.IsNullOrEmpty(universityPictureUrl)) //{ // UIHelper.DeleteFile(oldUniversityPictureUrl); //} var jsonData = new { universityPictureUrl, success = result, message = "Your University picture updated." }; return(Json(jsonData, JsonRequestBehavior.AllowGet)); //return View("../Author/PersonEdit", model); }
public ActionResult Register(string returnUrl = "") { var UserRoles = TempData["UserRoles"] as IEnumerable <string>; var blUniversity = new BLUniversity(); var universityList = blUniversity.GetUniversitySelectListItem(0, int.MaxValue); return(View( new RegisterViewModel() { UniversityList = from u in universityList select new SelectListItem { Text = u.Text, Value = u.Value }, CurrentUserRoles = UserRoles, ReturnUrl = returnUrl })); }