Ejemplo n.º 1
0
    private void GetDowonloadsByEvents(string searchField)
    {
        Session["Alphabet"]              = null;
        Session["SearchByEvents"]        = null;
        Session["SearchByDownloadTypes"] = null;
        Session["SearchField"]           = null;

        DataTable    dt  = new DataTable();
        DownloadsBll obj = new DownloadsBll();

        obj.EventName = searchField;
        dt            = obj.GetDownloadsByEventType();
        if (dt.Rows.Count > 0)
        {
            lblMsg.Visible        = false;
            RadGrid1.Visible      = true;
            RadGrid1.DataSourceID = string.Empty;
            RadGrid1.DataSource   = dt;
            RadGrid1.Rebind();
        }
        else
        {
            lblMsg.Visible   = true;
            RadGrid1.Visible = false;
        }
    }
Ejemplo n.º 2
0
    private void SearchByAlphabet(string name)
    {
        Session["Alphabet"]              = name;
        Session["SearchByEvents"]        = null;
        Session["SearchByDownloadTypes"] = null;
        Session["SearchField"]           = null;

        DataTable    dt  = new DataTable();
        DownloadsBll obj = new DownloadsBll();

        obj.Title = name;
        dt        = obj.SearchDownloadsByAlphabet();

        if (dt.Rows.Count > 0)
        {
            lblMsg.Visible        = false;
            RadGrid1.Visible      = true;
            RadGrid1.DataSourceID = string.Empty;
            RadGrid1.DataSource   = dt;
            RadGrid1.Rebind();
        }
        else
        {
            lblMsg.Visible   = true;
            RadGrid1.Visible = false;
        }
    }
Ejemplo n.º 3
0
 protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
 {
     if (e.CommandName == "Delete")
     {
         string       i   = e.CommandArgument.ToString();
         int          id  = int.Parse(i.ToString());
         DownloadsBll obj = new DownloadsBll();
         obj.Id = id;
         if (obj.DeleteDownloads() > 0)
         {
             RadGrid1.DataBind();
         }
     }
 }
Ejemplo n.º 4
0
    private void GetDownloads(int id)
    {
        DownloadsBll obj = new DownloadsBll();

        obj.Id = id;

        DataTable dt = new DataTable();

        dt = obj.GetDownloadsById();
        if (dt.Rows.Count > 0)
        {
            string downloadType = dt.Rows[0]["download_type"].ToString();
            if (downloadType == "Powerpoints")
            {
                rbtnDownloadType.SelectedIndex = 0;
            }

            if (downloadType == "Documents")
            {
                rbtnDownloadType.SelectedIndex = 1;
            }

            if (downloadType == "Manuals")
            {
                rbtnDownloadType.SelectedIndex = 2;
            }

            event_date.DbSelectedDate = DateTime.Parse(dt.Rows[0]["event_date"].ToString());
            txtEventName.Text         = dt.Rows[0]["event_name"].ToString();
            txtTitle.Text             = dt.Rows[0]["title"].ToString();
            txtAuthor.Text            = dt.Rows[0]["author"].ToString();

            string file = dt.Rows[0]["file_name"].ToString();
            if (file != "")
            {
                Session["DownloadedFile"] = file;
            }

            //lblFileSize.Text = dt.Rows[0]["file_size"].ToString();

            //string section = dt.Rows[0]["presented_at"].ToString();
            //if (section == "PrePets")
            //    rbtnPresentedAt.SelectedIndex = 0;
            //if (section == "SOTS")
            //    rbtnPresentedAt.SelectedIndex = 1;
        }
    }
Ejemplo n.º 5
0
    private void SearchByDownloadTypes(string strEvent)
    {
        DataTable    dt  = new DataTable();
        DownloadsBll obj = new DownloadsBll();

        obj.DownloadType = strEvent;
        dt = obj.GetDownloadsByDownloadsType();
        if (dt.Rows.Count > 0)
        {
            lblMsg.Visible        = false;
            RadGrid1.Visible      = true;
            RadGrid1.DataSourceID = string.Empty;
            RadGrid1.DataSource   = dt;
            RadGrid1.Rebind();
        }
        else
        {
            lblMsg.Visible   = true;
            RadGrid1.Visible = false;
        }
    }
Ejemplo n.º 6
0
    private void BindGrid()
    {
        Session["Alphabet"]              = null;
        Session["SearchByEvents"]        = null;
        Session["SearchByDownloadTypes"] = null;
        Session["SearchField"]           = null;

        DataTable    dt  = new DataTable();
        DownloadsBll obj = new DownloadsBll();

        dt = obj.GetDownloads();
        if (dt.Rows.Count > 0)
        {
            lblMsg.Visible      = false;
            RadGrid1.Visible    = true;
            RadGrid1.DataSource = dt;
            RadGrid1.DataBind();
        }
        else
        {
            lblMsg.Visible   = true;
            RadGrid1.Visible = false;
        }
    }