public ActionResult AddOrEdit(string Id = "") { try { var data = lecturerService.GetLecturerByID(Id); if (data != null) { var model = new LecturerViewModel(); model.FullName = data.FullName; model.Code = data.Code; model.Degree = data.Degree; model.Url_Image = data.Url_Image; model.Url_Facebook = data.Url_Facebook; model.Phone = data.Phone; model.Email = data.Email; model.Serial = data.Serial; model.Position = data.Position; model.Academic_Rank = data.Academic_Rank; model.Specialized = data.Specialized; model.Title = data.Title; model.Native_Land = data.Native_Land; model.Url_Scientific_Works = data.Url_Scientific_Works; model.Specialized_Research = data.Specialized_Research; model.Teaching = data.Teaching; return(PartialView("CRUDLecturer", model)); } } catch (Exception) { } return(PartialView("CRUDLecturer", new LecturerViewModel())); }
private void PopulateUserInformationBox() { lecturer = _lecturerService.GetLecturerByID(Program.lecturer); if (lecturer.Photo == null) { pbxUserPicture.Image = pbxUserPicture.ErrorImage; } else { pbxUserPicture.Image = byteArrayToImage((byte[])lecturer.Photo); } lblUserFullName.Text = lecturer.FirstName + " " + (lecturer.MiddleName.Equals("") ? "" : lecturer.MiddleName + " ") + lecturer.LastName; }