/// <summary> /// Uplaod the translation PDF - rename to proper PDF name /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void btnUpload_Click(object sender, EventArgs e) { // TODO: Implement this method //get the PDF file and save it with proper renamed name as of that menu bool error = false; try { if (RadAsyncUploadTranslation.UploadedFiles.Count == 0) { return; } if (!string.IsNullOrEmpty(txtMenucode.Text)) { var menu = _menuManagement.GetMenuByMenuCode(txtMenucode.Text); if (menu != null) { string EmmaPDFPathFolder = (System.Configuration.ConfigurationManager.AppSettings["EmmaPDFPathFolder"]); UploadedFile attachment = RadAsyncUploadTranslation.UploadedFiles[0]; var menuTemplate = _menuManagement.GetMenuTemplate(menu.Id); var outfilePath = _menuProcessor.GetPdfFileName(Convert.ToInt64(menu.CycleId), menu.Id, menuTemplate.TemplateID, Convert.ToInt32(menu.LanguageId)); attachment.SaveAs(EmmaPDFPathFolder + @"\MENU PDFS\" + outfilePath, true); } } } catch (Exception ex) { //write to Elma ErrorSignal.FromCurrentContext().Raise(ex); error = true; } if (!error) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "TranslationFileSaved", "TranslationFileSaved();", true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "TranslationFileSaveFailed", "TranslationFileSaveFailed();", true); } }