private void RebindErrorGrid(bool callRebind) { Timer2.Enabled = false; LabelError.Text = ""; DataProviders.DBaccess db = new DataProviders.DBaccess(); DateTime fromDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0); List <Models.LogItem> logItems = new List <Models.LogItem>(); if (db.GetLastLogItems(ref logItems, 100, true, Models.LogItemSource.All, out string errmsg) == false) { LabelError.Text = errmsg; Timer2.Enabled = true; return; } RadGridErrorList.DataSource = logItems; if (callRebind) { RadGridErrorList.Rebind(); } Timer2.Enabled = true; LabelLastUpdate.Text = string.Format("{0:00}:{1:00}:{2:00}", DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); }
private void RebindLogGrid(bool callRebind) { Timer1.Enabled = false; LabelError.Text = ""; DataProviders.DBaccess db = new DataProviders.DBaccess(); DateTime fromDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0); List <Models.LogItem> logItems = new List <Models.LogItem>(); if (db.GetLastLogItems(ref logItems, Utils.ReadConfigInt32("MaxLogItemsToShow", 500), false, Models.LogItemSource.Input, out string errmsg) == false) { LabelError.Text = errmsg; Timer1.Enabled = true; return; } RadGridLog.DataSource = logItems; if (callRebind) { RadGridLog.Rebind(); } LabelLastUpdate.Text = string.Format("Updated {0:00}:{1:00}:{2:00}", DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); Timer1.Enabled = true; }
protected void btnUpdate_Click(object sender, EventArgs e) { if (Import != null) { Import.Enabled = cbEnabled.Checked.Value; Import.Name = txtImportName.Text; Import.ImportType = DropDownListType.SelectedIndex + 1; Import.InputFolder = txtInputFolder.Text; Import.DoneFolder = txtDoneFolder.Text; Import.ErrorFolder = txtErrorFolder.Text; Import.LogFolder = txtLogFolder.Text; Import.CopyFolder = txtCopyFolder.Text; Import.SendErrorEmail = cbSendMail.Checked.Value; Import.EmailReceiver = txtEmailReceivers.Text; DataProviders.DBaccess db = new DataProviders.DBaccess(); db.InsertUpdateImportConfiguration(Import, out string errmsg); if (Import.ImportID > 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.ImportConfiguration import = new Models.ImportConfiguration(); import.ImportID = 0; int importIDFromMainForm = 0; if (Request.QueryString["ImportID"] != null) { importIDFromMainForm = Utils.StringToInt(Request.QueryString["ImportID"]); DataProviders.DBaccess db = new DataProviders.DBaccess(); db.GetImportConfiguration(importIDFromMainForm, ref import, out string errmsg); btnUpdate.Text = "Update"; } Import = import; if (Import != null) { cbEnabled.Checked = Import.Enabled; txtImportName.Text = Import.Name; DropDownListType.SelectedIndex = Import.ImportType - 1; txtInputFolder.Text = Import.InputFolder; txtDoneFolder.Text = Import.DoneFolder; txtErrorFolder.Text = Import.ErrorFolder; txtLogFolder.Text = Import.LogFolder; txtCopyFolder.Text = Import.CopyFolder; cbSendMail.Checked = Import.SendErrorEmail; txtEmailReceivers.Text = Import.EmailReceiver; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int keepDaysProducts = 10; int keepDaysLogdata = 10; bool useNewsPilotFeedback = true; string feedbackMessageFolder = "", feedbackTemplateSuccess = "", feedbackTemplateError = "", feedbackFilename = ""; DataProviders.DBaccess db = new DataProviders.DBaccess(); if (db.GetMaintParameters(ref keepDaysProducts, ref keepDaysLogdata, ref useNewsPilotFeedback, ref feedbackMessageFolder, ref feedbackTemplateSuccess, ref feedbackTemplateError, ref feedbackFilename, out string errmsg)) { RadNumericTextBoxMaxAge.Value = keepDaysProducts; RadNumericTextBoxMaxAgeLogData.Value = keepDaysLogdata; cbNewspilotFeedback.Checked = useNewsPilotFeedback; txtFeedbackMessageFolder.Text = feedbackMessageFolder; txtFeedbackTemplateSuccess.Text = feedbackTemplateSuccess; txtFeedbackTemplateError.Text = feedbackTemplateError; txtFeedbackFilename.Text = feedbackFilename; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { lblError.Text = ""; Models.Publication publication = new Models.Publication(); publication.PublicationID = 0; int publicationIDFromMainForm = 0; if (Request.QueryString["PublicationID"] != null) { publicationIDFromMainForm = Utils.StringToInt(Request.QueryString["PublicationID"]); DataProviders.DBaccess db = new DataProviders.DBaccess(); db.GetPublication(publicationIDFromMainForm, ref publication, out string errmsg); btnUpdate.Text = "Update"; } Publication = publication; RadDropDownListPublisher.Items.Clear(); List <string> publisherNames = Utils.GetPublisherNames(); foreach (string s in publisherNames) { RadDropDownListPublisher.Items.Add(new DropDownListItem(s, Utils.GetPublisherID(s).ToString())); } RadDropDownListPublisher.SelectedIndex = 0; if (Publication != null) { // Load controls.. txtPublicationName.Text = Publication.Name; txtAnnumText.Text = Publication.AnnumText; txtInputAlias.Text = Publication.InputAlias; txtOutputAlias.Text = Publication.OutputAlias; txtExtendedAlias.Text = Publication.ExtendedAlias; txtExtendedAlias2.Text = Publication.ExtendedAlias2; txtEmailRecipient.Text = Publication.EmailRecipient; cbDefaultApprove.Checked = Publication.DefaultApprove; cbPubdateMove.Checked = Publication.PubdateMove; cbSendReport.Checked = Publication.SendReport; RadTimePickerReleaseTime.SelectedTime = Publication._ReleaseTime; RadNumericReleaseDays.Value = Publication.ReleaseDays; RadNumericTextBoxPubdateMoveDays.Value = Publication.PubdateMoveDays; RadDropDownListPublisher.SelectedValue = Publication.PublisherID.ToString(); cbNoReleaseTimeUsed.Checked = (Publication.NoReleaseTime & 0x01) > 0; cbNoReleaseTimeUsedHighres.Checked = (Publication.NoReleaseTime & 0x02) > 0; cbNoReleaseTimeUsedPrint.Checked = (Publication.NoReleaseTime & 0x04) > 0; RadNumericTextBoxAutoPurgeKeepDays.Value = Publication.AutoPurgeKeepDays; RadNumericTextBoxAutoPurgeKeepDaysArchive.Value = Publication.AutoPurgeKeepDaysArchive; cbAllowUnplanned.Checked = Publication.AllowUnplanned; RadNumericTextBoxPriority.Value = Publication.DefaultPriority; BuildPublicationChannelTable(); } } }
protected void btnSave_Click(object sender, EventArgs e) { DataProviders.DBaccess db = new DataProviders.DBaccess(); db.UpdateMaintParameters((int)RadNumericTextBoxMaxAge.Value, (int)RadNumericTextBoxMaxAgeLogData.Value, cbNewspilotFeedback.Checked.Value, txtFeedbackMessageFolder.Text, txtFeedbackTemplateSuccess.Text, txtFeedbackTemplateError.Text, txtFeedbackFilename.Text, out string errmsg); }
private void BuildPublicationChannelTable() { List <Models.PublicationChannel> specificPubChannels = new List <Models.PublicationChannel>(); if (Publication != null) { specificPubChannels = Publication.PublicationChannels; } List <Models.PublicationChannelAll> allPubChannels = new List <Models.PublicationChannelAll>(); DataProviders.DBaccess db = new DataProviders.DBaccess(); string errmsg = ""; if (Session["ChannelList"] == null) { List <Models.Channel> channels = new List <Models.Channel>(); db.GetChannelList(ref channels, out errmsg); Session["ChannelList"] = channels; } try { List <Models.Channel> channelList = (List <Models.Channel>)HttpContext.Current.Session["ChannelList"]; foreach (Models.Channel channel in channelList) { bool use = false; int trigger = (int)Models.PushTrigger.None; int pubDateMoveDays = 0; int releaseDelay = 0; bool sendPlan = false; Models.PublicationChannel sc = specificPubChannels.FirstOrDefault(p => p.ChannelID == channel.ChannelID); if (sc != null) { use = true; trigger = sc.Trigger; pubDateMoveDays = sc.PubDateMoveDays; releaseDelay = sc.ReleaseDelay; sendPlan = sc.SendPlan; } allPubChannels.Add(new Models.PublicationChannelAll() { ChannelName = channel.Name, Use = use, Trigger = trigger, PubDateMoveDays = pubDateMoveDays, ReleaseDelay = releaseDelay, ChannelID = channel.ChannelID, SendPlan = sendPlan }); } } catch { } GridViewPublicationChannels.DataSource = allPubChannels; GridViewPublicationChannels.DataBind(); }
protected void btnUpdate_Click(object sender, EventArgs e) { if (Input != null) { Input.Enabled = cbEnabled.Checked.Value; Input.InputName = txtInputName.Text; Input.InputType = (Models.InputType)(DropDownListType.SelectedItem.Index); //Input.InputType = MapInputType(item.InputTypeStr); Input.NamingMask = txtNamingMask.Text; Input.Separators = txtSeparators.Text; Input.SearchMask = txtSearchMask.Text; Input.StableTime = (int)RadNumericStableTime.Value; Input.PollTime = (int)RadNumericPollTime.Value; Input.InputPath = txtInputFolder.Text; Input.UseSpecificUser = cbSpecificUser.Checked.Value; Input.UserName = txtUserNameX.Text; Input.Password = txtPasswordX.Text; Input.UseRegex = cbRegex.Checked.Value; Input.FTPserver = txtFtpServer.Text; Input.FTPusername = txtFtpUsername.Text; Input.FTPpassword = txtFtpPassword.Text; Input.FTPfolder = txtFtpFolder.Text; Input.FTPpasw = cbFtpPassive.Checked.Value; Input.FTPxcrc = cbFtpXcrc.Checked.Value; Input.FTPxcrc = cbFtpXcrc.Checked.Value; Input.FTPtls = (Models.EncryptionType)(RadDropDownListEncryption.SelectedItem.Index); Input.MakeCopy = cbArchive.Checked.Value; Input.CopyFolder = txtCopyFolder.Text; Input.SendAckFile = RadCheckBoxAckFile.Checked.Value; Input.AckFlagValue = (int)RadNumericAckCode.Value; Input.AckFileFolder = RadTextBoxAckFileFolder.Text; DataProviders.DBaccess db = new DataProviders.DBaccess(); if (db.InsertUpdateInputConfiguration(Input, out string errmsg) == false) { Utils.WriteLog(false, "ERROR: db.InsertUpdateInputConfiguration() - " + errmsg) ; } // InjectScript.Text = "<script>CloseAndRebind()</" + "script>"; if (Input.InputID > 0) // update { ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", true); } else { ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind('navigateToInserted');", true); } } }
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 RadGridPublicationChannels_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { List <Models.PublicationChannel> specificPubChannels = new List <Models.PublicationChannel>(); if (DataItem != null && (DataItem is Models.Publication)) { specificPubChannels = (DataItem as Models.Publication).PublicationChannels; } List <Models.PublicationChannelAll> allPubChannels = new List <Models.PublicationChannelAll>(); DataProviders.DBaccess db = new DataProviders.DBaccess(); string errmsg = ""; if (Session["ChannelList"] == null) { List <Models.Channel> channels = new List <Models.Channel>(); db.GetChannelList(ref channels, out errmsg); Session["ChannelList"] = channels; } try { List <Models.Channel> channelList = (List <Models.Channel>)HttpContext.Current.Session["ChannelList"]; foreach (Models.Channel channel in channelList) { bool use = false; int trigger = (int)Models.PushTrigger.None; int pubDateMoveDays = 0; int releaseDelay = 0; Models.PublicationChannel sc = specificPubChannels.FirstOrDefault(p => p.ChannelID == channel.ChannelID); if (sc != null) { use = true; trigger = sc.Trigger; pubDateMoveDays = sc.PubDateMoveDays; releaseDelay = sc.ReleaseDelay; } allPubChannels.Add(new Models.PublicationChannelAll() { ChannelName = channel.Name, Use = use, Trigger = trigger, PubDateMoveDays = pubDateMoveDays, ReleaseDelay = releaseDelay }); } } catch { } RadGridPublicationChannels.DataSource = allPubChannels; }
private void RebindUsersGrid(bool callRebind) { DataProviders.DBaccess db = new DataProviders.DBaccess(); if (db.GetUsers(ref users, out string errmsg) == false) { LabelError.Text = errmsg; } RadGridUsers.DataSource = users; if (callRebind) { RadGridUsers.Rebind(); } }
private void RebindExportGrid(bool callRebind) { //inputConfigurations = new List<Models.InputConfiguration>(); DataProviders.DBaccess db = new DataProviders.DBaccess(); if (db.GetChannelList(ref channels, out string errmsg) == false) { LabelError.Text = errmsg; } RadGridExport.DataSource = channels; if (callRebind) { RadGridExport.Rebind(); } }
private void RebindPackageGrid(bool callRebind) { //inputConfigurations = new List<Models.InputConfiguration>(); DataProviders.DBaccess db = new DataProviders.DBaccess(); if (db.GetPackages(ref packages, out string errmsg) == false) { LabelError.Text = errmsg; } RadGridPackage.DataSource = packages; if (callRebind) { RadGridPackage.Rebind(); } }
public static List <string> GetUserGroupNames() { if (HttpContext.Current.Session["UserGroupList"] == null) { DataProviders.DBaccess db = new DataProviders.DBaccess(); List <Models.UserGroup> userGroupList = new List <Models.UserGroup>(); if (db.GetUserGroups(ref userGroupList, out string errmsg)) { HttpContext.Current.Session["UserGroupList"] = userGroupList; } else { return(new List <string>()); } }
protected void RadGridLog_ItemCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == "RebindGrid") { RebindLogGrid(true); return; } if (e.CommandName == "SaveToExcel") { Timer1.Enabled = false; RadGridLog.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML; RadGridLog.ExportSettings.IgnorePaging = true; RadGridLog.ExportSettings.ExportOnlyData = true; RadGridLog.ExportSettings.OpenInNewWindow = true; RadGridLog.MasterTableView.ExportToExcel(); Timer1.Enabled = true; } if (e.CommandName == "Retry") { if (!(e.Item is GridDataItem item)) { return; } var textBox = item["FileName"]; if (textBox == null) { return; } string fileName = textBox.Text; textBox = item["Source"]; if (textBox == null) { return; } string inputQueue = textBox.Text; if (fileName != "" && inputQueue != "") { DataProviders.DBaccess db = new DataProviders.DBaccess(); db.RetryFile(Models.ServiceType.Processing, fileName, inputQueue, out string errmsg); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int productionID = 0; if (Request.QueryString["ProductionID"] != null) { productionID = Utils.StringToInt(Request.QueryString["ProductionID"]); if (productionID > 0) { HiddenProductionID.Value = productionID.ToString(); } } DataProviders.DBaccess db = new DataProviders.DBaccess(); List <int> channelIDForProduct = new List <int>(); string prodName = ""; if (db.GetChannelsForProduction(productionID, ref prodName, ref channelIDForProduct, out string errmsg) == false) { Utils.WriteLog(false, "db.GetChannelsForProduction() - " + errmsg); } lblProduct.Text = "Do re-export for " + prodName; List <Models.Channel> channels = Utils.GetChannels(); List <Models.ChannelShort> cs = new List <Models.ChannelShort>(); foreach (Models.Channel ch in channels) { bool selected = channelIDForProduct.Contains(ch.ChannelID); if (selected) { cs.Add(new Models.ChannelShort() { ChannelID = ch.ChannelID, Name = ch.Name, Selected = false, Enabled = true }); } } RadCheckBoxListChannels.DataSource = cs; RadCheckBoxListChannels.DataBind(); } }
protected void btnUpdate_Click(object sender, EventArgs e) { string errmsg = ""; lblError.Text = ""; if (User != null) { DataProviders.DBaccess db = new DataProviders.DBaccess(); User.UserName = txtUserName.Text; User.AccountEnabled = cbAccountEnabled.Checked.Value; User.Password = txtPassword.Text; User.FullName = txtFullName.Text; User.Email = txtEmail.Text; User.UserGroupID = Utils.GetUserGroupID(RadDropDownUserGroup.SelectedValue); User.publisherIDList.Clear(); foreach (Telerik.Web.UI.ButtonListItem item in RadCheckBoxListPublishers.SelectedItems) { User.publisherIDList.Add(Utils.StringToInt(item.Value)); } User.publicationIDList.Clear(); foreach (Telerik.Web.UI.ButtonListItem item in RadCheckBoxListPublications.SelectedItems) { User.publicationIDList.Add(Utils.StringToInt(item.Value)); } db.InsertUpdateUser(User, out errmsg); // InjectScript.Text = "<script>CloseAndRebind()</" + "script>"; if (HiddenUserName.Value != "") // update { ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", true); } else { ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind('navigateToInserted');", true); } } }
public DataTable GetReportingDataPageHistory() { DataTable dt = new DataTable(); dt.Columns.Add("PubDate", typeof(string)); dt.Columns.Add("Product", typeof(string)); dt.Columns.Add("Export", typeof(string)); dt.Columns.Add("ReleaseTime", typeof(string)); dt.Columns.Add("Page", typeof(string)); dt.Columns.Add("Version", typeof(string)); dt.Columns.Add("Page_In", typeof(string)); dt.Columns.Add("Page_Sent", typeof(string)); LabelError.Text = ""; DataProviders.DBaccess db = new DataProviders.DBaccess(); DateTime pubDate = Utils.DateStringToDateTime(RadDropDownListPubDate.SelectedText); List <Models.ReportPageHistoryItem> reportData = new List <Models.ReportPageHistoryItem>(); if (db.GetReportDataPageHistory(pubDate, Utils.GetPublisherID(RadDropDownListPublisher.SelectedText), RadDropDownListProduct.SelectedText, Utils.GetChannelID(RadDropDownListExport.SelectedText), ref reportData, out string errmsg) == false) { LabelError.Text = "db.GetReportData() - " + errmsg; return(null); } foreach (Models.ReportPageHistoryItem reportItem in reportData) { dt.Rows.Add(Utils.Date2String(reportItem.PubDate), reportItem.Publication, reportItem.Channel, Utils.Time2String(reportItem.ReleaseTime), reportItem.PageName, reportItem.Version.ToString(), Utils.Time2String(reportItem.PageIn), Utils.Time2String(reportItem.PageSent)); } return(dt); }
protected void RadGridExport_InsertCommand(object source, GridCommandEventArgs e) { UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID); Models.Channel newItem = new Models.Channel() { ChannelID = 0 }; ReadUserControlValues(userControl, ref newItem); DataProviders.DBaccess db = new DataProviders.DBaccess(); if (db.InsertUpdateChannel(newItem, out string errmsg) == false) { LabelError.Text = errmsg; e.Canceled = true; } Session["EditedChannelDataItem"] = null; }
protected void btnRun_Click(object sender, EventArgs e) { DataProviders.DBaccess db = new DataProviders.DBaccess(); List <Models.Page> pages = new List <Models.Page>(); int productionID = Utils.StringToInt(HiddenProductionID.Value); db.GetPagesForProduction(productionID, ref pages, out string errmsg); RadListBoxPages.DataSource = null; foreach (Models.Page page in pages) { string hiresPath = ""; db.GetHiresPath(page.MasterCopySeparationSet, ref hiresPath, out errmsg); page.VirtualImagePath = "Application.png"; page.PageName = string.Format("{0}-{1} ({2})", page.Section, page.PageName, page.FileName); if (page.Status < 10 || hiresPath == "" || File.Exists(hiresPath) == false) { page.VirtualImagePath = "Warning.png"; page.PageName += " (missing)"; } else { page.VirtualImagePath = "Danger.png"; if (Utils.PdfReadTest(hiresPath) == true) { page.VirtualImagePath = "OK.png"; } else { page.VirtualImagePath = "Danger.png"; page.PageName += " (read error!)"; } } RadListBoxPages.DataSource = pages; RadListBoxPages.DataTextField = "PageName"; RadListBoxPages.DataValueField = "VirtualImagePath"; RadListBoxPages.DataBind(); } }
private void PopulateProductFilter() { DataProviders.DBaccess db = new DataProviders.DBaccess(); List <Models.Publication> publications = new List <Models.Publication>(); db.GetPublications(ref publications, 0, Utils.GetPublisherID(RadDropDownListPublisher.SelectedText), out string errmsg); RadDropDownListProduct.Items.Clear(); RadDropDownListProduct.Items.Add("All"); foreach (Models.Publication publication in publications) { RadDropDownListProduct.Items.Add(publication.Name); } if (RadDropDownListProduct.Items.Count > 0) { RadDropDownListProduct.SelectedIndex = 0; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int productionID = 0; if (Request.QueryString["ProductionID"] != null) { productionID = Utils.StringToInt(Request.QueryString["ProductionID"]); if (productionID > 0) { HiddenProductionID.Value = productionID.ToString(); } } DataProviders.DBaccess db = new DataProviders.DBaccess(); List <Models.Page> pages = new List <Models.Page>(); string prodName = ""; db.GetProductionName(productionID, ref prodName, out string errmsg); db.GetPagesForProduction(productionID, ref pages, out errmsg); lblProduct.Text = $"Check {pages.Count} pages for {prodName}"; foreach (Models.Page page in pages) { page.VirtualImagePath = "Application.png"; page.PageName = string.Format("{0}-{1} ({2})", page.Section, page.PageName, page.FileName); if (page.Status < 10) { page.VirtualImagePath = "Warning.png"; page.PageName += " (missing)"; } } RadListBoxPages.DataSource = pages; RadListBoxPages.DataTextField = "PageName"; RadListBoxPages.DataValueField = "VirtualImagePath"; RadListBoxPages.DataBind(); } }
protected void BtnUpdate_Click(object sender, EventArgs e) { int productionID = Utils.StringToInt(HiddenProductionID.Value); List <int> selectedChannels = new List <int>(); foreach (Telerik.Web.UI.ButtonListItem item in RadCheckBoxListChannels.SelectedItems) { selectedChannels.Add(Utils.StringToInt(item.Value)); } if (productionID > 0 && selectedChannels.Count > 0) { DataProviders.DBaccess db = new DataProviders.DBaccess(); if (db.ResendChannelsForProduction(productionID, selectedChannels, RadRadioButtonListResent.SelectedIndex == 1, RadRadioButtonReprocess.SelectedIndex, out string errmsg) == false) { Utils.WriteLog(true, "ERROR db.ResendChannelsForProduction() - " + errmsg); } if (cbResendTrigger.Checked.Value) { foreach (int channelID in selectedChannels) { db.IssueTriggerForProduction(productionID, channelID, out errmsg); } } if (RadCheckBoxRelease.Checked.Value) { foreach (int channelID in selectedChannels) { db.ReleaseProduction(productionID, channelID, out errmsg); } } } ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", true); }
protected void RadGridUsers_DeleteCommand(object source, GridCommandEventArgs e) { GridEditableItem deleteItem = e.Item as GridEditableItem; string userName = (string)deleteItem.OwnerTableView.DataKeyValues[deleteItem.ItemIndex]["UserName"]; if (userName == null) { RadGridUsers.Controls.Add(new LiteralControl("Unable to locate the UserName for deleting.")); e.Canceled = true; Session["EditedUserDataItem"] = null; return; } DataProviders.DBaccess db = new DataProviders.DBaccess(); if (db.DeleteUser(userName, out string errmsg) == false) { LabelError.Text = errmsg; e.Canceled = true; } Session["EditedUserDataItem"] = null; }
protected void RadGridExport_DeleteCommand(object source, GridCommandEventArgs e) { GridEditableItem deleteItem = e.Item as GridEditableItem; int?channelID = (int?)deleteItem.OwnerTableView.DataKeyValues[deleteItem.ItemIndex]["ChannelID"]; if (channelID.HasValue == false) { RadGridExport.Controls.Add(new LiteralControl("Unable to locate the ChannelID for deleting.")); e.Canceled = true; Session["EditedChannelDataItem"] = null; return; } DataProviders.DBaccess db = new DataProviders.DBaccess(); if (db.DeleteChannel(channelID.Value, out string errmsg) == false) { LabelError.Text = errmsg; e.Canceled = true; } Session["EditedChannelDataItem"] = null; }
private void PopulatePubDateFilter() { DataProviders.DBaccess db = new DataProviders.DBaccess(); List <DateTime> pubDates = new List <DateTime>(); db.GetPubDates(Utils.GetPublisherID(RadDropDownListPublisher.SelectedText), RadDropDownListProduct.SelectedText, Utils.GetChannelID(RadDropDownListExport.SelectedText), ref pubDates, out string errmsg); RadDropDownListPubDate.Items.Clear(); foreach (DateTime dt in pubDates) { RadDropDownListPubDate.Items.Add(string.Format("{0:0000}-{1:00}-{2:00}", dt.Year, dt.Month, dt.Day)); } if (RadDropDownListPubDate.Items.Count > 0) { RadDropDownListPubDate.SelectedIndex = 0; } }
private void RebindQueue2Grid(bool callRebind) { Timer1.Enabled = false; LabelError.Text = ""; DataProviders.DBaccess db = new DataProviders.DBaccess(); List <Models.FileLog> logItems = new List <Models.FileLog>(); if (db.GetConvertQueueFilesLog(ref logItems, out string errmsg) == false) { LabelError.Text = errmsg; Timer1.Enabled = true; return; } RadGridQueue2.DataSource = logItems; if (callRebind) { RadGridQueue2.Rebind(); } }
private void RebindStateGrid(bool callRebind) { Timer1.Enabled = false; List <Models.Service> services = new List <Models.Service>(); DataProviders.DBaccess db = new DataProviders.DBaccess(); if (db.GetServiceStates(ref services, out string errmsg) == false) { LabelError.Text = errmsg; Timer1.Enabled = true; return; } RadGridState.DataSource = services; if (callRebind) { RadGridErrorList.Rebind(); } Timer1.Enabled = true; LabelLastUpdate.Text = string.Format("{0:00}:{1:00}:{2:00}", DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); }
protected void BtnUpdate_Click(object sender, EventArgs e) { int productionID = Utils.StringToInt(HiddenProductionID.Value); List <int> selectedChannels = new List <int>(); foreach (Telerik.Web.UI.ButtonListItem item in RadCheckBoxListChannels.SelectedItems) { selectedChannels.Add(Utils.StringToInt(item.Value)); } if (productionID > 0 && selectedChannels.Count > 0) { DataProviders.DBaccess db = new DataProviders.DBaccess(); foreach (int channelID in selectedChannels) { db.ReleaseProduction(productionID, channelID, out string errmsg); } } ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", true); }