Exemple #1
0
        protected void BindValue()
        {
            Pub onePub = PE_DAL.GetProdGenData(intPubID);

            this.txtCPJNum.Text                   = onePub.ProdID;
            this.txtShortTitle.Text               = onePub.ShortTitle;
            this.txtLongTitle.Text                = onePub.LongTitle;
            this.lblNIHNum.Text                   = onePub.NIHNum;
            this.txtFS.Text                       = onePub.FSNum;
            this.txtSpanishAccentLongTitle.Text   = onePub.SpanishAccentLongTitle;
            this.txtSpanishNoAccentLongTitle.Text = onePub.SpanishNoAccentLongTitle;
            this.txtURL.Text                      = onePub.URL;
            this.txtNerdoURL.Text                 = onePub.URL2;
            this.txtPDFURL.Text                   = onePub.PDFURL;
            this.txtKindleURL.Text                = onePub.KINDLEURL;
            this.txtePubURL.Text                  = onePub.EPUBURL;
            this.txtPrintFileURL.Text             = onePub.PRINTFILEURL;

            if (onePub.Qty >= 0)
            {
                this.lblMaxQtyTile.Text = this.txtMaxQtyTile.Text = onePub.Qty.ToString();
            }
            else
            {
                this.lblMaxQtyTile.Text = this.txtMaxQtyTile.Text = String.Empty;
            }
            if (onePub.QtyAvailable >= 0)
            {
                //NCIDC this.lblQtyAvai.Text = onePub.QtyAvailable.ToString();
                this.txtQtyAvai.Text = onePub.QtyAvailable.ToString();
            }
            else
            {
                //NCIDC this.lblQtyAvai.Text = String.Empty;
                this.txtQtyAvai.Text = String.Empty;
            }
            if (onePub.QtyThreshold >= 0)
            {
                this.txtQtyThresh.Text = onePub.QtyThreshold.ToString();
            }
            else
            {
                this.txtQtyThresh.Text = String.Empty;
            }


            this.PopulateBookStatusDropDown(onePub.Status.Trim()); //NCIDC
            //NCIDC this.lblBkStatus.Text = onePub.Status;

            if (onePub.Weight >= 0)
            {
                this.lblWeight.Text = this.txtWeight.Text = onePub.Weight.ToString();
            }
            else
            {
                this.lblWeight.Text = this.txtWeight.Text = String.Empty;
            }

            //this.lblOwnervalue.Text = onePub.Owner;
            //this.lblSponsorvalue.Text = onePub.Sponsor;

            this.lblRecPubDate.Text = onePub.RecDate.CompareTo(DateTime.MinValue) != 0 ? onePub.RecDate.ToShortDateString() : String.Empty;

            if (onePub.ProdOrigDate_M == 0)
            {
                if (onePub.ProdOrigDate_Y == 0)
                {
                    this.lblOrigPubDate.Text = "";
                }
                else
                {
                    this.lblOrigPubDate.Text = onePub.ProdOrigDate_Y.ToString();
                }
            }
            else
            {
                this.lblOrigPubDate.Text = onePub.ProdOrigDate_M.ToString();

                if (onePub.ProdOrigDate_D == 0)
                {
                    if (onePub.ProdOrigDate_Y == 0)
                    {
                        this.lblOrigPubDate.Text = "";
                    }
                    else
                    {
                        this.lblOrigPubDate.Text += "/" + onePub.ProdOrigDate_Y.ToString();
                    }
                }
                else
                {
                    this.lblOrigPubDate.Text += "/" + onePub.ProdOrigDate_D.ToString();
                    if (onePub.ProdOrigDate_Y == 0)
                    {
                        this.lblOrigPubDate.Text = "";
                    }
                    else
                    {
                        this.lblOrigPubDate.Text += "/" + onePub.ProdOrigDate_Y.ToString();
                    }
                }
            }

            if (onePub.LastPrintDate_M == 0)
            {
                if (onePub.LastPrintDate_Y == 0)
                {
                    this.lblLatestPrintDate.Text = "";
                }
                else
                {
                    this.lblLatestPrintDate.Text = onePub.LastPrintDate_Y.ToString();
                }
            }
            else
            {
                this.lblLatestPrintDate.Text = onePub.LastPrintDate_M.ToString();

                if (onePub.LastPrintDate_D == 0)
                {
                    if (onePub.LastPrintDate_Y == 0)
                    {
                        this.lblLatestPrintDate.Text = "";
                    }
                    else
                    {
                        this.lblLatestPrintDate.Text += "/" + onePub.LastPrintDate_Y.ToString();
                    }
                }
                else
                {
                    this.lblLatestPrintDate.Text += "/" + onePub.LastPrintDate_D.ToString();
                    if (onePub.LastPrintDate_Y == 0)
                    {
                        this.lblLatestPrintDate.Text = "";
                    }
                    else
                    {
                        this.lblLatestPrintDate.Text += "/" + onePub.LastPrintDate_Y.ToString();
                    }
                }
            }

            if (onePub.LastRevDate_M == 0)
            {
                if (onePub.LastRevDate_Y == 0)
                {
                    this.lblRevPubDate.Text = "";
                }
                else
                {
                    this.lblRevPubDate.Text = onePub.LastRevDate_Y.ToString();
                }
            }
            else
            {
                this.lblRevPubDate.Text = onePub.LastRevDate_M.ToString();

                if (onePub.LastRevDate_D == 0)
                {
                    if (onePub.LastRevDate_Y == 0)
                    {
                        this.lblRevPubDate.Text = "";
                    }
                    else
                    {
                        this.lblRevPubDate.Text += "/" + onePub.LastRevDate_Y.ToString();
                    }
                }
                else
                {
                    this.lblRevPubDate.Text += "/" + onePub.LastRevDate_D.ToString();
                    if (onePub.LastRevDate_Y == 0)
                    {
                        this.lblRevPubDate.Text = "";
                    }
                    else
                    {
                        this.lblRevPubDate.Text += "/" + onePub.LastRevDate_Y.ToString();
                    }
                }
            }
            //this.lblOrigPubDate.Text = onePub.ProdOrigDate.CompareTo(DateTime.MinValue) != 0 ? onePub.ProdOrigDate.ToString() : String.Empty;
            //this.lblLatestPrintDate.Text = onePub.LastPrintDate.CompareTo(DateTime.MinValue) != 0 ? onePub.LastPrintDate.ToString() : String.Empty;
            //this.lblRevPubDate.Text = onePub.LastRevDate.CompareTo(DateTime.MinValue) != 0 ? onePub.LastRevDate.ToString() : String.Empty;
            this.lblArchiveDate.Text = onePub.ArchDate.CompareTo(DateTime.MinValue) != 0 ? onePub.ArchDate.ToShortDateString() : String.Empty;

            //NCIDC if ((this.Mode == PubEntAdminManager.strPubGlobalAMode) ||
            //NCIDC ((this.Mode == PubEntAdminManager.strPubGlobalEMode) && !onePub.NONEDITABLEFIELDSFLAG))
            if ((this.Mode == PubEntAdminManager.strPubGlobalAMode) ||
                (this.Mode == PubEntAdminManager.strPubGlobalEMode)) //Removed check for NONEDITABLEFIELDSFLAG flag (Verified this flag is not set from Admin Tool - possibly had to do something with CPJ at some point)

            {
                this.txtWeight.Visible = this.txtMaxQtyTile.Visible = true;
                this.lblWeight.Visible = this.lblMaxQtyTile.Visible = false;
            }
            else
            {
                this.txtWeight.Visible = this.txtMaxQtyTile.Visible = false;
                this.lblWeight.Visible = this.lblMaxQtyTile.Visible = true;
            }

            //QC Report
            if (onePub.ProdID.Length > 0)
            {
                this.QCLink.NavigateUrl = "~/reportform.aspx?pubid=" + onePub.PubID;
            }


            if (false && onePub.Status == PubEntAdminManager.strInactivePubs)   //***EAC Disabled per HITT 12194 (20120827)
            {
                this.ddlOwner.Enabled = false;
            }
            else
            {
                if (onePub.OwnerID != -1 && onePub.OwnerActive && !onePub.OwnerArcchive)
                {
                    ddlOwner.SelectedValue = onePub.OwnerID.ToString();
                }
                if (!onePub.OwnerActive || onePub.OwnerArcchive)
                {
                    ddlOwner.SelectedItem.Value = onePub.OwnerID.ToString();
                    ddlOwner.SelectedItem.Text  = "";
                }
            }

            if (false && onePub.Status == PubEntAdminManager.strInactivePubs)   //***EAC Disabled per HITT 12194 (20120827)
            {
                this.ddlSponsor.Enabled = false;
            }
            else
            {
                if (onePub.SponsorID != -1 && onePub.SponsorActive && !onePub.SponsorArchvie)
                {
                    ddlSponsor.SelectedValue = onePub.SponsorID.ToString();
                }
                if (!onePub.SponsorActive || onePub.SponsorArchvie)
                {
                    ddlSponsor.SelectedItem.Value = onePub.SponsorID.ToString();
                    ddlSponsor.SelectedItem.Text  = "";
                }
            }
        }
        protected void BindOptions()
        {
            //if (this.Mode == PubEntAdminManager.strPubGlobalAMode)
            //{
            this.listLang.DataSource         = PE_DAL.GetAllLang(true);
            this.listAudience.DataSource     = PE_DAL.GetAllAudience(true);
            this.listCancerType.DataSource   = PE_DAL.GetAllCancerType(true);
            this.listProdFormat.DataSource   = PE_DAL.GetAllProdFormat(true);
            this.listReadingLevel.DataSource = PE_DAL.GetAllReadinglevel(true);
            //NCIPL_CC this.listSeries.DataSource = PE_DAL.GetAllSeries(true);
            this.listAward.DataSource = PE_DAL.GetAllAward(true);
            this.listRace.DataSource  = PE_DAL.GetAllRace(true);
            //}
            //else
            //{
            //    this.listLang.DataSource = PE_DAL.GetAllLang(false);
            //    this.listAudience.DataSource = PE_DAL.GetAllAudience(false);
            //    this.listCancerType.DataSource = PE_DAL.GetAllCancerType(false);
            //    this.listProdFormat.DataSource = PE_DAL.GetAllProdFormat(false);
            //    this.listReadingLevel.DataSource = PE_DAL.GetAllReadinglevel(false);
            //    this.listSeries.DataSource = PE_DAL.GetAllSeries(false);
            //    this.listAward.DataSource = PE_DAL.GetAllAward(false);
            //    this.listRace.DataSource = PE_DAL.GetAllRace(false);
            //}

            this.listLang.DataTextField  = "name";
            this.listLang.DataValueField = "id";
            this.listLang.DataBind();

            this.listAudience.DataTextField  = "name";
            this.listAudience.DataValueField = "id";
            this.listAudience.DataBind();

            this.listCancerType.DataTextField  = "name";
            this.listCancerType.DataValueField = "id";
            this.listCancerType.DataBind();

            this.listProdFormat.DataTextField  = "name";
            this.listProdFormat.DataValueField = "id";
            this.listProdFormat.DataBind();

            this.listReadingLevel.DataTextField  = "name";
            this.listReadingLevel.DataValueField = "id";
            this.listReadingLevel.DataBind();

            //NCIPL_CC this.listSeries.DataTextField = "name";
            //NCIPL_CC this.listSeries.DataValueField = "id";
            //NCIPL_CC this.listSeries.DataBind();

            this.listAward.DataTextField  = "name";
            this.listAward.DataValueField = "id";
            this.listAward.DataBind();

            this.listRace.DataTextField  = "name";
            this.listRace.DataValueField = "id";
            this.listRace.DataBind();

            this.rdbtnListCopyRightMaterial.DataBind();

            this.CkboxListNewUpdated.DataBind();

            this.CkboxListNewUpdated.Attributes.Add("onclick", "javascript:GenProjSettingENewUpdatedSetting();");
        }
        protected void BindValues()
        {
            Pub l_pub = PE_DAL.GetProdComData(this.PubID);

            this.TextCtrl_SpellCkDescription.Text = l_pub.Description;
            this.TextCtrl_SpellCk_Keyword.Text    = l_pub.Keywords;
            this.TextCtrl_SpellCk_Summary.Text    = l_pub.Summary;

            if (l_pub.IsCopyRight > 0)
            {
                this.rdbtnListCopyRightMaterial.Yes = true;
            }
            else if (l_pub.IsCopyRight == 0)
            {
                this.rdbtnListCopyRightMaterial.No = true;
            }

            //this.fileTestUpload..Text = l_pub.Thumbnail;
            if (l_pub.TotalNumPage != 0)
            {
                this.txtTotalPage.Text = l_pub.TotalNumPage.ToString();
            }
            //this.txtTotalPage.Text = l_pub.TotalNumPage.ToString();
            this.fakeinput.Value   = l_pub.Thumbnail;
            this.fakeLginput.Value = l_pub.LargeImage;

            this.TextCtrl_SpellCk_Dimension.Text = l_pub.Dimension;
            this.TextCtrl_SpellCk_Color.Text     = l_pub.Color;
            this.TextCtrl_SpellCk_Other.Text     = l_pub.Other;

            this.TextCtrl_SpellCk_POSInst.Text = l_pub.POSInst;

            if (l_pub.NEW > 0)
            {
                this.CkboxListNewUpdated.New = true;
            }
            else if (l_pub.NEW == 0)
            {
                this.CkboxListNewUpdated.New = false;
            }

            if (l_pub.UPDATED > 0)
            {
                this.CkboxListNewUpdated.Updated = true;
            }
            else if (l_pub.UPDATED == 0)
            {
                this.CkboxListNewUpdated.Updated = false;
            }

            if (l_pub.EXPDATE.CompareTo(DateTime.MinValue) > 0)
            {
                this.txtExpDate.Text = l_pub.EXPDATE.ToShortDateString();
            }

            MultiSelectListBoxItemCollection rcoll = PE_DAL.GetLangByPubID(this.PubID);

            foreach (Lang p in rcoll)
            {
                ListItem matchItem = this.listLang.Items.FindByValue(p.LangID.ToString());
                if (matchItem != null)
                {
                    matchItem.Selected = true;
                }
            }


            rcoll = PE_DAL.GetCancerTypeByPubID(this.PubID);
            foreach (PubEntAdmin.BLL.CancerType p in rcoll)
            {
                ListItem matchItem = this.listCancerType.Items.FindByValue(p.CancerTypeID.ToString());
                if (matchItem != null)
                {
                    matchItem.Selected = true;
                }
            }

            rcoll = PE_DAL.GetAudienceByPubID(this.PubID);
            foreach (PubEntAdmin.BLL.Audience p in rcoll)
            {
                ListItem matchItem = this.listAudience.Items.FindByValue(p.AudID.ToString());
                if (matchItem != null)
                {
                    matchItem.Selected = true;
                }
            }

            rcoll = PE_DAL.GetProdFormatByPubID(this.PubID);
            foreach (ProdFormat p in rcoll)
            {
                ListItem matchItem = this.listProdFormat.Items.FindByValue(p.ProdFormatID.ToString());
                if (matchItem != null)
                {
                    matchItem.Selected = true;
                }
            }

            //Commented - NCIPL_CC (Moved Series to NCIPL and ROO tabs)
            //rcoll = PE_DAL.GetSeriesByPubID(this.PubID);
            //foreach (PubEntAdmin.BLL.Series p in rcoll)
            //{
            //    ListItem matchItem = this.listSeries.Items.FindByValue(p.SeriesID.ToString());
            //    if (matchItem != null)
            //    {
            //        matchItem.Selected = true;
            //    }
            //}

            rcoll = PE_DAL.GetRaceByPubID(this.PubID);
            foreach (PubEntAdmin.BLL.Race p in rcoll)
            {
                ListItem matchItem = this.listRace.Items.FindByValue(p.RaceID.ToString());
                if (matchItem != null)
                {
                    matchItem.Selected = true;
                }
            }

            rcoll = PE_DAL.GetReadlevelByPubID(this.PubID);
            foreach (Readlevel p in rcoll)
            {
                ListItem matchItem = this.listReadingLevel.Items.FindByValue(p.ReadlevelID.ToString());
                if (matchItem != null)
                {
                    matchItem.Selected = true;
                }
            }

            rcoll = PE_DAL.GetAwardByPubID(this.PubID);
            foreach (PubEntAdmin.BLL.Award p in rcoll)
            {
                ListItem matchItem = this.listAward.Items.FindByValue(p.AwardID.ToString());
                if (matchItem != null)
                {
                    matchItem.Selected = true;
                }
            }
        }
Exemple #4
0
 protected void btnReset_Click(object sender, EventArgs e)
 {
     this.BindData(PE_DAL.GetAllFeaturedPubsSeq(DEFAULT_SORTBY, true));
 }
Exemple #5
0
 public static void MarkOrderBad(int orderid, string who, string reason, out string returnmsg)
 {
     PE_DAL.MarkOrderBad(orderid, who, reason, out returnmsg);
 }
Exemple #6
0
 public static OrderCollection GetPrankOrders(string s)
 {
     return(PE_DAL.GetPrankOrders(s));
 }
        protected void BindData_(string PubIDs)
        {
            List <Pub> l_listPub = null;

            string l_key = String.Empty;

            if (PubIDs == null)
            {
                l_key = this.CleanSearchTerms(this.PreviousPage.Keyword.Trim());

                l_listPub =
                    PE_DAL.AdminDoSearch(
                        this.PreviousPage.NCIPL ? 1 : 0,
                        this.PreviousPage.ROO ? 1 : 0,
                        this.PreviousPage.Exh ? 1 : 0,
                        this.PreviousPage.Catalog ? 1 : 0,
                        l_key.Length > 0 ? l_key : null,
                        this.PreviousPage.NIHNum1.Trim().Length > 0 ? this.PreviousPage.NIHNum1.Trim() : null,
                        this.PreviousPage.NIHNum2.Trim().Length > 0 ? this.PreviousPage.NIHNum2.Trim() : null,
                        Convert.ToBoolean(this.PreviousPage.Newpub) ? 1 : 0,
                        Convert.ToBoolean(this.PreviousPage.Updatedpub) ? 1 : 0,
                        this.PreviousPage.CreatedFrom.Length > 0 ? Convert.ToDateTime(this.PreviousPage.CreatedFrom) : DateTime.MinValue,
                        this.PreviousPage.CreatedTo.Length > 0 ? Convert.ToDateTime(this.PreviousPage.CreatedTo) : DateTime.MinValue,
                        (this.PreviousPage.SelectedCancerType.Length > 0 && this.PreviousPage.SelectedCancerType != "0") ? this.PreviousPage.SelectedCancerType : null,
                        (this.PreviousPage.SelectedSubject.Length > 0 && this.PreviousPage.SelectedSubject != "0") ? this.PreviousPage.SelectedSubject : null,
                        (this.PreviousPage.SelectedAudience.Length > 0 && this.PreviousPage.SelectedAudience != "0") ? this.PreviousPage.SelectedAudience : null,
                        (this.PreviousPage.SelectedLang.Length > 0 && this.PreviousPage.SelectedLang != "0") ? this.PreviousPage.SelectedLang : null,
                        (this.PreviousPage.SelectedProdFormat.Length > 0 && this.PreviousPage.SelectedProdFormat != "0") ? this.PreviousPage.SelectedProdFormat : null,
                        (this.PreviousPage.SelectedSeries.Length > 0 && this.PreviousPage.SelectedSeries != "0") ? this.PreviousPage.SelectedSeries : null,
                        (this.PreviousPage.SelectedRace.Length > 0 && this.PreviousPage.SelectedRace != "0") ? this.PreviousPage.SelectedRace : null,
                        (this.PreviousPage.SelectedBookStatus.Length > 0 && this.PreviousPage.SelectedBookStatus != "0") ? this.PreviousPage.SelectedBookStatus : null,
                        (this.PreviousPage.SelectedReadingLevel.Length > 0 && this.PreviousPage.SelectedReadingLevel != "0") ? this.PreviousPage.SelectedReadingLevel : null,
                        this.PreviousPage.ROOMostCom ? 1 : 0,
                        (this.PreviousPage.SelectedROOSubject.Length > 0 && this.PreviousPage.SelectedROOSubject != "0") ? this.PreviousPage.SelectedROOSubject : null,
                        (this.PreviousPage.SelectedAward.Length > 0 && this.PreviousPage.SelectedAward != "0") ? this.PreviousPage.SelectedAward : null,
                        (this.PreviousPage.SelectedOwner.Length > 0 && this.PreviousPage.SelectedOwner != "0") ? this.PreviousPage.SelectedOwner : null,
                        (this.PreviousPage.SelectedSponsor.Length > 0 && this.PreviousPage.SelectedSponsor != "0") ? this.PreviousPage.SelectedSponsor : null, null

                        );
            }
            else
            {
                this.mySearch = ((Search)Session[PubEntAdminManager.strSearchCriteria]);

                l_key = this.CleanSearchTerms(this.mySearch.Key.Trim());

                l_listPub = PE_DAL.AdminDoSearch(
                    this.mySearch.NCIPL ? 1 : 0,
                    this.mySearch.ROO ? 1 : 0,
                    this.mySearch.EXH ? 1 : 0,
                    this.mySearch.CATALOG ? 1 : 0,
                    l_key.Length > 0 ? l_key : null,
                    this.mySearch.NIH1.Trim().Length > 0 ? this.mySearch.NIH1.Trim() : null,
                    this.mySearch.NIH2.Trim().Length > 0 ? this.mySearch.NIH2.Trim() : null,
                    Convert.ToBoolean(this.mySearch.ISNEW) ? 1 : 0,
                    Convert.ToBoolean(this.mySearch.ISUPDATED) ? 1 : 0,
                    this.mySearch.CreateFrom.Length > 0 ? Convert.ToDateTime(this.mySearch.CreateFrom) : DateTime.MinValue,
                    this.mySearch.CreateTo.Length > 0 ? Convert.ToDateTime(this.mySearch.CreateTo) : DateTime.MinValue,
                    (this.mySearch.Cancer.Length > 0 && this.mySearch.Cancer != "0") ? this.mySearch.Cancer : null,
                    (this.mySearch.Subj.Length > 0 && this.mySearch.Subj != "0") ? this.mySearch.Subj : null,
                    (this.mySearch.Aud.Length > 0 && this.mySearch.Aud != "0") ? this.mySearch.Aud : null,
                    (this.mySearch.Lang.Length > 0 && this.mySearch.Lang != "0") ? this.mySearch.Lang : null,
                    (this.mySearch.Format.Length > 0 && this.mySearch.Format != "0") ? this.mySearch.Format : null,
                    (this.mySearch.Serie.Length > 0 && this.mySearch.Serie != "0") ? this.mySearch.Serie : null,
                    (this.mySearch.Race.Length > 0 && this.mySearch.Race != "0") ? this.mySearch.Race : null,
                    (this.mySearch.Status.Length > 0 && this.mySearch.Status != "0") ? this.mySearch.Status : null,
                    (this.mySearch.Level.Length > 0 && this.mySearch.Level != "0") ? this.mySearch.Level : null,
                    this.mySearch.ROOCOM ? 1 : 0,
                    (this.mySearch.ROOCOMSubj.Length > 0 && this.mySearch.ROOCOMSubj != "0") ? this.mySearch.ROOCOMSubj : null,
                    (this.mySearch.Award.Length > 0 && this.mySearch.Award != "0")? this.mySearch.Award : null,
                    (this.mySearch.Owner.Length > 0 && this.mySearch.Owner != "0") ? this.mySearch.Owner : null,
                    (this.mySearch.Sponsor.Length > 0 && this.mySearch.Sponsor != "0") ? this.mySearch.Sponsor : null,
                    PubIDs);
            }

            if (l_listPub.Count == 1)
            {
                if (this.Export)
                {
                    this.RemColumnHeadersSortedImg();
                    this.gvResult.DataSource = l_listPub;
                    this.gvResult.DataBind();
                }
                else
                {
                    this.mySearch.ClearPubId();
                    this.mySearch.AddPubId(l_listPub[0].PubID);
                    Session[PubEntAdminManager.strSearchCriteria] = this.mySearch;

                    //go directly to pubrecord page
                    if (PubEntAdminManager.TamperProof)
                    {
                        PubEntAdminManager.RedirectEncodedURLWithQS("PubRecord.aspx", "mode=view&pubid=" + l_listPub[0].PubID.ToString());
                    }
                    else
                    {
                        Response.Redirect("PubRecord.aspx?mode=view&pubid=" + l_listPub[0].PubID.ToString(), true);
                    }
                }
            }
            else
            {
                this.lblTotalResCnt.Text = l_listPub.Count.ToString();

                if (!this.Export)
                {
                    this.mySearch.ClearPubId();
                    //Update the column headers
                    UpdateColumnHeaders();
                }
                else
                {
                    this.RemColumnHeadersSortedImg();
                }

                this.gvResult.DataSource = l_listPub;
                this.gvResult.DataBind();

                if (l_listPub.Count == 0)
                {
                    this.trTopCtrlPnl.Visible   = this.trBtmCtrlPnl.Visible = false;
                    this.gvResult.Visible       = false;
                    this.hyplnkRefSrch2.Visible = this.hyplnkSrch2.Visible = false;
                }
            }
            Session[PubEntAdminManager.strSearchCriteria] = this.mySearch;
        }
Exemple #8
0
        public bool Save()
        {
            string SeledConfValue = "", SeledRotateValue = "";

            if (txtSeledConf.Text.Trim() != "")
            {
                SeledConfValue = this.txtSeledConf.Text.Substring(0, txtSeledConf.Text.Length - 1);
            }
            if (txtRotate.Text.Trim() != "")
            {
                SeledRotateValue = this.txtRotate.Text.Substring(0, txtRotate.Text.Length - 1);
            }
            this.SecVal();

            bool blnDisplayStatusSave = PE_DAL.SetExhDisplayStatusByPubID(this.PubID, this.ckboxListDisplayStatusExh.SelectedValueToString(), ',');

            bool blnNCIPLInterfaceSave = PE_DAL.SetExhInterface(this.PubID,
                                                                this.txtMaxQtyExh.Text.Trim().Length != 0 ? System.Convert.ToInt32(this.txtMaxQtyExh.Text.Trim()) : -1,
                                                                this.txtMaxQtyIntl.Text.Trim().Length != 0 ? System.Convert.ToInt32(this.txtMaxQtyIntl.Text.Trim()) : -1,
                                                                System.Convert.ToInt32(this.rdbtnListYesNoEveryOrder.Yes),
                                                                System.Convert.ToInt32(this.rdbtnListYesNoShowInSearchRes.Yes));

            if (IsExh)
            {
                bool   blnExcPubs   = true;
                string strExcPubsEr = "";

                if (SeledRotateValue != "")
                {
                    Array    a         = SeledRotateValue.Split(',');
                    string[] aryString = new string[a.Length];


                    for (int i = 0; i < a.Length; i++)
                    {
                        DataSet ds = LU_DAL.displayRotationPubsData(Convert.ToInt32(a.GetValue(i)));
                        if (ds.Tables.Count > 0)
                        {
                            if (ds.Tables[0].Rows.Count > 36)
                            {
                                blnExcPubs = false;
                                if (strExcPubsEr == "")
                                {
                                    strExcPubsEr = "There are already 36 rotation publications for " + ds.Tables[0].Rows[0].ItemArray[1].ToString();
                                }
                                else
                                {
                                    strExcPubsEr += ", " + ds.Tables[0].Rows[0].ItemArray[1].ToString();
                                }
                            }
                        }
                    }
                }

                if (blnExcPubs)
                {
                    this.lblErrorRotate.Text = "";
                    bool blnKioskConfSave = PE_DAL.SetExhKioskInterface(this.PubID, SeledConfValue, SeledRotateValue, ',');
                    if (blnDisplayStatusSave && blnNCIPLInterfaceSave && blnKioskConfSave)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    this.lblErrorRotate.Text = strExcPubsEr + " conference(s).";
                    return(false);
                }
            }
            else
            {
                if (blnDisplayStatusSave && blnNCIPLInterfaceSave)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Exemple #9
0
        protected void BindValues()
        {
            //If the mode is add, apply the following;
            //else retrieve from DB
            if (Session[PubEntAdminManager.strPubGlobalMode] != null)
            {
                if (Session[PubEntAdminManager.strPubGlobalMode].ToString() == PubEntAdminManager.strPubGlobalAMode)//add
                {
                    this.rdbtnListYesNoEveryOrder.No       = true;
                    this.rdbtnListYesNoShowInSearchRes.Yes = true;
                    //this.ckboxListDisplayStatusExh.IsOrder = true;
                }
                else
                {
                    MultiSelectListBoxItemCollection rcoll = PE_DAL.GetExhDisplayStatusByPubID(this.PubID);
                    foreach (DisplayStatus p in rcoll)
                    {
                        ListItem matchItem = this.ckboxListDisplayStatusExh.Items.FindByValue(p.DisplayStatusID.ToString());
                        if (matchItem != null)
                        {
                            matchItem.Selected = true;
                        }
                    }

                    ExhCollection l = PE_DAL.GetExhInterface(this.PubID);
                    if (l.Count > 0)
                    {
                        Exh l_Exh = l[0];

                        if (l_Exh.EVERYORDER_EXHIBIT > 0)
                        {
                            this.rdbtnListYesNoEveryOrder.Yes = true;
                        }
                        else if (l_Exh.EVERYORDER_EXHIBIT == 0)
                        {
                            this.rdbtnListYesNoEveryOrder.No = true;
                        }

                        //if (!this.rdbtnListYesNoEveryOrder.Selected())
                        //{
                        //    this.rdbtnListYesNoEveryOrder.No = true;
                        //    this.rdbtnListYesNoShowInSearchRes.Yes = true;
                        //}

                        if (l_Exh.ISSEARCHABLE_EXHIBIT > 0)
                        {
                            this.rdbtnListYesNoShowInSearchRes.Yes = true;
                        }
                        else if (l_Exh.ISSEARCHABLE_EXHIBIT == 0)
                        {
                            this.rdbtnListYesNoShowInSearchRes.No = true;
                        }

                        //this.rdbtnListYesNoEveryOrder.Yes = l_Exh.EVERYORDER_EXHIBIT ? true : false;
                        //this.rdbtnListYesNoShowInSearchRes.Yes = l_Exh.ISSEARCHABLE_EXHIBIT ? true : false;

                        this.txtMaxQtyExh.Text  = l_Exh.MAXQTY_EXHIBIT.ToString();
                        this.txtMaxQtyIntl.Text = l_Exh.MAXINTL_EXHIBIT.ToString();
                    }

                    rcoll = PE_DAL.GetKioskConfByPubID(this.PubID);

                    this.listSeledConf.DataSource     = rcoll;
                    this.listSeledConf.DataTextField  = "name";
                    this.listSeledConf.DataValueField = "id";
                    this.listSeledConf.DataBind();


                    MultiSelectListBoxItemCollection lstConfSource = this.listConf.DataSource;
                    foreach (PubEntAdmin.BLL.Conf p in rcoll)
                    {
                        MultiSelectListBoxItem li = new MultiSelectListBoxItem();
                        li.Name = p.ConfName.ToString();
                        li.ID   = p.ConfID;

                        int count = lstConfSource.Count;

                        for (int i = 0; i < count; i++)
                        {
                            MultiSelectListBoxItem item = lstConfSource[i];
                            if (item.Name == li.Name)
                            {
                                lstConfSource.RemoveAt(i);
                                i--;
                                count--;
                            }
                        }
                        li = null;

                        this.txtSeledConf.Text += p.ID + ",";
                    }

                    listConf.DataSource = lstConfSource;
                    listConf.DataBind();

                    MultiSelectListBoxItemCollection rcollR = PE_DAL.GetKioskConfRotateByPubID(this.PubID);
                    this.listRotate.DataSource     = rcollR;
                    this.listRotate.DataTextField  = "name";
                    this.listRotate.DataValueField = "id";
                    this.listRotate.DataBind();
                    foreach (PubEntAdmin.BLL.Conf p in rcollR)
                    {
                        this.txtRotate.Text += p.ID + ",";
                    }
                }
            }
        }
 public bool Save()
 {
     return(PE_DAL.SetLiveNewUpdatePubID(this.PubID));
 }
Exemple #11
0
 public static bool SetProdFormat(int pubid, string selectedValue, char delim)
 {
     return(PE_DAL.SetProdFormatByPubID(pubid, selectedValue, delim));
 }
        protected void dgInfoViewNCIPL_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                if (String.Compare(((DataRowView)e.Item.DataItem).Row[0].ToString(), "Display Status:", true) == 0)
                {
                    DataSet iSet = PE_DAL.GetNCIPLDisplayStatusView(this.PubID);

                    if (iSet.Tables[0].Rows.Count > 0)
                    {
                        Label l_displayStatus = new Label();

                        foreach (DataRow s in iSet.Tables[0].Rows)
                        {
                            if (l_displayStatus.Text.Length > 0)
                            {
                                l_displayStatus.Text += ", ";
                            }
                            l_displayStatus.Text += s.ItemArray[1].ToString();
                        }
                        l_displayStatus.Text.Trim();
                        ((DataRowView)e.Item.DataItem).Row[0] = "";
                        e.Item.Cells[1].Controls.Clear();
                        e.Item.Cells[1].Controls.Add(l_displayStatus);
                    }
                    else
                    {
                        Label errLbl = new Label();
                        errLbl.Text = " - ";

                        e.Item.Cells[1].Controls.Clear();
                        e.Item.Cells[1].Controls.Add(errLbl);
                    }
                }
                else if (String.Compare(((DataRowView)e.Item.DataItem).Row[0].ToString(), "Subject:", true) == 0)
                {
                    DataGrid dgRegReimb2 = new DataGrid();
                    dgRegReimb2.ID = "innerDgRegReimb";

                    //Format the DataGrid to look cool.
                    dgRegReimb2.BorderWidth = (Unit)0;
                    dgRegReimb2.CellPadding = 4;
                    dgRegReimb2.CellSpacing = 0;
                    dgRegReimb2.GridLines   = GridLines.None;
                    dgRegReimb2.BorderColor = Color.FromName("#E0E0E0");

                    dgRegReimb2.ItemStyle.BackColor            = Color.White;
                    dgRegReimb2.AlternatingItemStyle.BackColor = Color.FromName("LightGray");

                    dgRegReimb2.ShowHeader            = false;
                    dgRegReimb2.HeaderStyle.CssClass  = "fieldLabel";
                    dgRegReimb2.HeaderStyle.BackColor = Color.FromName("#ffff00");
                    dgRegReimb2.AutoGenerateColumns   = false;

                    //****Add a series of BoundColumns****//
                    //***Region Name***//
                    BoundColumn bc = new BoundColumn();
                    //Set the BoundColumn Values
                    bc.DataField = "Description";
                    //bc.HeaderText = "Region(s)";
                    bc.ItemStyle.Wrap     = false;
                    bc.ItemStyle.CssClass = "fieldLabel";
                    dgRegReimb2.Columns.Add(bc);

                    //****End BoundColumns****//
                    DataSet iSet = PE_DAL.GetNCIPLSubjectView(this.PubID);

                    if (iSet != null)
                    {
                        dgRegReimb2.DataSource = iSet;
                        dgRegReimb2.DataBind();
                        ((DataRowView)e.Item.DataItem).Row[0] = "";
                        e.Item.Cells[1].Controls.Clear();
                        e.Item.Cells[1].Controls.Add(dgRegReimb2);
                    }
                    else
                    {
                        Label errLbl = new Label();
                        errLbl.Text = " - ";

                        e.Item.Cells[1].Controls.Clear();
                        e.Item.Cells[1].Controls.Add(errLbl);
                    }
                }
                else if (String.Compare(((DataRowView)e.Item.DataItem).Row[0].ToString(), "Image Stack:", true) == 0)
                {
                    //For Displaying Featured Pub Stacks
                    DataGrid dgStackView = new DataGrid();
                    dgStackView.ID = "innerdgStackView";

                    //Format the DataGrid to look cool.
                    dgStackView.BorderWidth = (Unit)0;
                    dgStackView.CellPadding = 4;
                    dgStackView.CellSpacing = 0;
                    dgStackView.GridLines   = GridLines.None;
                    dgStackView.BorderColor = Color.FromName("#E0E0E0");

                    dgStackView.ItemStyle.BackColor            = Color.White;
                    dgStackView.AlternatingItemStyle.BackColor = Color.FromName("LightGray");

                    dgStackView.ShowHeader            = false;
                    dgStackView.HeaderStyle.CssClass  = "fieldLabel";
                    dgStackView.HeaderStyle.BackColor = Color.FromName("#ffff00");
                    dgStackView.AutoGenerateColumns   = false;

                    //****Add a series of BoundColumns****//
                    //***Region Name***//
                    BoundColumn bc = new BoundColumn();
                    //Set the BoundColumn Values
                    //bc.DataField = "Description";
                    bc.DataField = "stacktitle";
                    //bc.HeaderText = "Region(s)";
                    bc.ItemStyle.Wrap     = false;
                    bc.ItemStyle.CssClass = "fieldLabel";
                    dgStackView.Columns.Add(bc);

                    //****End BoundColumns****//
                    //DataSet iSet = PE_DAL.GetNCIPLStacksView(this.PubID);
                    StackCollection iSet = PE_DAL.GetNCIPLStacksView(this.PubID);

                    //if (iSet != null)
                    if (iSet.Count > 0)
                    {
                        dgStackView.DataSource = iSet;
                        dgStackView.DataBind();
                        ((DataRowView)e.Item.DataItem).Row[0] = "";
                        e.Item.Cells[1].Controls.Clear();
                        e.Item.Cells[1].Controls.Add(dgStackView);
                    }
                    else
                    {
                        Label errLbl = new Label();
                        errLbl.Text = " - ";

                        e.Item.Cells[1].Controls.Clear();
                        e.Item.Cells[1].Controls.Add(errLbl);
                    }
                }
                //NCIPL_CC - Part of changes to have collections on NCIPL tab and ROO tab
                else if (String.Compare(((DataRowView)e.Item.DataItem).Row[0].ToString(), "Collections:", true) == 0)
                {
                    //For Displaying Collections
                    DataGrid dgCollectionsView = new DataGrid();
                    dgCollectionsView.ID = "innerdgCollectionsView";

                    //Format the DataGrid to look cool.
                    dgCollectionsView.BorderWidth = (Unit)0;
                    dgCollectionsView.CellPadding = 4;
                    dgCollectionsView.CellSpacing = 0;
                    dgCollectionsView.GridLines   = GridLines.None;
                    dgCollectionsView.BorderColor = Color.FromName("#E0E0E0");

                    dgCollectionsView.ItemStyle.BackColor            = Color.White;
                    dgCollectionsView.AlternatingItemStyle.BackColor = Color.FromName("LightGray");

                    dgCollectionsView.ShowHeader            = false;
                    dgCollectionsView.HeaderStyle.CssClass  = "fieldLabel";
                    dgCollectionsView.HeaderStyle.BackColor = Color.FromName("#ffff00");
                    dgCollectionsView.AutoGenerateColumns   = false;

                    //****Add a series of BoundColumns****//
                    //***Region Name***//
                    BoundColumn bc = new BoundColumn();
                    //Set the BoundColumn Values
                    //bc.DataField = "Description";
                    bc.DataField = "SeriesName";
                    //bc.HeaderText = "Region(s)";
                    bc.ItemStyle.Wrap     = false;
                    bc.ItemStyle.CssClass = "fieldLabel";
                    dgCollectionsView.Columns.Add(bc);

                    //****End BoundColumns****//
                    //DataSet iSet = PE_DAL.GetNCIPLStacksView(this.PubID);
                    SeriesCollection iSet = PE_DAL.GetCollectionsByInterfaceByPubId("NCIPL", this.PubID);

                    //if (iSet != null)
                    if (iSet.Count > 0)
                    {
                        dgCollectionsView.DataSource = iSet;
                        dgCollectionsView.DataBind();
                        ((DataRowView)e.Item.DataItem).Row[0] = "";
                        e.Item.Cells[1].Controls.Clear();
                        e.Item.Cells[1].Controls.Add(dgCollectionsView);
                    }
                    else
                    {
                        Label errLbl = new Label();
                        errLbl.Text = " - ";

                        e.Item.Cells[1].Controls.Clear();
                        e.Item.Cells[1].Controls.Add(errLbl);
                    }
                }
            }
        }
Exemple #13
0
        protected bool NewVK_LPCreationVal()
        {
            if (this.ProdID.Length > 0 && this.sarr.Length > 0)
            {
                this.NewPubCreateVal();

                string pubid = this.ProdID.Trim();

                List <string> val = PE_DAL.GetProdInt(pubid, System.Convert.ToInt32(this.IsVK));

                string[] selectedInt = new string[this.sarr.Length];
                string[] t_val;

                for (int k = 0; k < sarr.Length; k++)
                {
                    selectedInt[k] = (sarr[k]);
                }

                if (val.Count == 0)
                {
                    Session[DisplayKitPubErrorMsg] =
                        "The Publication you provide does not exist.";
                    return(false);
                }
                else
                {
                    if (System.Convert.ToInt32(val[0]) > 0)
                    {
                        t_val = new string[2];
                        for (int i = 3; i < val.Count; i++)
                        {
                            t_val[i - 3] = val[i];
                        }

                        if (this.containsAny(t_val, selectedInt))
                        {
                            if (this.IsVK)
                            {
                                Session[DisplayKitPubErrorMsg] =
                                    "This Virtual Publication ID already exists for the interface(s) selected.";
                            }
                            else
                            {
                                Session[DisplayKitPubErrorMsg] =
                                    "This Linked Publication ID already exists for the interface(s) selected.";
                            }

                            return(false);
                        }
                        else
                        {
                            return(true);
                        }
                    }
                    else
                    {
                        t_val = new string[4];
                        for (int i = 1; i < val.Count; i++)
                        {
                            t_val[(i - 1)] = val[i];
                        }

                        if (!this.containsAll(t_val, selectedInt))
                        {
                            Session[DisplayKitPubErrorMsg] =
                                "The publication you provide has not been assigned to the interface(s) you selected.";
                            return(false);
                        }
                        else
                        {
                            return(true);
                        }
                    }
                }
            }
            else
            {
                return(false);
            }
        }
Exemple #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!((CustomPrincipal)Context.User).IsInRole(PubEntAdminManager.AdminRole))
            {
                PubEntAdminManager.UnathorizedAccess();
            }

            System.Web.UI.UserControl l_uc;

            l_uc = (System.Web.UI.UserControl) this.LoadControl("UserControl/AdminMenu.ascx");
            this.plcHldMenu.Controls.Clear();
            this.plcHldMenu.Controls.Add(l_uc);

            this.SecVal();

            if (PubEntAdminManager.TamperProof)
            {
                if (this.myUrlBuilder.QueryString.ContainsKey(PubEntAdminManager.strProdID))
                {
                    this.ProdID = (this.myUrlBuilder.QueryString[PubEntAdminManager.strProdID]);
                }

                if (this.myUrlBuilder.QueryString.ContainsKey(PubEntAdminManager.strPubID))
                {
                    this.KitID = System.Convert.ToInt32(this.myUrlBuilder.QueryString[PubEntAdminManager.strPubID]);
                }

                if (this.myUrlBuilder.QueryString.ContainsKey(PubEntAdminManager.strInterface))
                {
                    string s = this.myUrlBuilder.QueryString[PubEntAdminManager.strInterface];
                    if (s.IndexOf(',') < 0)
                    {
                        this.IsNCIPL = (this.myUrlBuilder.QueryString[PubEntAdminManager.strInterface]) == PubEntAdminManager.NCIPL_INTERFACE ? true : false;
                        this.IsROO   = (this.myUrlBuilder.QueryString[PubEntAdminManager.strInterface]) == PubEntAdminManager.ROO_INTERFACE ? true : false;
                    }
                    else
                    {
                        sarr = s.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        foreach (string sstr in sarr)
                        {
                            if (!this.IsNCIPL)
                            {
                                this.IsNCIPL = ((sstr) == PubEntAdminManager.NCIPL_INTERFACE) ? true : false;
                            }

                            if (!this.IsROO)
                            {
                                this.IsROO = ((sstr) == PubEntAdminManager.ROO_INTERFACE) ? true : false;
                            }
                        }
                    }
                }

                if (this.myUrlBuilder.QueryString.ContainsKey(PubEntAdminManager.strVK_LPType))
                {
                    this.IsVK = (this.myUrlBuilder.QueryString[PubEntAdminManager.strVK_LPType]) == PubEntAdminManager.strVKType ? true : false;
                }
            }
            else
            {
                if (Request.QueryString[PubEntAdminManager.strProdID] != null)
                {
                    this.ProdID = (Request.QueryString[PubEntAdminManager.strProdID]);
                }

                if (Request.QueryString[PubEntAdminManager.strPubID] != null)
                {
                    this.KitID = System.Convert.ToInt32(Request.QueryString[PubEntAdminManager.strPubID]);
                }

                if (Request.QueryString[PubEntAdminManager.strInterface] != null)
                {
                    string s = Request.QueryString[PubEntAdminManager.strInterface];
                    if (s.IndexOf(',') < 0)
                    {
                        this.IsNCIPL = (Request.QueryString[PubEntAdminManager.strInterface]) == PubEntAdminManager.NCIPL_INTERFACE ? true : false;
                        this.IsROO   = (Request.QueryString[PubEntAdminManager.strInterface]) == PubEntAdminManager.ROO_INTERFACE ? true : false;

                        sarr = new string[1];

                        if (this.IsNCIPL)
                        {
                            sarr[0] = PubEntAdminManager.NCIPL_INTERFACE;
                        }
                        else if (this.IsROO)
                        {
                            sarr[0] = PubEntAdminManager.ROO_INTERFACE;
                        }
                    }
                    else
                    {
                        sarr = s.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                        foreach (string sstr in sarr)
                        {
                            if (!this.IsNCIPL)
                            {
                                this.IsNCIPL = ((sstr) == PubEntAdminManager.NCIPL_INTERFACE) ? true : false;
                            }

                            if (!this.IsROO)
                            {
                                this.IsROO = ((sstr) == PubEntAdminManager.ROO_INTERFACE) ? true : false;
                            }
                        }
                    }
                }

                if (Request.QueryString[PubEntAdminManager.strVK_LPType] != null)
                {
                    this.IsVK = (Request.QueryString[PubEntAdminManager.strVK_LPType]) == PubEntAdminManager.strVKType ? true : false;
                }
            }

            this.lblInstruction.Text = @"To add a publication to the " + (this.IsVK ? "Virtual Kit" : "Linked Publication") + @", enter the Publication ID then click Save.<br />To remove a publication from the " + (this.IsVK ? "Virtual Kit" : "Linked Publication") + @", select the check box next to the publication title.";

            if (!Page.IsPostBack)
            {
                if (Request.UrlReferrer == null || !Request.UrlReferrer.GetLeftPart(UriPartial.Path).
                    ToLower().Contains("displaykitpub.aspx"))
                {
                    throw new Exception(
                              "Must be invoked by DisplayKitPub.aspx");
                }
                else
                {
                    if (this.KitID == 0)
                    {
                        //validation for prodid, interfaces
                        if (this.NewVK_LPCreationVal())
                        {
                            int oPubID = PE_DAL.SetNewKITPUB(this.ProdID.Trim(), 0,
                                                             System.Convert.ToInt32(IsNCIPLSelected()),
                                                             System.Convert.ToInt32(IsROOSelected()),
                                                             IsNCIPLSelected()? 1: -1,
                                                             IsROOSelected()? 1:-1,
                                                             System.Convert.ToInt32(this.IsVK));

                            if (oPubID > 0)
                            {
                                this.KitID = oPubID;
                            }

                            if (this.IsVK)
                            {
                                Pub l_pub = PE_DAL.GetPubInfoByProdID(this.ProdID.Trim());
                                this.lblTitle.Text = Server.HtmlEncode(l_pub.ShortTitle + "(" + l_pub.ProdID + ")");

                                this.Title = this.lblPageTitle.Text = "Create Virtual Kit";
                                this.BindKitData();
                            }
                            else
                            {
                                this.Title = this.lblPageTitle.Text = "Create Linked Publication";
                                this.BindPubData();
                            }

                            this.lblRemv.Visible = false;
                        }
                        else
                        {
                            this.RejectCrossPagePostBack();
                        }
                    }
                    else
                    {
                        //get the vk/lp details
                        if (this.IsVK)
                        {
                            Pub l_pub = PE_DAL.GetPubInfoByPubID(this.KitID);
                            this.lblTitle.Text = Server.HtmlEncode(l_pub.ShortTitle + "(" + l_pub.ProdID + ")");

                            this.Title = this.lblPageTitle.Text = "Update Virtual Kit";
                            this.BindKitData();
                        }
                        else
                        {
                            this.Title = this.lblPageTitle.Text = "Update Linked Publication";
                            this.BindPubData();
                        }

                        //this.lblRemv.Visible = true;
                    }
                }
            }

            this.txtNewPub.Attributes.Add("onchange", "getPubTitle()");
        }
Exemple #15
0
        public bool Save()
        {
            int  retValueSetProdGenData = 0;
            bool retResult        = false;
            bool retOwner         = true;
            bool retSponsor       = true;
            bool blnOwneractive   = true;
            bool blnSponsoractive = true;
            bool blnLiveInt       = false;

            double l_weight = -1;
            int    l_maxQty = -1;

            //Begin NCIDC
            int maxqty = 0; double weight = 0; int qtyavai = 0; int qtythresh = 0; int bookstatusid = 0;

            if (int.TryParse(txtMaxQtyTile.Text.Trim(), out maxqty))
            {
                if (maxqty > 0)
                {
                    l_maxQty = maxqty;
                }
            }
            if (double.TryParse(txtWeight.Text.Trim(), out weight))
            {
                if (weight > 0)
                {
                    l_weight = weight;
                }
            }
            if (int.TryParse(txtQtyAvai.Text.Trim(), out qtyavai))
            {
                if (qtyavai <= 0)
                {
                    qtyavai = -1;
                }
            }
            else
            {
                qtyavai = -1;
            }
            if (int.TryParse(txtQtyThresh.Text.Trim(), out qtythresh))
            {
                if (qtythresh <= 0)
                {
                    qtythresh = -1;
                }
            }
            else
            {
                qtythresh = -1;
            }
            if (string.Compare(ddlBookStatus.SelectedValue.Trim(), "") != 0)
            {
                if (int.TryParse(ddlBookStatus.SelectedValue.Trim(), out bookstatusid))
                {
                    if (bookstatusid <= 0)
                    {
                        bookstatusid = -1;
                    }
                }
                else
                {
                    bookstatusid = -1;
                }
            }
            else
            {
                bookstatusid = 0; //Special case - remove the assigned bookstatus
            }
            //End NCIDC

            this.SecVal();

            if (this.txtWeight.Visible && this.txtMaxQtyTile.Visible)
            {
                if (this.txtWeight.Text.Trim().Length > 0)
                {
                    l_weight = System.Convert.ToDouble(this.txtWeight.Text.Trim());
                }

                if (this.txtMaxQtyTile.Text.Trim().Length > 0)
                {
                    l_maxQty = System.Convert.ToInt32(this.txtMaxQtyTile.Text.Trim());
                }
            }
            else
            {
                if (this.lblWeight.Text.Trim().Length > 0)
                {
                    l_weight = System.Convert.ToDouble(this.lblWeight.Text.Trim());
                }

                if (this.lblMaxQtyTile.Text.Trim().Length > 0)
                {
                    l_maxQty = System.Convert.ToInt32(this.lblMaxQtyTile.Text.Trim());
                }
            }

            int l_pubid = 0;

            if (Session[PubEntAdminManager.strPubGlobalMode].ToString() !=
                PubEntAdminManager.strPubGlobalAMode)
            {
                l_pubid = this.PubID;
            }

            if (ddlOwner.SelectedValue != "")
            {
                blnOwneractive = PE_DAL.GetOwnerStatusByOwnerID(Convert.ToInt32(ddlOwner.SelectedValue));
            }
            if (ddlSponsor.SelectedValue != "")
            {
                blnSponsoractive = PE_DAL.GetSponsorStatusByOwnerID(Convert.ToInt32(ddlSponsor.SelectedValue));
            }
            //NCIDC if (this.lblBkStatus.Text.Trim() != PubEntAdminManager.strInactivePubs && blnOwneractive == false
            //NCIDC || this.lblBkStatus.Text.Trim() != PubEntAdminManager.strInactivePubs && blnSponsoractive == false)
            if (this.ddlBookStatus.SelectedValue.Trim() != PubEntAdminManager.strInactivePubs && blnOwneractive == false ||
                this.ddlBookStatus.SelectedValue.Trim() != PubEntAdminManager.strInactivePubs && blnSponsoractive == false)
            {
                //NCIDC if (this.lblBkStatus.Text.Trim() != PubEntAdminManager.strInactivePubs && blnOwneractive == false)
                if (this.ddlBookStatus.SelectedValue.Trim() != PubEntAdminManager.strInactivePubs && blnOwneractive == false)
                {
                    lblOwnerEr.Visible = true;
                    lblOwnerEr.Text    = "An active owner name is required.";
                    retResult          = false;
                }
                //NCIDC if (this.lblBkStatus.Text.Trim() != PubEntAdminManager.strInactivePubs && blnSponsoractive == false)
                if (this.ddlBookStatus.SelectedValue.Trim() != PubEntAdminManager.strInactivePubs && blnSponsoractive == false)
                {
                    lblSponsorEr.Visible = true;
                    lblSponsorEr.Text    = "An active sponsor name is required.";
                    retResult            = false;
                }
            }

            else
            {
                PlaceHolder plhLiveInt = (PlaceHolder)this.Parent.FindControl("plcHldLiveInt");
                bool        InNCIPL    = ((LiveIntSel)plhLiveInt.Controls[0]).InNCIPL;
                bool        InROO      = ((LiveIntSel)plhLiveInt.Controls[0]).InROO;
                bool        InExh      = ((LiveIntSel)plhLiveInt.Controls[0]).InExh;
                bool        InCatalog  = ((LiveIntSel)plhLiveInt.Controls[0]).InCatalog;

                blnLiveInt = InNCIPL || InROO || InExh || InCatalog;
                if (blnLiveInt == true && ddlOwner.SelectedValue == "" ||
                    blnLiveInt == true && this.ddlSponsor.SelectedValue == "")
                {
                    lblOwnerEr.Text   = "";
                    lblSponsorEr.Text = "";

                    if (blnLiveInt == true && ddlOwner.SelectedValue == "")
                    {
                        lblOwnerEr.Visible = true;
                        lblOwnerEr.Text    = "An owner name is required.";
                        retResult          = false;
                    }
                    if (blnLiveInt == true && this.ddlSponsor.SelectedValue == "")
                    {
                        lblSponsorEr.Visible = true;
                        lblSponsorEr.Text    = "An sponsor name is required.";
                        retResult            = false;
                    }
                }
                else
                {
                    Regex r = new Regex(@"\s+");
                    retValueSetProdGenData = PE_DAL.SetProdGenData(r.Replace(this.txtCPJNum.Text.Trim(), " "),
                                                                   this.txtShortTitle.Text.Trim(),
                                                                   this.txtLongTitle.Text.Trim(),
                                                                   this.txtFS.Text.Trim().Length > 0 ? this.txtFS.Text.Trim() : null,
                                                                   this.txtSpanishAccentLongTitle.Text.Trim().Length > 0 ? this.txtSpanishAccentLongTitle.Text.Trim() : null,
                                                                   this.txtSpanishNoAccentLongTitle.Text.Trim().Length > 0 ? this.txtSpanishNoAccentLongTitle.Text.Trim() : null,
                                                                   this.txtURL.Text.Trim().Length > 0 ? this.txtURL.Text.Trim() : null,
                                                                   this.txtNerdoURL.Text.Trim().Length > 0 ? this.txtNerdoURL.Text.Trim() : null,
                                                                   this.txtPDFURL.Text.Trim().Length > 0 ? this.txtPDFURL.Text.Trim() : null,
                                                                   this.txtKindleURL.Text.Trim().Length > 0 ? this.txtKindleURL.Text.Trim() : null,
                                                                   this.txtePubURL.Text.Trim().Length > 0 ? this.txtePubURL.Text.Trim() : null,
                                                                   this.txtPrintFileURL.Text.Trim().Length > 0 ? this.txtPrintFileURL.Text.Trim() : null,
                                                                   l_maxQty, l_weight,
                                                                   qtyavai, qtythresh, bookstatusid,
                                                                   ref l_pubid);

                    if (this.ddlOwner.SelectedValue.ToString() != "")
                    {
                        retOwner = PE_DAL.SetOwnerByPubID(l_pubid, Convert.ToInt32(this.ddlOwner.SelectedValue));
                    }
                    else
                    {
                        PE_DAL.DeleteOwnerByPubID(l_pubid);
                    }

                    if (this.ddlSponsor.SelectedValue.ToString() != "")
                    {
                        retSponsor = PE_DAL.SetSponsorByPubID(l_pubid, Convert.ToInt32(this.ddlSponsor.SelectedValue));
                    }
                    else
                    {
                        PE_DAL.DeleteSponsorByPubID(l_pubid);
                    }


                    if (Session[PubEntAdminManager.strPubGlobalMode].ToString() ==
                        PubEntAdminManager.strPubGlobalAMode)
                    {
                        if (retValueSetProdGenData > 0 && retOwner && retSponsor)
                        {
                            this.PubID = l_pubid;
                            retResult  = true;
                        }
                        else if (retValueSetProdGenData == 0 || retValueSetProdGenData == -1)
                        {
                            if (l_pubid == 0)
                            {
                                Session[PubEntAdminManager.strGlobalMsg] = "The publication already existed.";
                            }
                            else if (l_pubid == -1)
                            {
                                Session[PubEntAdminManager.strGlobalMsg] = "Error occurs.";
                            }
                            retResult = false;
                        }
                    }
                    else
                    {
                        if (retValueSetProdGenData > 0)
                        {
                            retResult = true;
                        }

                        else if (retValueSetProdGenData == -1)
                        {
                            retResult = false;
                        }
                    }
                }
            }
            return(retResult);
        }
Exemple #16
0
 protected void BindDataVK_LP(bool isVK)
 {
     this.gvResult.DataSource   = PE_DAL.GetALLVK_LP(isVK);
     this.gvResult.DataKeyField = "PubID";
     this.gvResult.DataBind();
 }
Exemple #17
0
 public static OrderCollection GetRepeatOrders(string s)
 {
     return(PE_DAL.GetRepeatOrders(s));
 }
Exemple #18
0
 public static Order GetOrderByOrderID(int orderid)
 {
     return(PE_DAL.GetOrderByOrderID(orderid));
 }
        protected void BindData(string PubIDs)
        {
            this.mySearch = ((Search)Session[PubEntAdminManager.strSearchCriteria]);
            //this.mySearch.ClearPubId();

            List <Pub> l_listPub = PE_DAL.AdminDoSearchByPubID(PubIDs,
                                                               this.SortExpression == String.Empty ? PubEntAdminManager.strDefaultSearchSorting : this.SortExpression, System.Convert.ToInt32(this.SortAscending));

            //this.lblTotalResCnt.Text = l_listPub.Count.ToString();
            //this.gvResult.DataSource = l_listPub;
            //this.gvResult.DataBind();

            if (l_listPub.Count == 1)
            {
                if (this.Export)
                {
                    this.RemColumnHeadersSortedImg();
                    this.gvResult.DataSource = l_listPub;
                    this.gvResult.DataBind();
                }
                else
                {
                    this.mySearch.ClearPubId();
                    this.mySearch.AddPubId(l_listPub[0].PubID);
                    Session[PubEntAdminManager.strSearchCriteria] = this.mySearch;

                    //go directly to pubrecord page
                    if (PubEntAdminManager.TamperProof)
                    {
                        PubEntAdminManager.RedirectEncodedURLWithQS("PubRecord.aspx", "mode=view&pubid=" + l_listPub[0].PubID.ToString());
                    }
                    else
                    {
                        Response.Redirect("PubRecord.aspx?mode=view&pubid=" + l_listPub[0].PubID.ToString(), true);
                    }
                }
            }
            else
            {
                this.lblTotalResCnt.Text = l_listPub.Count.ToString();

                if (!this.Export)
                {
                    this.mySearch.ClearPubId();
                    //Update the column headers
                    UpdateColumnHeaders();
                }
                else
                {
                    this.RemColumnHeadersSortedImg();
                }

                this.gvResult.DataSource = l_listPub;
                this.gvResult.DataBind();

                if (l_listPub.Count == 0)
                {
                    this.trTopCtrlPnl.Visible   = this.trBtmCtrlPnl.Visible = false;
                    this.gvResult.Visible       = false;
                    this.hyplnkRefSrch2.Visible = this.hyplnkSrch2.Visible = false;
                }
            }

            Session[PubEntAdminManager.strSearchCriteria] = this.mySearch;
        }
Exemple #20
0
 public static void ReleaseOrder(int orderid, string who, out string returnmsg)
 {
     PE_DAL.ReleaseOrder(orderid, who, out returnmsg);
 }
Exemple #21
0
 public static bool SetRace(int pubid, string selectedValue, char delim)
 {
     return(PE_DAL.SetRaceByPubID(pubid, selectedValue, delim));
 }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            int _orderid = Int32.Parse(txtOrderNum.Text);
            ProductCollection col;

            Order o = PubEntAdmin.BLL.Order.GetOrderByOrderID(_orderid);

            o = PubEntAdmin.BLL.Order.GetOrderByOrderID(_orderid);

            if (o != null)
            {
                lblSearchMsg.Text         = "";
                legend1.InnerText         = "Order " + _orderid;
                btnDelete.CommandArgument = _orderid.ToString();

                //***EAC lets bind the detail grid first
                col = PE_DAL.GetOrderDetails(_orderid);
                bGrid.DataSource = col;
                bGrid.DataBind();

                bOrderID.Text    = o.OrderId.ToString();
                bCreated.Text    = o.DateCreated.ToString("MM/dd/yyy hh:mm");
                bName.Text       = o.ShipTo.Fullname;
                bOrg.Text        = o.ShipTo.Organization;
                bAddr1.Text      = o.ShipTo.Addr1;
                bAddr2.Text      = o.ShipTo.Addr2;
                bZip.Text        = o.ShipTo.Zip5;
                bCity.Text       = o.ShipTo.City;
                bState.Text      = o.ShipTo.State;
                bPhone.Text      = o.ShipTo.Phone;
                bEmail.Text      = o.ShipTo.Email;
                bShipmethod.Text = o.ShipMethod;
                bComment.Text    = o.OrderComment;

                if (o.TermCode == "")
                {
                    btnDelete.Enabled = txtReason.Enabled = true;
                    lblMessage.Text   = "";
                }
                else
                {
                    btnDelete.Enabled = txtReason.Enabled = false;
                    lblMessage.Text   = "This order is not in PENDING status.";
                }
            }
            else
            {
                //not found or other problem
                lblSearchMsg.Text = "Cannot find order number " + _orderid.ToString();

                bOrderID.Text    = "";
                bCreated.Text    = "";
                bName.Text       = "";
                bOrg.Text        = "";
                bAddr1.Text      = "";
                bAddr2.Text      = "";
                bZip.Text        = "";
                bCity.Text       = "";
                bState.Text      = "";
                bPhone.Text      = "";
                bEmail.Text      = "";
                bShipmethod.Text = "";
                bComment.Text    = "";

                btnDelete.Enabled = false;
            }
        }