protected void RadButtonCMYKDelete_Click(object sender, EventArgs e) { Models.PDFProcess pdfProcess = Utils.GetPDFProcessFromName(RadListBoxPrintProfiles.SelectedValue); DataProviders.DBaccess db = new DataProviders.DBaccess(); if (db.DeletePDFProcess(pdfProcess.ProcessID, out string errmsg) == false) { Utils.WriteLog(false, "db.DeletePDFProcess() - " + errmsg); } FillPdfCmykProfileList(true); }
protected void RadListBoxPrintProfiles_SelectedIndexChanged(object sender, EventArgs e) { if (txtHiddenID.Value == "99") { return; } Models.PDFProcess pdfProcess = Utils.GetPDFProcessFromName(RadListBoxPrintProfiles.SelectedValue); if (pdfProcess != null) { SetPrintProfileToControls(pdfProcess); } }
private void SetPrintProfileToControls(Models.PDFProcess pdfProcess) { txtCMYKProfileName.Text = pdfProcess.ProcessName.Replace(" (CMYK)", ""); RadDropDownListPrintProfile.SelectedText = pdfProcess.ConvertProfile.Replace(".kfpx", ""); RadDropDownListPDFVersion.SelectedValue = "0"; RadRadioButtonListCMYKmethod.SelectedIndex = pdfProcess.ExternalProcess ? 1 : 0; txtCMYKInputFolder.Text = pdfProcess.ExternalInputFolder; txtCMYKOutputFolder.Text = pdfProcess.ExternalOutputFolder; txtCMYKErrorFolder.Text = pdfProcess.ExternalErrorFolder; RadNumericTextBoxCMYKTimeout.Value = pdfProcess.ProcessTimeOut; txtHiddenID.Value = pdfProcess.ProcessID.ToString(); }
protected void RadButtonCMYKSave_Click(object sender, EventArgs e) { int id = Utils.StringToInt(txtHiddenID.Value); Models.PDFProcess pdfProcess = null; if (id > 0 && id < 99) { pdfProcess = Utils.GetPDFProcessFromID(id); } if (pdfProcess == null) { pdfProcess = new Models.PDFProcess(); } pdfProcess.ProcessName = txtCMYKProfileName.Text; pdfProcess.ConvertProfile = RadDropDownListPrintProfile.SelectedText; if (pdfProcess.ConvertProfile.IndexOf(".kfpx") == -1) { pdfProcess.ConvertProfile += ".kfpx"; } pdfProcess.ExternalErrorFolder = txtCMYKErrorFolder.Text; //RadDropDownListPDFVersion.SelectedValue; pdfProcess.ExternalProcess = RadRadioButtonListCMYKmethod.SelectedIndex == 1 ? true : false; pdfProcess.ExternalInputFolder = txtCMYKInputFolder.Text; pdfProcess.ExternalOutputFolder = txtCMYKOutputFolder.Text; pdfProcess.ExternalErrorFolder = txtCMYKErrorFolder.Text; pdfProcess.ProcessTimeOut = (int)RadNumericTextBoxCMYKTimeout.Value; pdfProcess.ProcessType = Models.PDFProcessType.ToCMYKPDF; DataProviders.DBaccess db = new DataProviders.DBaccess(); if (db.InsertUpdatePDFProcess(pdfProcess, out string errmsg) == false) { Utils.WriteLog(false, "ERROR: db.InsertUpdatePDFProcess() - " + errmsg); } FillPdfCmykProfileList(true); }
protected void btnUpdate_Click(object sender, EventArgs e) { if (Channel != null) { Channel.Enabled = cbEnabled.Checked.Value; Channel.Name = txtChannelName.Text; Channel.ChannelNameAlias = txtChannelNameAlias.Text; Channel.PDFType = RadDropDownListPDFType.SelectedIndex; Channel.MergedPDF = cbMergedPDF.Checked.Value; Channel.EditionsToGenerate = RadDropDownListEditionsToGenerate.SelectedIndex; Channel.SendCommonPages = cbSendCommonPages.Checked.Value; Channel.UseReleaseTime = cbUseReleaseTime.Checked.Value; TimeSpan ts = RadTimePickerReleaseTime.SelectedTime.Value; Channel.ReleaseTime = ts.Hours * 100 + ts.Minutes; ts = RadTimePickerReleaseTimeEnd.SelectedTime.Value; Channel.ReleaseTimeEnd = ts.Hours * 100 + ts.Minutes; Channel.TransmitNameFormat = txtTransmitNameFormat.Text; Channel.TransmitNameDateFormat = txtTransmitNameDateFormat.Text; Channel.SubFolderNamingConvension = txtSubFolderNamingConvension.Text; Channel.TransmitNameUseAbbr = RadDropDownListTransmitNameUseAbbr.SelectedIndex; // = Channel.SendMail = cbSendMail.Checked.Value; Channel.OutputType = DropDownListType.SelectedIndex; Channel.TriggerMode = RadDropDownListTriggerMode.SelectedIndex; Channel.TriggerEmail = txtEmailReceivers.Text; Channel.DeleteOldOutputFilesDays = cbDeleteOldOutputFiles.Checked.Value ? 1 : 0; Channel.OutputFolder = txtOutputFolder.Text; Channel.UseSpecificUser = cbSpecificUser.Checked.Value; Channel.UserName = txtUserNameX.Text; Channel.Password = txtPasswordX.Text; Channel.FTPServer = txtFtpServer.Text; Channel.FTPfolder = txtFtpFolder.Text; Channel.FTPUserName = txtFtpUsername.Text; Channel.FTPPassword = txtFtpPassword.Text; Channel.FTPPasv = cbFtpPassive.Checked.Value; Channel.FTPXCRC = cbFtpXcrc.Checked.Value; Channel.FTPEncryption = RadDropDownListEncryption.SelectedIndex; Channel.FTPPostCheck = RadDropDownListFTPPostCheck.SelectedIndex; Channel.EmailServer = txtEmailServer.Text; Channel.EmailPort = Utils.StringToInt(txtEmailPort.Text); if (Channel.EmailPort == 0) { Channel.EmailPort = 25; } Channel.EmailSubject = txtEmailSubject.Text; Channel.EmailTimeout = Utils.StringToInt(txtEmailTimeout.Text); if (Channel.EmailTimeout == 0) { Channel.EmailTimeout = 60; } Channel.EmailBody = RadEmailBody.Text; Channel.EmailCC = txtEmailCC.Text; Channel.EmailFrom = txtEmailFrom.Text; Channel.EmailHTML = cbEmailHTML.Checked.Value; Channel.EmailPassword = txtEmailPassword.Text; Channel.EmailTo = txtEmailTo.Text; Channel.EmailUserName = txtEmailUserName.Text; Channel.EmailUseSSL = cbEmailUseSSL.Checked.Value; Channel.EmailUseStartTLS = cbEmailUseStartTLS.Checked.Value; Models.PDFProcess pdfProcess = Utils.GetPDFProcessFromName(RadDropDownListPDFProcessID.SelectedValue); if (pdfProcess != null) { Channel.PDFProcessID = pdfProcess.ProcessID; } Channel.UsePackageNames = cbUsePackageNames.Checked.Value; Channel.OnlySentSelectedPages = cbSelectedPagesOnly.Checked.Value; Channel.PageNumberStart = (int)RadNumericTextBoxFromPage.Value; Channel.PageNumberEnd = (int)RadNumericTextBoxToPage.Value; DataProviders.DBaccess db = new DataProviders.DBaccess(); db.InsertUpdateChannel(Channel, out string errmsg); // InjectScript.Text = "<script>CloseAndRebind()</" + "script>"; if (Channel.ChannelID > 0) // update { ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", true); } else { ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind('navigateToInserted');", true); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Models.Channel channel = new Models.Channel(); channel.ChannelID = 0; channel.PDFProcessID = 1; int channelIDFromMainForm = 0; if (Request.QueryString["ChannelID"] != null) { channelIDFromMainForm = Utils.StringToInt(Request.QueryString["ChannelID"]); DataProviders.DBaccess db = new DataProviders.DBaccess(); db.GetChannel(channelIDFromMainForm, ref channel, out string errmsg); btnUpdate.Text = "Update"; } Channel = channel; RadDropDownListPDFProcessID.Items.Clear(); List <string> pdfProcessNames = Utils.GetPDFProcessNames(); foreach (string s in pdfProcessNames) { RadDropDownListPDFProcessID.Items.Add(new DropDownListItem(s, s)); } RadDropDownListPDFProcessID.SelectedIndex = 0; if (Channel != null) { cbEnabled.Checked = Channel.Enabled; txtChannelName.Text = Channel.Name; txtChannelNameAlias.Text = Channel.ChannelNameAlias; RadDropDownListPDFType.SelectedIndex = Channel.PDFType; cbMergedPDF.Checked = Channel.MergedPDF; RadDropDownListEditionsToGenerate.SelectedIndex = Channel.EditionsToGenerate; cbSendCommonPages.Checked = Channel.SendCommonPages; cbUseReleaseTime.Checked = Channel.UseReleaseTime; int h = Channel.ReleaseTime / 100; RadTimePickerReleaseTime.SelectedTime = new TimeSpan(h, Channel.ReleaseTime - h * 100, 0); h = Channel.ReleaseTimeEnd / 100; RadTimePickerReleaseTimeEnd.SelectedTime = new TimeSpan(h, Channel.ReleaseTimeEnd - h * 100, 0); txtTransmitNameFormat.Text = Channel.TransmitNameFormat; txtTransmitNameDateFormat.Text = Channel.TransmitNameDateFormat; txtSubFolderNamingConvension.Text = Channel.SubFolderNamingConvension; RadDropDownListTransmitNameUseAbbr.SelectedIndex = Channel.TransmitNameUseAbbr; //cbSendMail.Checked = Channel.SendMail; DropDownListType.SelectedIndex = Channel.OutputType; txtOutputFolder.Text = Channel.OutputFolder; cbSpecificUser.Checked = Channel.UseSpecificUser; txtUserNameX.Text = Channel.UserName; txtPasswordX.Text = Channel.Password; txtFtpServer.Text = Channel.FTPServer; txtFtpFolder.Text = Channel.FTPfolder; txtFtpUsername.Text = Channel.FTPUserName; txtFtpPassword.Text = Channel.FTPPassword; cbFtpPassive.Checked = Channel.FTPPasv; cbFtpXcrc.Checked = Channel.FTPXCRC; RadDropDownListEncryption.SelectedIndex = Channel.FTPEncryption; RadDropDownListFTPPostCheck.SelectedIndex = Channel.FTPPostCheck; RadDropDownListTriggerMode.SelectedIndex = Channel.TriggerMode; txtEmailReceivers.Text = Channel.TriggerEmail; cbDeleteOldOutputFiles.Checked = Channel.DeleteOldOutputFilesDays > 0; // reuse... cbUsePackageNames.Checked = Channel.UsePackageNames; cbSelectedPagesOnly.Checked = channel.OnlySentSelectedPages; RadNumericTextBoxFromPage.Value = channel.PageNumberStart; RadNumericTextBoxToPage.Value = channel.PageNumberEnd; if (Channel.PDFType == (int)Models.PDFtype.PDFHighRes) { RadDropDownListPDFProcessID.SelectedText = "None"; } else { Models.PDFProcess pdfProcess = Utils.GetPDFProcessFromID(channel.PDFProcessID); if (pdfProcess != null) { RadDropDownListPDFProcessID.SelectedText = pdfProcess.ProcessName; } } txtEmailServer.Text = Channel.EmailServer; txtEmailPort.Text = Channel.EmailPort.ToString(); txtEmailSubject.Text = Channel.EmailSubject; txtEmailTimeout.Text = Channel.EmailTimeout.ToString(); RadEmailBody.Text = Channel.EmailBody; txtEmailCC.Text = Channel.EmailCC; txtEmailFrom.Text = Channel.EmailFrom; cbEmailHTML.Checked = Channel.EmailHTML; txtEmailPassword.Text = Channel.EmailPassword; txtEmailTo.Text = Channel.EmailTo; txtEmailUserName.Text = Channel.EmailUserName; cbEmailUseSSL.Checked = Channel.EmailUseSSL; cbEmailUseStartTLS.Checked = Channel.EmailUseStartTLS; } DropDownListType_SelectedIndexChanged(null, null); } }