Example #1
0
 private void UpdateOrganizationLogo(int orgId)
 {
     try
     {
         string orgName      = OrganizationInfo.GetOrgLegalNameByOrgId(orgId);
         string fileName     = string.IsNullOrEmpty(orgName) ? "temp" : orgName + ".jpg"; //Server.HtmlEncode(fUpload.FileName);
         string RootPath     = ConfigurationManager.AppSettings["LogoUploadLocation"];
         string Completepath = RootPath + orgId + @"\" + fileName;                        // Server.MapPath(RootPath + orgId + @"\" + fileName);
         if (!Directory.Exists(RootPath + orgId))
         {
             Directory.CreateDirectory(RootPath + orgId);
         }
         if (System.IO.File.Exists(Completepath))
         {
             System.IO.File.Delete(Completepath);
         }
         //fUpload.SaveAs(Completepath);
         string stt = CreateThumbnail(Completepath, orgName);
         OrganizationInfo.UpdateOrganizationLogoPath(orgId, orgId + @"/" + stt);
     }
     catch (Exception ex)
     {
         new SqlLog().InsertSqlLog(0, "RegistrationFormUS.aspx UpdateOrganizationLogo", ex);
     }
 }