public SchoolOtherInfo InsertUpdateSchoolOtherDetail([FromBody] SchoolOtherInfo schoolOtherInfo) { try { if (ModelState.IsValid) { if (schoolOtherInfo.MultimediaFile != null && !string.IsNullOrEmpty(schoolOtherInfo.MultimediaFile.data)) { schoolOtherInfo.logo = Utilities.SaveImage(schoolOtherInfo.MultimediaFile.data, schoolOtherInfo.MultimediaFile.fileType, FileSavePath.SCHOOLLOGOPATH.ToString()); } else { if (!string.IsNullOrEmpty(schoolOtherInfo.logo)) { schoolOtherInfo.logo = Path.GetFileName(schoolOtherInfo.logo); } } schoolOtherInfo.UpdateDate = DateTime.Now; schoolOtherInfo = _schoolService.InsertUpdateSchoolOtherInfo(schoolOtherInfo); } } catch (Exception ex) { throw new Exception(ex.Message); } return(schoolOtherInfo); }
public SchoolOtherInfo GetSchoolOtherInfo(string schoolUniqueId) { SchoolOtherInfo schoolOtherInfo = new SchoolOtherInfo(); try { if (!string.IsNullOrEmpty(schoolUniqueId)) { schoolOtherInfo = _schoolService.GetSchoolOtherInfoByUniqueId(schoolUniqueId); if (schoolOtherInfo != null && !string.IsNullOrEmpty(schoolOtherInfo.logo)) { schoolOtherInfo.LogoURL = Utilities.GetFileURL(schoolOtherInfo.logo, FileSavePath.SCHOOLLOGOPATH2.ToString()); if (!string.IsNullOrEmpty(schoolOtherInfo.SchoolTypeIds)) { var intArr = (schoolOtherInfo.SchoolTypeIds.Split('|')); schoolOtherInfo.SchoolTypeIdList = intArr.Select(c => int.Parse(c)).ToList(); } } } } catch (Exception ex) { throw new Exception(ex.Message); } return(schoolOtherInfo); }
public SchoolOtherInfo InsertUpdateSchoolOtherInfo(SchoolOtherInfo schoolOtherInfo) { return(_schoolRepo.InsertUpdateSchoolOtherInfo(schoolOtherInfo)); }