private bool RebindGrid(int masterCopySeparationSet) { lblError.Text = ""; CCDBaccess db = new CCDBaccess(); string errmsg = ""; DataTable dt = db.GetPageHistory(masterCopySeparationSet, false, out errmsg); if (errmsg != "") { lblError.Text = errmsg; return(false); } if (dt.HasErrors) { lblError.Text = "Retrieved datatable contains errors"; return(false); } if (dt.Rows.Count == 0) { lblError.Text = "No history avaliable for this page"; return(false); } RadGridPageHistory.DataSource = dt; RadGridPageHistory.DataBind(); return(true); }
private void LogUserView(int masterCopySeparationSet, string userName) { string errMsg = ""; CCDBaccess db = new CCDBaccess(); db.InsertPrepollLog(402, masterCopySeparationSet, userName, out errMsg); }
private void LogUserLogout(string userName) { string errMsg = ""; CCDBaccess db = new CCDBaccess(); db.InsertUserHistory(userName, 0, "", out errMsg); }
private void GetFilteredGrid() { //DataSet dataSet = (DataSet) Cache["PageTableCache"]; string errmsg = ""; DateTime tTimeStamp = new DateTime(); CCDBaccess db = new CCDBaccess(); tTimeStamp = (DateTime)Session["LogLastDateTime"]; DataTable dt = db.GetLogCollection((string)Session["SelectedLogLocation"], ref tTimeStamp, out errmsg); if (dt != null) { lblError.Text = ""; Session["LogLastDateTime"] = tTimeStamp; DataGrid1.DataSource = dt.DefaultView; DataGrid1.DataBind(); } else { lblError.Text = errmsg; } }
private void PopulateChannelDataGrid(string channellist) { string errmsg = ""; CCDBaccess db = new CCDBaccess(); DataTable dtchannelsdb = db.GetChannelCollection(out errmsg); DataColumn newColumn; DataTable dtChannels = new DataTable(); newColumn = dtChannels.Columns.Add("Use", Type.GetType("System.Boolean")); newColumn = dtChannels.Columns.Add("Channel", Type.GetType("System.String")); ArrayList al = new ArrayList(); al.Clear(); if (channellist == "") { int publicationID = Globals.TryParse(txtPublicationID.Text, 0); if (publicationID > 0) { db.GetPublicationChannelsForPublication(publicationID, ref al, out errmsg); } } else { string [] ss = channellist.Split(','); foreach (string sss in ss) { int qq = Globals.TryParse(sss, 0); if (qq > 0) { al.Add(qq); } } } Session["ThisChannelList"] = al; foreach (DataRow row in dtchannelsdb.Rows) { DataRow newRow = dtChannels.NewRow(); newRow["Channel"] = (string)row["Name"]; newRow["Use"] = false; foreach (int no in al) { if (no == (int)row["ID"]) { newRow["Use"] = true; break; } } dtChannels.Rows.Add(newRow); } DataGridChannels.DataSource = dtChannels; DataGridChannels.DataBind(); }
private List <int> GetSectionsInProduct(int publicationID, DateTime pubDate, int editionID) { string errmsg = ""; CCDBaccess db = new CCDBaccess(); return(db.GetSectionsInEdition(publicationID, pubDate, editionID, out errmsg)); }
protected void bntApply_Click(object sender, EventArgs e) { CCDBaccess db = new CCDBaccess(); string errmsg = ""; int timeout = 40; int nMasterCopySeparationSet = Globals.TryParse(hiddenMasterCopySeparationSet.Value, 0); while (--timeout > 0) { int status = db.InProgressStatus(nMasterCopySeparationSet, out errmsg); if (status > 0) { System.Threading.Thread.Sleep(500); } else { db.UpdateMasterStatus(nMasterCopySeparationSet, 0, "Manually deleted by " + (string)Session["UserName"], out errmsg); if (cbPermanentKill.Checked) { db.DeleteMasterCopySeparationSet(nMasterCopySeparationSet, out errmsg); } break; } } InjectScript.Text = "<script>RefreshParentPage()</" + "script>"; }
private void btnAddToMessage_Click(object sender, System.EventArgs e) { CCDBaccess db = new CCDBaccess(); string errmsg = ""; string msg = ""; int nID = Globals.TryParse(lblMessageID.Text, 0); if (nID != 0) { msg = "\r\n--------------------------------------------------------\r\n" + LblEventTime.Text + ":\r\n" + txtMessage.Text; } DateTime pubDate = DateTime.Now; int publicationID = 0; if (ddProductions.SelectedValue != "0") { int productionID = Globals.TryParse(ddProductions.SelectedValue, 0); ProdList prodList = (ProdList)Session["AllowProductions"]; if (prodList != null) { prodList.FindPubAndPubDate(productionID, out publicationID, out pubDate); } } db.UpdateMessage(nID, (string)Session["UserName"], txtTo.Text, txtSubject.Text, msg, RadioButtonListPrio.SelectedIndex == 1, pubDate, publicationID, out errmsg); panelFields.Visible = false; btnNewMessage.Visible = true; GetAllMessages(); }
protected void bntApply_Click(object sender, EventArgs e) { int publicationID = Session["SelectedPublication"] != null?Globals.GetIDFromName("PublicationNameCache", (string)Session["SelectedPublication"]) : 0; DateTime pubDate = Session["SelectedPubDate"] != null ? (DateTime)Session["SelectedPubDate"] : DateTime.MinValue; int nEditionID = Globals.GetIDFromName("EditionNameCache", (string)Session["SelectedEdition"]); int nSectionID = Globals.GetIDFromName("SectionNameCache", (string)Session["SelectedSection"]); string errmsg = ""; CCDBaccess db = new CCDBaccess(); string channelList = db.GetChannelsForProduction(publicationID, pubDate, out errmsg); if (channelList == "") { lblInfo.Text = "Unable to retrieve channels for product"; return; } int planVersion = Globals.TryParse(txtVersion.Text, 1); db.CustomAction(publicationID, pubDate, nEditionID, nSectionID, channelList, planVersion, out errmsg); int dummyPressID = 0; int productionID = db.GetProductionID(ref dummyPressID, publicationID, pubDate, 0, out errmsg); db.SetPlanVersion(productionID, planVersion + 1, out errmsg); db.SetPlanVisiolinkStatus(productionID, 1, txtPushMessage.Text, planVersion + 1, out errmsg); InjectScript.Text = "<script>RefreshParentPage()</" + "script>"; }
protected void bntApply_Click(object sender, System.EventArgs e) { int nMasterCopySeparationSet = (int)Session["SelectedMasterSet"]; int nMasterCopySeparationSet2 = 0; if (Session["SelectedMasterSet2"] != null) { nMasterCopySeparationSet2 = (int)Session["SelectedMasterSet2"]; } CCDBaccess db = new CCDBaccess(); string errmsg = ""; if ((int)ViewState["PDFmode"] != RadioButtonListPDFcolors.SelectedIndex) { db.ChangePDFcolors(nMasterCopySeparationSet, RadioButtonListPDFcolors.SelectedIndex == 0 ? "PDF" : "PDFmono", out errmsg); if (nMasterCopySeparationSet2 > 0) { db.ChangePDFcolors(nMasterCopySeparationSet2, RadioButtonListPDFcolors.SelectedIndex == 0 ? "PDF" : "PDFmono", out errmsg); } db.ResetApproval(nMasterCopySeparationSet, out errmsg); if (nMasterCopySeparationSet2 > 0) { db.ResetApproval(nMasterCopySeparationSet2, out errmsg); } } InjectScript.Text = "<script>RefreshParentPage()</" + "script>"; }
private bool FillProductionCombo() { ddProductions.Items.Clear(); ddProductions.Items.Add(new ListItem("None", "0")); CCDBaccess db = new CCDBaccess(); string errmsg = ""; ProdList prodList = new ProdList(); if (db.GetAllowedProductions(ref prodList, out errmsg) == false) { lblError.Text = errmsg; return(false); } Session["AllowProductions"] = prodList; foreach (ProdItem item in prodList) { ddProductions.Items.Add(new ListItem(string.Format("{0} {1:00}-{2:00}-{3:0000}", Globals.GetNameFromID("PublicationNameCache", item.publicationID), item.pubDate.Day, item.pubDate.Month, item.pubDate.Year), item.productionID.ToString())); } return(true); }
protected void bntApply_Click(object sender, System.EventArgs e) { CCDBaccess db = new CCDBaccess(); string errmsg = ""; string extstatus = RadListBox1.SelectedValue; string s = txtMasterCopySeparationSetList.Text; string[] sa = s.Split(','); foreach (string ss in sa) { int n = 0; Int32.TryParse(ss, out n); if (n > 0) { db.UpdateExternalStatus(n, Globals.GetStatusID(extstatus, 1), out errmsg); } } InjectScript.Text = "<script>RefreshParentPage()</" + "script>"; }
private string DisplayProductTitle() { DateTime pubDate = (DateTime)Session["SelectedPubDate"]; int publicationID = Globals.GetIDFromName("PublicationNameCache", (string)Session["SelectedPublication"]); int editionID = Globals.GetIDFromName("EditionNameCache", (string)Session["SelectedEdition"]); int sectionID = Globals.GetIDFromName("SecionNameCache", (string)Session["SelectedSection"]); string title = string.Format("{0:4}-{1:2}-{2:2} {3}", pubDate.Year, pubDate.Month, pubDate.Day, (string)Session["SelectedPublication"]); if (editionID > 0) { title += " " + (string)Session["SelectedEdition"]; } if (sectionID > 0) { title += " " + (string)Session["SelectedSection"]; } CCDBaccess db = new CCDBaccess(); string errmsg = ""; ArrayList al = new ArrayList(); al = db.GetPagesInSection(publicationID, pubDate, editionID, sectionID, out errmsg); Session["UploadPages"] = al; return(title); }
private void btnAddToMessage_Click(object sender, System.EventArgs e) { CCDBaccess db = new CCDBaccess(); string errmsg = ""; string msg = ""; int nID = Globals.TryParse(lblMessageID.Text, 0); if (nID != 0) { msg = "\r\n--------------------------------------------------------\r\n" + LblEventTime.Text + ":\r\n" + txtMessage.Text; } else { msg = txtMessage.Text; } db.UpdateMessage(nID, (string)Session["UserName"], txtTo.Text, txtSubject.Text, msg, RadioButtonListPrio.SelectedIndex == 1, (DateTime)Session["SelectedPubDate"], Globals.GetIDFromName("PublicationNameCache", (string)Session["SelectedPublication"]), out errmsg); panelFields.Visible = false; btnNewMessage.Visible = true; GetAllMessages(); }
private string GetFirstMainEditionInProduct(int publicationID, DateTime pubDate) { string errmsg = ""; CCDBaccess db = new CCDBaccess(); int editionID = db.GetMainEditionInProduct(publicationID, pubDate, out errmsg); return(Globals.GetNameFromID("EditionNameCache", editionID)); }
private void CreateDropDowns() { CCDBaccess db = new CCDBaccess(); string errmsg = ""; ArrayList al = db.GetPubDateList(GetCurrentPressIDList(), out errmsg); Telerik.Web.UI.RadToolBarItem item = RadToolBar1.FindItemByValue("Item1"); if (item == null) { return; } DropDownList1 = (DropDownList)item.FindControl("PubDateFilter"); string currentSelection = ""; if (DropDownList1.Items.Count > 0) { currentSelection = DropDownList1.SelectedItem.Value; } DropDownList1.Items.Clear(); DropDownList1.Items.Add(new ListItem("All", "All")); // 0 foreach (DateTime dt in al) { DropDownList1.Items.Add(new ListItem(dt.ToShortDateString(), PubDate2String(dt))); // 0 } string s = PubDate2String((DateTime)Session["PressRunPubDate"]); if (DropDownList1.Items.FindByValue(currentSelection) != null) { DropDownList1.SelectedValue = currentSelection; } else if (DropDownList1.Items.FindByValue(s) != null) { DropDownList1.SelectedValue = s; } else { DateTime t = (DateTime)Session["PressRunPubDate"]; t = t.AddDays(-1); s = PubDate2String(t); if (DropDownList1.Items.FindByValue(s) != null) { DropDownList1.SelectedValue = s; Session["PressRunPubDate"] = t; } else { DropDownList1.SelectedIndex = 0; Session["PressRunPubDate"] = DateTime.MinValue; } } }
private int GetFirstEditionInProduct(int publicationID, DateTime pubDate) { string errmsg = ""; CCDBaccess db = new CCDBaccess(); ArrayList al = db.GetEditionsInProduction(publicationID, pubDate, out errmsg); if (al.Count > 0) { return((int)al[0]); } return(0); }
protected void RadWizard1_FinishButtonClick(object sender, WizardEventArgs e) { if (HasUploadedAllPages() == false) { UploadStatusLabel.Text = "Not all pages are uploaded yet"; UploadStatusLabel.ForeColor = System.Drawing.Color.Orange; return; } string errmsg; CCDBaccess db = new CCDBaccess(); int productionID = 0; int pressRunID = 0; int editionID = 0; int numberOfPages = 0; Int32.TryParse(txtProductionID.Text, out productionID); Int32.TryParse(txtPressRunID.Text, out pressRunID); // if (productionID == 0 || pressRunID == 0 || editionID == 0) // return; Int32.TryParse(txtNumberOfPage.Text, out numberOfPages); int pressID = Globals.GetIDFromName("PressNameCache", (string)Session["SelectedPress"]); DateTime pubDate = GetSelectedPubdateFrom(); DateTime pubDateTo = GetSelectedPubdateTo(); int publicationID = Globals.GetIDFromName("PublicationNameCache", RadComboBoxProduct.Text); int edtionID = Globals.GetIDFromName("EditionNameCache", RadComboBoxEdition.Text); int sectionID = Globals.GetIDFromName("SectionNameCache", RadComboBoxSection.Text); // ArrayList pageNameList = db.GetPagesInSection(publicationID, pubDate, editionID, sectionID, out errmsg); db.spInsertPagesInSection(pressID, pubDate, publicationID, editionID, sectionID, numberOfPages, FindPageOffset(), GetSelectedChannels(), out errmsg); DateTime dt = pubDate; while (dt != pubDateTo) { dt = dt.AddDays(1); db.spInsertPagesInSection(pressID, dt, publicationID, editionID, sectionID, numberOfPages, FindPageOffset(), GetSelectedChannels(), out errmsg); } // Copy in newly uploaded pages Globals.MoveAllFiles(GetSavePath() + @"\park", GetSavePath(), out errmsg); InjectScript.Text = "<script>RefreshParentPage()</" + "script>"; }
protected void btnDownload_Click(object sender, EventArgs e) { CCDBaccess db = new CCDBaccess(); string errmsg = ""; string result = ""; db.GetCustomLog(DropDownList1.SelectedValue, ref result, out errmsg); if (result != "") { DownloadLog(result, DropDownList1.SelectedValue); } }
protected void bntApply_Click(object sender, System.EventArgs e) { int nPrio = Globals.TryParse(txtPrioValue.Text, -1); if (nPrio >= 0) { CCDBaccess db = new CCDBaccess(); string errmsg = ""; db.UpdatePriorityEx(CheckBoxAllCopies.Checked ? (ArrayList)Session["SelectedCopySeps"] :(ArrayList)Session["SelectedSeps"], (ArrayList)Session["SelectedColors"], nPrio, CheckBoxAllColors.Checked, CheckBoxAllPages.Checked, CheckBoxAllCopies.Checked, out errmsg); } doClosePrio = 2; }
private int GetPageCountInSection() { string errmsg = ""; CCDBaccess db = new CCDBaccess(); int publicationID = Globals.GetIDFromName("PublicationNameCache", RadComboBoxProduct.Text); DateTime pubDate = GetSelectedPubdateFrom(); int editionID = Globals.GetIDFromName("EditionNameCache", RadComboBoxEdition.Text); int sectionID = Globals.GetIDFromName("SectionNameCache", RadComboBoxSection.Text); ArrayList pageNameList = db.GetPagesInSection(publicationID, pubDate, editionID, sectionID, out errmsg); return(pageNameList.Count); }
protected void bntApply_Click(object sender, System.EventArgs e) { int nTemplateID = Globals.GetIDFromName("TemplateNameCache", DropDownList1.SelectedValue); if (nTemplateID > 0) { CCDBaccess db = new CCDBaccess(); string errmsg = ""; db.UpdateTemplate((ArrayList)Session["SelectedSeps"], nTemplateID, CheckBoxAllCopies.Checked, out errmsg); } doCloseTemplate = 2; }
private void btnSave_Click(object sender, System.EventArgs e) { DataSet ds = (DataSet)Cache["PublicationNameCache"]; DataTable table = ds.Tables[0]; bool exists = false; foreach (DataRow row in table.Rows) { if (((string)row["Name"]).ToLower() == txtPublicationName.Text.ToLower()) { exists = true; break; } } if (exists) { lblError.Text = "Publication name already exists"; return; } CCDBaccess db = new CCDBaccess(); string errmsg = ""; int nPageFormatID = ddlPageFormat.SelectedIndex >= 0 ? Globals.GetIDFromName("PageFormatCache", ddlPageFormat.SelectedValue) : 0; int nProoferID = ddlProofer.SelectedIndex >= 0 ? Globals.GetIDFromName("ProofNameCache", ddlProofer.SelectedValue) : 0; int nHardProoferID = ddHardProofer.SelectedIndex > 0 ? Globals.GetIDFromName("ProofNameCache", ddHardProofer.SelectedValue) : 0; double latestHour = 0.0; try { latestHour = double.Parse(txtLatestHour.Text); } catch { } if (db.InsertPublicationName(txtPublicationName.Text, nPageFormatID, cbTrimToFormat.Checked, latestHour, nProoferID, nHardProoferID, RadioButtonListApprove.Items[0].Selected, out errmsg) == false) { lblError.Text = errmsg; return; } Global.RefreshPublicationNameCache(null, null, 0); newPubName = txtPublicationName.Text; doClose = 1; }
private void Page_Load(object sender, System.EventArgs e) { Response.ContentEncoding = Encoding.GetEncoding((string)Session["encoding"]); Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture((string)Session["language"]); Thread.CurrentThread.CurrentUICulture = new CultureInfo((string)Session["language"]); btnCancel.Text = Global.rm.GetString("txtCancel"); bntApply.Text = Global.rm.GetString("txtApply"); if (!this.IsPostBack) { if (Session["SelectedMasterSet"] == null) { lblError.Text = "Session variable error"; InjectScript.Text = "<script>CloseOnReload()</" + "script>"; return; } CCDBaccess db = new CCDBaccess(); string errmsg = ""; string sPageName = ""; ArrayList alColors = new ArrayList(); ArrayList alActiveColors = new ArrayList(); int nMasterCopySeparationSet = (int)Session["SelectedMasterSet"]; if (db.GetPageColors(nMasterCopySeparationSet, out sPageName, ref alColors, ref alActiveColors, out errmsg) == false) { lblError.Text = errmsg; return; } if (alColors.Count == 0) { lblError.Text = errmsg; return; } if ((string)alColors[0] == "PDFmono") { RadioButtonListPDFcolors.SelectedIndex = 1; } else { RadioButtonListPDFcolors.SelectedIndex = 0; } ViewState["PDFmode"] = RadioButtonListPDFcolors.SelectedIndex; } }
private void GetFilteredGrid() { //DataSet dataSet = (DataSet) Cache["PageTableCache"]; if ((string)Session["SelectedPublication"] == "") { lblChooseProduct.Visible = true; return; } lblChooseProduct.Visible = false; CCDBaccess db = new CCDBaccess(); string errmsg = ""; DataTable tbl = null; tbl = db.GetTablePageStatusCollection((bool)Session["HideFinished"], out errmsg); if (tbl != null) { int rowCount = tbl.Rows.Count; if (rowCount > 20) { int n2 = rowCount / 2; for (int i = 0; i < n2; i++) { for (int j = 0; j < 12; j++) { tbl.Rows[i][j + 13] = tbl.Rows[i + n2][j]; } } for (int i = rowCount - 1; i >= n2; i--) { tbl.Rows[i].Delete(); } } lblError.Text = ""; RadGrid1.DataSource = tbl; RadGrid1.DataBind(); } else { lblError.Text = errmsg; } }
protected void bntApply_Click(object sender, System.EventArgs e) { CCDBaccess db = new CCDBaccess(); string errmsg = ""; ArrayList selectedPressIDList = GetSelectedLocations(); int masterCopySeparationSet = Globals.TryParse(txtMasterCopySeparationSet.Text, 0); foreach (int pressID in selectedPressIDList) { db.RetransmitMasterCopySeparationSetTX(pressID, masterCopySeparationSet, out errmsg); } InjectScript.Text = "<script>RefreshParentPage()</" + "script>"; }
protected void bntApply_Click(object sender, EventArgs e) { int publicationID = Session["SelectedPublication"] != null?Globals.GetIDFromName("PublicationNameCache", (string)Session["SelectedPublication"]) : 0; DateTime pubDate = Session["SelectedPubDate"] != null ? (DateTime)Session["SelectedPubDate"] : DateTime.MinValue; int nEditionID = Globals.GetIDFromName("EditionNameCache", (string)Session["SelectedEdition"]); int nSectionID = Globals.GetIDFromName("SectionNameCache", (string)Session["SelectedSection"]); string errmsg = ""; CCDBaccess db = new CCDBaccess(); db.ApproveAll(publicationID, pubDate, nEditionID, nSectionID, (string)Session["Username"], txtComment.Text, (bool)Session["LogApprove"], out errmsg); InjectScript.Text = "<script>RefreshParentPage()</" + "script>"; }
private void Button1_Click(object sender, System.EventArgs e) { CCDBaccess db = new CCDBaccess(); string userName = (string)Session["UserName"]; int nPagesPerRow = 8; if (DropdownlistImagePerRow.SelectedIndex != -1) { nPagesPerRow = Globals.TryParse(DropdownlistImagePerRow.SelectedValue, 8); } int nRefreshTime = Globals.TryParse(txtRefreshTime.Text, 60); if (nPagesPerRow == 4 || nPagesPerRow == 6 || nPagesPerRow == 8 || nPagesPerRow == 10 || nPagesPerRow == 12 || nPagesPerRow == 14 || nPagesPerRow == 16 || nPagesPerRow == 18) { DropdownlistImagePerRow.SelectedValue = nPagesPerRow.ToString(); } else { DropdownlistImagePerRow.SelectedValue = "8"; } int nPlatesPerRow = 4; if (DropDownListPlateSize.SelectedIndex != -1) { nPlatesPerRow = Globals.TryParse(DropDownListPlateSize.SelectedValue, 8); } db.UpdateUserProfile(userName, txtRealname.Text, txtEmail.Text, nPagesPerRow, nRefreshTime, nPlatesPerRow, out string errmsg); lblError.Text = errmsg; Session["RefreshTime"] = nRefreshTime; Session["PagesPerRow"] = nPagesPerRow; Session["PlatesPerRow"] = nPlatesPerRow; Session["RefreshTime"] = nRefreshTime; bool useHTML5 = Globals.TryParse(DropDownListViewer.SelectedValue, 0) > 0; if ((bool)Application["FieldExists_UserNames_UseHTML5"]) { db.UpdateDefaultUserViewer(userName, useHTML5, out errmsg); } Session["UseHTML5"] = useHTML5; }
private void Page_Load(object sender, System.EventArgs e) { Response.ContentEncoding = Encoding.GetEncoding((string)Session["encoding"]); Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture((string)Session["language"]); Thread.CurrentThread.CurrentUICulture = new CultureInfo((string)Session["language"]); btnCancel.Text = Global.rm.GetString("txtCancel"); bntApply.Text = Global.rm.GetString("txtApply"); LabelHeader.Text = Global.rm.GetString((bool)Application["LocationIsPress"] ? "txtRetransmitForm" : "txtReimageForm"); CheckBoxRelease.Text = Global.rm.GetString("txtRelease"); CheckboxSendToAll.Visible = false; if (!this.IsPostBack) { if (Session["SelectedCopyFlatSeparationSet"] == null) { lblError.Text = "Session variable error"; InjectScript.Text = "<script>CloseOnReload()</" + "script>"; return; } CCDBaccess db = new CCDBaccess(); string errmsg = ""; //string sPageName = ""; ArrayList alColors = new ArrayList(); ArrayList alActiveColors = new ArrayList(); int copyFlatSeparationSet = (int)Session["SelectedCopyFlatSeparationSet"]; if (db.GetPlateColors(copyFlatSeparationSet, ref alColors, out errmsg) == false) { lblError.Text = errmsg; return; } if (alColors.Count == 0) { lblError.Text = errmsg; return; } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { int publicationID = Session["SelectedPublication"] != null?Globals.GetIDFromName("PublicationNameCache", (string)Session["SelectedPublication"]) : 0; DateTime pubDate = Session["SelectedPubDate"] != null ? (DateTime)Session["SelectedPubDate"] : DateTime.MinValue; int nEditionID = Globals.GetIDFromName("EditionNameCache", (string)Session["SelectedEdition"]); int nSectionID = Globals.GetIDFromName("SectionNameCache", (string)Session["SelectedSection"]); if (publicationID == 0 || pubDate.Year < 2000) { InjectScript.Text = "<script>CloseOnReload()</" + "script>"; return; } string product = string.Format("{0} {1:00}-{2:00}", (string)Session["SelectedPublication"], pubDate.Day, pubDate.Month); if (nEditionID > 0) { product += " " + (string)Session["SelectedEdition"]; } if (nSectionID > 0) { product += " " + (string)Session["SelectedSection"]; } lblProductText.Text = product; string errmsg = ""; CCDBaccess db = new CCDBaccess(); int dummypressID = 0; int productionID = db.GetProductionID(ref dummypressID, publicationID, pubDate, 0, out errmsg); int planVersion = db.GetPlanVersion(productionID, out errmsg); txtVersion.Text = planVersion > 0 ? planVersion.ToString() : "1"; } Response.ContentEncoding = Encoding.GetEncoding((string)Session["encoding"]); Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture((string)Session["language"]); Thread.CurrentThread.CurrentUICulture = new CultureInfo((string)Session["language"]); lblProductLabel.Text = Global.rm.GetString("txtProduct"); lblVersion.Text = Global.rm.GetString("txtVersion"); bntApply.Text = Global.rm.GetString("txtApply"); btnCancel.Text = Global.rm.GetString("txtCancel"); }