Beispiel #1
0
 protected void setModalWindow(object sender, EventArgs e)
 {
     popupPanelJournal.Visible   = true;
     popGridJournal.DataSourceID = "SqlDataSourceJournal";
     SqlDataSourceJournal.DataBind();
     popGridJournal.DataBind();
 }
    protected void searchclick(object sender, EventArgs e)
    {
        //if (!Page.IsValid)
        //{
        //    return;
        //}

        GridViewJournalSearch.Visible = true;
        if (DropDownListCategory.SelectedValue != "A")
        {
            if (TextYear.Text != "")
            {
                SqlDataSourceJournal.SelectParameters.Clear();
                SqlDataSourceJournal.SelectParameters.Add("JournalCategory", DropDownListCategory.SelectedValue);
                SqlDataSourceJournal.SelectParameters.Add("Year", TextYear.Text.Trim());

                SqlDataSourceJournal.SelectCommand = "select k.Id as ISSN,Title,AbbreviatedTitle,ImpactFactor,fiveImpFact,Comments,Year from Journal_M k   LEFT join Journal_IF_Details j on j.id=k.Id  WHERE JournalCategory=@JournalCategory and Year= @Year";
            }
            else
            {
                SqlDataSourceJournal.SelectParameters.Clear();
                SqlDataSourceJournal.SelectParameters.Add("JournalCategory", DropDownListCategory.SelectedValue);
                SqlDataSourceJournal.SelectCommand = "select k.Id as ISSN,Title,AbbreviatedTitle,ImpactFactor,fiveImpFact,Comments,Year from Journal_M k   LEFT join Journal_IF_Details j on j.id=k.Id  WHERE JournalCategory=@JournalCategory";
            }
        }
        else
        {
            if (TextYear.Text != "")
            {
                SqlDataSourceJournal.SelectParameters.Clear();
                SqlDataSourceJournal.SelectParameters.Add("Year", TextYear.Text.Trim());
                SqlDataSourceJournal.SelectCommand = "select k.Id as ISSN,Title,AbbreviatedTitle,ImpactFactor,fiveImpFact,Comments,Year from Journal_M k   LEFT join Journal_IF_Details j on j.id=k.Id WHERE Year=@Year";
            }
            else
            {
                SqlDataSourceJournal.SelectCommand = "select k.Id as ISSN,Title,AbbreviatedTitle,ImpactFactor,fiveImpFact,Comments,Year from Journal_M k   LEFT join Journal_IF_Details j on j.id=k.Id  ";
            }
        }
        SqlDataSourceJournal.DataBind();
        GridViewJournalSearch.DataBind();
    }
Beispiel #3
0
    protected void searchclick(object sender, EventArgs e)
    {
        //if (!Page.IsValid)
        //{
        //    return;
        //}
        try
        {
            GridViewJournalSearch.Visible = true;
            if (dropdownCategory.SelectedValue != " ")
            {
                if (txtJid.Text != "")
                {
                    SqlDataSourceJournal.SelectParameters.Clear();
                    SqlDataSourceJournal.SelectParameters.Add("Id", txtJid.Text.Trim());
                    SqlDataSourceJournal.SelectParameters.Add("JournalCategory", dropdownCategory.SelectedValue);

                    SqlDataSourceJournal.SelectCommand = "select k.Id as ISSN,Year,Title,AbbreviatedTitle,ImpactFactor,fiveImpFact,JournalCategory,Comments from Journal_M k   LEFT join Journal_IF_Details j on j.id=k.Id   where j.Id=@Id and JournalCategory=@JournalCategory";
                }
                //else if (TextYear.Text == "" && txtJid.Text != "")
                //{
                //    SqlDataSourceJournal.SelectCommand = "select j.Id as Id,Year,Title,AbbreviatedTitle,ImpactFactor,fiveImpFact,Comments from Journal_IF_Details j,Journal_M k where j.Id=k.Id and j.Id='" + txtJid.Text.Trim() + "'";
                //}
                else if (txtJid.Text == "")
                {
                    SqlDataSourceJournal.SelectParameters.Clear();
                    SqlDataSourceJournal.SelectParameters.Add("JournalCategory", dropdownCategory.SelectedValue);
                    SqlDataSourceJournal.SelectCommand = "select k.Id as ISSN,Year,Title,AbbreviatedTitle,ImpactFactor,fiveImpFact,JournalCategory,Comments from Journal_M k   LEFT join Journal_IF_Details j on j.id=k.Id  where   JournalCategory=@JournalCategory";
                }
            }
            else
            {
                if (txtJid.Text != "")
                {
                    SqlDataSourceJournal.SelectParameters.Clear();
                    SqlDataSourceJournal.SelectParameters.Add("Id", txtJid.Text.Trim());
                    SqlDataSourceJournal.SelectCommand = "select k.Id as ISSN,Year,Title,AbbreviatedTitle,ImpactFactor,fiveImpFact,JournalCategory,Comments from Journal_M k   LEFT join Journal_IF_Details j on j.id=k.Id   where j.Id=@Id";
                }
                //else if (TextYear.Text == "" && txtJid.Text != "")
                //{
                //    SqlDataSourceJournal.SelectCommand = "select j.Id as Id,Year,Title,AbbreviatedTitle,ImpactFactor,fiveImpFact,Comments from Journal_IF_Details j,Journal_M k where j.Id=k.Id and j.Id='" + txtJid.Text.Trim() + "'";
                //}
                else if (txtJid.Text == "")
                {
                    SqlDataSourceJournal.SelectCommand = "   select k.Id as ISSN,Year,Title,AbbreviatedTitle,ImpactFactor,fiveImpFact,JournalCategory,Comments from Journal_M k   LEFT join Journal_IF_Details j on j.id=k.Id ";
                }
            }
            //else
            //{
            //    SqlDataSourceJournal.SelectCommand = "select j.Id as Id,Year,Title,AbbreviatedTitle,ImpactFactor,fiveImpFact,Comments from Journal_IF_Details j,Journal_M k where j.Id=k.Id ";
            //}
            SqlDataSourceJournal.DataBind();
            GridViewJournalSearch.DataBind();
        }
        catch (Exception ex)
        {
            log.Error(ex.StackTrace);
            log.Error(ex.Message);
            ClientScript.RegisterStartupScript(Page.GetType(), "validation1", "<script language='javascript'>alert('Error!!!!!!!!!!!!!!!')</script>");
        }
    }