Пример #1
0
        protected void saveAsNewButton_Click( object sender, EventArgs e )
        {
            BHLProvider bp = new BHLProvider();

            if ( validate() )
            {
                if ( codeTextBox.Text.Trim().Length == 0 )
                {
                    errorControl.AddErrorText( "Please include a unique institution code before saving" );
                    errorControl.Visible = true;
                    return;
                }
                else
                {
                    CustomGenericList<Institution> institutions = bp.InstituationSelectAll();
                    string code = codeTextBox.Text.Trim().ToUpper();
                    foreach ( Institution inst in institutions )
                    {
                        if ( inst.InstitutionCode.ToUpper().Equals( code ) )
                        {
                            errorControl.AddErrorText( "The institution code " + inst.InstitutionCode.ToUpper() +
                                " is not a unique code, please use another one." );
                            errorControl.Visible = true;
                            return;
                        }
                    }
                }

                Institution institution = new Institution( codeTextBox.Text.Trim().ToUpper(), nameTextBox.Text.Trim(),
                    noteTextBox.Text.Trim(), urlTextBox.Text.Trim(), chkIsMemberLibrary.Checked );

                institution.IsNew = true;

                bp.SaveInstitution( institution );
            }
            else
            {
                return;
            }

            Response.Redirect( "/Admin/Dashboard.aspx" );
        }
Пример #2
0
        protected void Page_Load( object sender, EventArgs e )
        {
            HtmlLink cssLnk = new HtmlLink();
            cssLnk.Attributes.Add("rel", "stylesheet");
            cssLnk.Attributes.Add("type", "text/css");
            cssLnk.Href = "http://jqueryui.com/latest/themes/base/ui.all.css";
            Page.Header.Controls.Add(cssLnk);
            ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js");
            ControlGenerator.AddScriptControl(Page.Master.Page.Header.Controls, "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.js");

            if (IsPostBack)
            {
                if ( ViewState[ "SearchCriteria" ] != null )
                {
                    _searchCriteria = (TitleSearchCriteria)ViewState[ "SearchCriteria" ];
                    _isExactSearch = (bool)ViewState[ "IsExactSearch" ];
                    _orderBy = (TitleSearchOrderBy)ViewState[ "OrderBy" ];
                    _sortOrder = (SortOrder)ViewState[ "SortOrder" ];
                }
                pagingUserControl.Visible = true;
            }
            else
            {
                pagingUserControl.Visible = false;

                BHLProvider bp = new BHLProvider();

                CustomGenericList<Institution> institutions = bp.InstituationSelectAll();

                listInstitutions.DataSource = institutions;
                listInstitutions.DataBind();
            }

            String redirect = Request.QueryString["redir"] as String;
            if (redirect != null)
            {
                if (redirect.ToLower() == "p")
                {
                    litHeader.Text = "Pagination";
                    liImport.Visible = false;
                    divImport.Visible = false;
                    HyperLinkField linkField = (HyperLinkField)gvwResults.Columns[2];
                    linkField.NavigateUrl = "/Admin/Paginator.aspx";
                    linkField.DataNavigateUrlFormatString = "/Admin/Paginator.aspx?TitleID={0}";
                    _redirectUrl = "/Admin/Paginator.aspx?TitleID=";
                }
            }

            errorControl.Visible = false;
            Page.SetFocus( titleTextBox );
            Page.Title = "BHL Admin - Title Search";
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string institutionName = String.Empty;
            bool showMonthly = false;
            BHLProvider provider = new BHLProvider();

            if (!this.IsPostBack)
            {
                CustomGenericList<Institution> institutions = provider.InstituationSelectAll();
                foreach (Institution institution in institutions)
                {
                    ddlInstitutions.Items.Add(new ListItem(institution.InstitutionName, institution.InstitutionName));
                }
            }

            institutionName = ddlInstitutions.SelectedValue;
            showMonthly = chkShowMonthly.Checked;

            if (showMonthly)
            {
                gvProductionTitlesByMonth.DataSource = provider.MonthlyStatsSelectByStatType("Titles Created", institutionName, showMonthly);
                gvProductionItemsByMonth.DataSource = provider.MonthlyStatsSelectByStatType("Items Created", institutionName, showMonthly);
                gvScannedItemsByMonth.DataSource = provider.MonthlyStatsSelectByStatType("Items Scanned", institutionName, showMonthly);
                gvProductionPagesByMonth.DataSource = provider.MonthlyStatsSelectByStatType("Pages Created", institutionName, showMonthly);
                gvProductionNamesByMonth.DataSource = provider.MonthlyStatsSelectByStatType("PageNames Created", institutionName, showMonthly);
                gvProductionTitlesByMonth.DataBind();
                gvProductionItemsByMonth.DataBind();
                gvScannedItemsByMonth.DataBind();
                gvProductionPagesByMonth.DataBind();
                gvProductionNamesByMonth.DataBind();
            }
            else
            {
                gvProductionTitles.DataSource = provider.MonthlyStatsSelectByStatType("Titles Created", institutionName, showMonthly);
                gvProductionItems.DataSource = provider.MonthlyStatsSelectByStatType("Items Created", institutionName, showMonthly);
                gvScannedItems.DataSource = provider.MonthlyStatsSelectByStatType("Items Scanned", institutionName, showMonthly);
                gvProductionPages.DataSource = provider.MonthlyStatsSelectByStatType("Pages Created", institutionName, showMonthly);
                gvProductionNames.DataSource = provider.MonthlyStatsSelectByStatType("PageNames Created", institutionName, showMonthly);
                gvProductionTitles.DataBind();
                gvProductionItems.DataBind();
                gvScannedItems.DataBind();
                gvProductionPages.DataBind();
                gvProductionNames.DataBind();
            }
        }
Пример #4
0
        private void fillCombos()
        {
            BHLProvider bp = new BHLProvider();
            CustomGenericList<Institution> institutions = bp.InstituationSelectAll();

            Institution emptyInstitution = new Institution();
            emptyInstitution.InstitutionCode = "";
            emptyInstitution.InstitutionName = "";
            institutions.Insert(0, emptyInstitution);

            ddlInst.DataSource = institutions;
            ddlInst.DataTextField = "InstitutionName";
            ddlInst.DataValueField = "InstitutionCode";
            ddlInst.DataBind();

            CustomGenericList<Language> languages = bp.LanguageSelectAll();

            Language emptyLanguage = new Language();
            emptyLanguage.LanguageCode = "";
            emptyLanguage.LanguageName = "";
            languages.Insert( 0, emptyLanguage );

            ddlLang.DataSource = languages;
            ddlLang.DataTextField = "LanguageName";
            ddlLang.DataValueField = "LanguageCode";
            ddlLang.DataBind();

            CustomGenericList<Vault> vaults = bp.VaultSelectAll();

            Vault emptyVault = new Vault();
            emptyVault.VaultID = 0;
            emptyVault.Description = "";
            vaults.Insert( 0, emptyVault );

            ddlVault.DataSource = vaults;
            ddlVault.DataTextField = "Description";
            ddlVault.DataValueField = "VaultID";
            ddlVault.DataBind();

            CustomGenericList<ItemStatus> itemStatuses = bp.ItemStatusSelectAll();

            ddlItemStatus.DataSource = itemStatuses;
            ddlItemStatus.DataTextField = "ItemStatusName";
            ddlItemStatus.DataValueField = "ItemStatusID";
            ddlItemStatus.DataBind();
        }
Пример #5
0
        private void fillInstitutions()
        {
            BHLProvider bp = new BHLProvider();
            CustomGenericList<Institution> institutions = bp.InstituationSelectAll();

            Institution emptyInstitution = new Institution();
            emptyInstitution.InstitutionCode = "";
            emptyInstitution.InstitutionName = "";
            institutions.Insert( 0, emptyInstitution );

            ddlInstitutions.DataSource = institutions;
            ddlInstitutions.DataTextField = "InstitutionName";
            ddlInstitutions.DataValueField = "InstitutionCode";
            ddlInstitutions.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BHLProvider bp = new BHLProvider();

                CustomGenericList<Institution> institutions = bp.InstituationSelectAll();

                Institution emptyInstitution = new Institution();
                emptyInstitution.InstitutionName = "(select institution)";
                emptyInstitution.InstitutionCode = "";
                institutions.Insert(0, emptyInstitution);
                listInstitutions.DataSource = institutions;
                listInstitutions.DataBind();
            }
            else
            {
                spanTitle.Visible = chkTitle.Checked;
                spanSubject.Visible = chkSubject.Checked;
                spanAssociation.Visible = chkAssociation.Checked;
                spanCreator.Visible = chkCreator.Checked;
                spanItem.Visible = chkItem.Checked;
            }

            Page.SetFocus(listInstitutions);
            Page.Title = "BHL Admin - Character Encoding Problems";
        }