using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;


using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;
using System.Collections.Generic;


public partial class Admin_ManagePledges : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Utility.IsNull(Session["Admin"]))
        {
            Response.Redirect("~/Home.aspx");
        }


        dsPledges.ConnectionString = ConfigurationManager.ConnectionStrings["SabrinContent"].ToString();
    }

    protected void btnAdd_Click(object sender, EventArgs e)
    {
    }

    protected void btnExcel_Click(object sender, EventArgs e)
    {
        //SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["SabrinContent"].ToString());
        //cn.Open();
        //SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM Pledges", cn);
        //DataTable dt = new DataTable();
        //da.Fill(dt);
        //cn.Close();

        //Response.Clear();
        //Response.ContentType = "application/vnd.ms-excel";
        //Response.Headers.Add("content-disposition", "attachment; filename=Pledges.xls");
        //string sep = "";
        //foreach (DataColumn dc in dt.Columns)
        //{
        //    Response.Write(sep + dc.ColumnName);
        //    sep = "\t";
        //}
        //Response.Write("\n");

        //int i;
        //foreach (DataRow dr in dt.Rows)
        //{
        //    sep = "";
        //    for (i = 0; i < dt.Columns.Count; i++)
        //    {
        //        Response.Write(sep + dr[i].ToString());
        //        sep = "\t";
        //    }
        //    Response.Write("\n");
        //}
        //Response.End(); 
    }



}
