Exemplo n.º 1
0
    protected void btnLPSave_Click(object sender, EventArgs e)
    {
        int active = 0;
        if (chkActive.Checked == true)
            active = 1;
        if (string.IsNullOrEmpty(lblFestivalEdit.Text))
        {
            int a = 0;
            FestivalBAL fs = new FestivalBAL();
            a = fs.SaveFestival(txtFestivalName.Text, ddlSpotName.SelectedItem.Text, txtDescription.Text, ddlMonth.SelectedItem.Text, txtDuration.Text, ddlSpotName.SelectedValue.ToString(), active);

            if (a != 0)
                Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Festival Details Added.');location='AddFestivalDetails.aspx'", true);
            Clear();
            FetchDetails();
        }
        else
        {
            int a = 0;
            FestivalBAL fs = new FestivalBAL();
            a = fs.UpdateFestival(lblFestivalEdit.Text, txtFestivalName.Text, ddlSpotName.SelectedItem.Text, txtDescription.Text, ddlMonth.SelectedItem.Text, txtDuration.Text, ddlSpotName.SelectedValue.ToString(), active);

            if (a != 0)
                Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Festival Details updated.');location='AddFestivalDetails.aspx'", true);
            Clear();
            FetchDetails();
        }
    }
Exemplo n.º 2
0
    protected void btnLPSave_Click(object sender, EventArgs e)
    {
        int active = 0;

        if (chkActive.Checked == true)
        {
            active = 1;
        }
        if (string.IsNullOrEmpty(lblFestivalEdit.Text))
        {
            int         a  = 0;
            FestivalBAL fs = new FestivalBAL();
            a = fs.SaveFestival(txtFestivalName.Text, ddlSpotName.SelectedItem.Text, txtDescription.Text, ddlMonth.SelectedItem.Text, txtDuration.Text, ddlSpotName.SelectedValue.ToString(), active);

            if (a != 0)
            {
                Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Festival Details Added.');location='AddFestivalDetails.aspx'", true);
            }
            Clear();
            FetchDetails();
        }
        else
        {
            int         a  = 0;
            FestivalBAL fs = new FestivalBAL();
            a = fs.UpdateFestival(lblFestivalEdit.Text, txtFestivalName.Text, ddlSpotName.SelectedItem.Text, txtDescription.Text, ddlMonth.SelectedItem.Text, txtDuration.Text, ddlSpotName.SelectedValue.ToString(), active);

            if (a != 0)
            {
                Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Festival Details updated.');location='AddFestivalDetails.aspx'", true);
            }
            Clear();
            FetchDetails();
        }
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Cache.SetNoStore();
        if (!IsPostBack)
        {
            #region Fetch Grid Page Size Details...
            DataTable  pg = new DataTable();
            GeneralBAL gl = new GeneralBAL();
            pg = gl.FetchGridPageSize();
            if (pg.Rows.Count != 0 && pg.Rows[0][1].ToString() != string.Empty)
            {
                grdFestival.PageSize = Convert.ToInt32(pg.Rows[0][1].ToString());
            }
            #endregion

            FestivalBAL fs = new FestivalBAL();
            ds = fs.FetchFestival1();

            ddlSpotName.DataSource     = ds.Tables[1];
            ddlSpotName.DataTextField  = "SpotName";
            ddlSpotName.DataValueField = "SpotID";
            ddlSpotName.DataBind();
            ddlSpotName.Items.Insert(0, "Select");

            grdFestival.DataSource = ds.Tables[0];
            grdFestival.DataBind();
        }
    }
Exemplo n.º 4
0
 protected void gridPageChanging(object sender, GridViewPageEventArgs e)
 {
     FestivalBAL fs = new FestivalBAL();
     ds = fs.FetchFestival1();
     grdFestival.DataSource = ds.Tables[0];
     grdFestival.PageIndex = e.NewPageIndex;
     grdFestival.DataBind();
 }
Exemplo n.º 5
0
    private void FetchDetails()
    {
        FestivalBAL fs = new FestivalBAL();

        ds = fs.FetchFestival();

        grdFestival.DataSource = ds.Tables[0];
        grdFestival.DataBind();
    }
Exemplo n.º 6
0
    protected void gridPageChanging(object sender, GridViewPageEventArgs e)
    {
        FestivalBAL fs = new FestivalBAL();

        ds = fs.FetchFestival1();
        grdFestival.DataSource = ds.Tables[0];
        grdFestival.PageIndex  = e.NewPageIndex;
        grdFestival.DataBind();
    }
Exemplo n.º 7
0
    protected void btnLPDelete_Click(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(lblFestivalEdit.Text))
        {
            int a = 0;
            FestivalBAL fs = new FestivalBAL();
            a = fs.DeleteFestivalDetails(lblFestivalEdit.Text);

            if (a != 0)
                Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Festival Details Deleted.');location='AddFestivalDetails.aspx'", true);
            Clear();
            FetchDetails();
        }
        else
            Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Select Festival Details to Delete.');location='AddFestivalDetails.aspx'", true);
    }
Exemplo n.º 8
0
 protected void ddlSearchCategory_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlSearchCategory.SelectedItem.Text != "Select")
     {
         ddlSearchCategory1.Enabled = true;
     }
     else
     {
         ddlSearchCategory1.SelectedIndex = 0;
         ddlSearchCategory1.Enabled       = false;
         // fetch value of the grid details....
         DataSet     ds1 = new DataSet();
         FestivalBAL fs  = new FestivalBAL();
         ds1 = fs.FetchFestival();
         grdFestival.DataSource = ds1.Tables[0];
         grdFestival.DataBind();
         //End fetch value of the grid details....
     }
 }
Exemplo n.º 9
0
    protected void btnLPDelete_Click(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(lblFestivalEdit.Text))
        {
            int         a  = 0;
            FestivalBAL fs = new FestivalBAL();
            a = fs.DeleteFestivalDetails(lblFestivalEdit.Text);

            if (a != 0)
            {
                Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Festival Details Deleted.');location='AddFestivalDetails.aspx'", true);
            }
            Clear();
            FetchDetails();
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Select Festival Details to Delete.');location='AddFestivalDetails.aspx'", true);
        }
    }
Exemplo n.º 10
0
 protected void gridPageChanging(object sender, GridViewPageEventArgs e)
 {
     if (ddlSearchCategory.SelectedItem.Text == "Select" & ddlSearchCategory1.SelectedItem.Text == "Select")
     {
         DataSet     ds1 = new DataSet();
         FestivalBAL fs  = new FestivalBAL();
         ds1 = fs.FetchFestival();
         grdFestival.DataSource = ds1.Tables[0];
         grdFestival.PageIndex  = e.NewPageIndex;
         grdFestival.DataBind();
     }
     else
     {
         DataTable  ds = new DataTable();
         GeneralBAL lp = new GeneralBAL();
         ds = lp.FetchFestivalGridDetails(ddlSearchCategory1.SelectedItem.Text);
         grdFestival.DataSource = ds;
         grdFestival.PageIndex  = e.NewPageIndex;
         grdFestival.DataBind();
     }
 }
Exemplo n.º 11
0
    protected void Gridview_OnRowCommand(object sender, GridViewCommandEventArgs e)
    {
        string _commandName;

        if (e.CommandArgument.ToString() == "Next" || e.CommandArgument.ToString() == "Last" || e.CommandArgument.ToString() == "First" || e.CommandArgument.ToString() == "Prev")
        {
        }
        else
        {
            // Get the selected index and the command name
            int _selectedIndex = int.Parse(e.CommandArgument.ToString());

            _commandName = e.CommandName;
            if (_commandName == "fesedit")
            {
                Label       lpid        = (Label)grdFestival.Rows[_selectedIndex].Cells[0].FindControl("lblGridFesId");
                DataTable   editdetails = new DataTable();
                FestivalBAL fs          = new FestivalBAL();
                editdetails = fs.FetchFestivalDetails(lpid.Text);

                lblFestivalEdit.Text = editdetails.Rows[0][0].ToString();
                txtFestivalName.Text = editdetails.Rows[0][1].ToString();
                ddlMonth.ClearSelection();
                ddlMonth.Items.FindByText(editdetails.Rows[0][2].ToString()).Selected = true;
                txtDescription.Text = editdetails.Rows[0][3].ToString();
                txtDuration.Text    = editdetails.Rows[0][4].ToString();
                ddlSpotName.ClearSelection();
                ddlSpotName.Items.FindByText(editdetails.Rows[0][5].ToString()).Selected = true;
                if (Convert.ToInt32(editdetails.Rows[0][7].ToString()) == 1)
                {
                    chkActive.Checked = true;
                }
                else
                {
                    chkActive.Checked = false;
                }
            }
        }
    }
Exemplo n.º 12
0
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropDownList2.SelectedItem.Text == "Banner")
        {
            trBanner.Visible  = true;
            trGallery.Visible = false;
            trGrid.Visible    = false;
            tr2.Visible       = false;
            trgrid4.Visible   = false;

            DataSet    ds1 = new DataSet();
            GeneralDAL lp  = new GeneralDAL();
            ds1 = lp.FetchBanner();

            if (DropDownList1.SelectedItem.Text == "Historical Spots")
            {
                GridView2.DataSource = ds1.Tables[1];
            }
            else if (DropDownList1.SelectedItem.Text == "LP")
            {
                GridView2.DataSource = ds1.Tables[2];
            }
            else if (DropDownList1.SelectedItem.Text == "Festivals")
            {
                GridView2.DataSource = ds1.Tables[3];
            }
            else if (DropDownList1.SelectedItem.Text == "Home")
            {
                GridView2.DataSource = ds1.Tables[0];
            }
            GridView2.DataBind();
        }
        else if (DropDownList2.SelectedItem.Text == "Gallery")
        {
            tr2.Visible          = false;
            trgrid4.Visible      = false;
            trBanner.Visible     = false;
            trGallery.Visible    = true;
            trGrid.Visible       = true;
            tr1.Visible          = false;
            GridView1.DataSource = null;
            GridView1.DataBind();
            if (DropDownList1.SelectedItem.Text == "Historical Spots")
            {
                lblColumn.Text = "Spot Name";
                DataSet        ds = new DataSet();
                SpotDetailsBAL sp = new SpotDetailsBAL();
                ds = sp.FetchSpotDetails1();

                ddlColumn.DataSource     = ds.Tables[4];
                ddlColumn.DataTextField  = "spotname";
                ddlColumn.DataValueField = "spotid";
                ddlColumn.DataBind();
                ddlColumn.Items.Insert(0, "Select");
                RequiredFieldValidator1.ErrorMessage = "Choose Spot Name";
            }
            else if (DropDownList1.SelectedItem.Text == "LP")
            {
                lblColumn.Text = "LP Category Name";
                DataSet      ds = new DataSet();
                LPDetailsBAL lp = new LPDetailsBAL();
                ds = lp.FetchLP1();

                ddlColumn.DataSource     = ds.Tables[2];
                ddlColumn.DataTextField  = "lpcategoryname";
                ddlColumn.DataValueField = "lpcategoryid";
                ddlColumn.DataBind();
                ddlColumn.Items.Insert(0, "Select");
                RequiredFieldValidator1.ErrorMessage = "Choose LP Category Name";
            }
            else if (DropDownList1.SelectedItem.Text == "Festivals")
            {
                lblColumn.Text = "Festival Name";
                DataSet     ds = new DataSet();
                FestivalBAL fs = new FestivalBAL();
                ds = fs.FetchFestival1();

                ddlColumn.DataSource     = ds.Tables[0];
                ddlColumn.DataTextField  = "Name";
                ddlColumn.DataValueField = "FestivalID";
                ddlColumn.DataBind();
                ddlColumn.Items.Insert(0, "Select");
                RequiredFieldValidator1.ErrorMessage = "Choose Festival Name";
            }
            else
            {
                lblColumn.Text = string.Empty;
                ddlColumn.Items.Clear();
                ddlColumn.Items.Add("Select");
            }
        }
        else if (DropDownList2.SelectedItem.Text == "Map")
        {
            tr2.Visible       = true;
            trgrid4.Visible   = true;
            trBanner.Visible  = false;
            trGallery.Visible = false;
            trGrid.Visible    = false;
            tr1.Visible       = false;
            // GridView3.DataSource = null;
            GridView3.DataBind();
            if (DropDownList1.SelectedItem.Text == "Historical Spots")
            {
                Label8.Text = "Spot Name";
                DataSet        ds = new DataSet();
                SpotDetailsBAL sp = new SpotDetailsBAL();
                ds = sp.FetchSpotDetails1();

                DropDownList3.DataSource     = ds.Tables[4];
                DropDownList3.DataTextField  = "spotname";
                DropDownList3.DataValueField = "spotid";
                DropDownList3.DataBind();
                DropDownList3.Items.Insert(0, "Select");
                RequiredFieldValidator1.ErrorMessage = "Choose Spot Name";
            }
            else if (DropDownList1.SelectedItem.Text == "LP")
            {
                lblColumn.Text = "LP Category Name";
                DataSet      ds = new DataSet();
                LPDetailsBAL lp = new LPDetailsBAL();
                ds = lp.FetchLP1();

                ddlColumn.DataSource     = ds.Tables[2];
                ddlColumn.DataTextField  = "lpcategoryname";
                ddlColumn.DataValueField = "lpcategoryid";
                ddlColumn.DataBind();
                ddlColumn.Items.Insert(0, "Select");
                RequiredFieldValidator1.ErrorMessage = "Choose LP Category Name";
            }
            else if (DropDownList1.SelectedItem.Text == "Festivals")
            {
                lblColumn.Text = "Festival Name";
                DataSet     ds = new DataSet();
                FestivalBAL fs = new FestivalBAL();
                ds = fs.FetchFestival1();

                ddlColumn.DataSource     = ds.Tables[0];
                ddlColumn.DataTextField  = "Name";
                ddlColumn.DataValueField = "FestivalID";
                ddlColumn.DataBind();
                ddlColumn.Items.Insert(0, "Select");
                RequiredFieldValidator1.ErrorMessage = "Choose Festival Name";
            }
            else
            {
                lblColumn.Text = string.Empty;
                ddlColumn.Items.Clear();
                ddlColumn.Items.Add("Select");
            }
        }

        else
        {
            trBanner.Visible  = false;
            trGallery.Visible = false;
            trGrid.Visible    = false;
            tr2.Visible       = false;
            trgrid4.Visible   = false;
        }
    }
Exemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region Fetch Grid Page Size Details...
            DataTable pg = new DataTable();
            GeneralBAL pz = new GeneralBAL();
            pg = pz.FetchGridPageSize();
            if (pg.Rows.Count != 0 && pg.Rows[0][0].ToString() != string.Empty)
                grdFestival.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString());
            #endregion

            // Bind the banner of the image.
            DataSet ds = new DataSet();
            GeneralDAL lp = new GeneralDAL();
            ds = lp.FetchBanner();
            if (ds.Tables[3].Rows.Count != 0)
                imgBanner.ImageUrl = ds.Tables[3].Rows[0][1].ToString();
            //End Bind the banner of the image.

            // fetch value of the grid details....
            DataSet ds1 = new DataSet();
            FestivalBAL fs = new FestivalBAL();
            ds1 = fs.FetchFestival();
            grdFestival.DataSource = ds1.Tables[0];
            grdFestival.DataBind();
            //End fetch value of the grid details....

            //if comes from index page
            if (Session["festivalId"] != null)
            {
                int rowno=0;
                for (int i = 0; ds1.Tables[0].Rows.Count > i; i++)
                {
                    if (ds1.Tables[0].Rows[i]["festivalid"].ToString() == Session["festivalId"].ToString())
                        rowno = i;
                }
                FetchGridDetails(Session["festivalId"].ToString());
                grdFestival.PageIndex = rowno / grdFestival.PageSize;
                int SelectedRowIndex = rowno - (grdFestival.PageSize * grdFestival.PageIndex);
                grdFestival.DataBind();
                grdFestival.Rows[SelectedRowIndex].BackColor = System.Drawing.Color.LightGray;
                Session["festivalId"] = null;
            }//other load festival here.....
            else if (Request.QueryString["festivalId"] != null)
            {
                int rowno = 0;
                for (int i = 0; ds1.Tables[0].Rows.Count > i; i++)
                {
                    if (ds1.Tables[0].Rows[i]["festivalid"].ToString() == Request.QueryString["festivalId"].ToString())
                        rowno = i;
                }
                FetchGridDetails(Request.QueryString["festivalId"].ToString());
                grdFestival.PageIndex = rowno / grdFestival.PageSize;
                int SelectedRowIndex = rowno - (grdFestival.PageSize * grdFestival.PageIndex);
                grdFestival.DataBind();
                grdFestival.Rows[SelectedRowIndex].BackColor = System.Drawing.Color.LightGray;
            }
            else
            {
                if (ds1.Tables[0].Rows.Count != 0)
                {
                    FetchGridDetails(ds1.Tables[0].Rows[0][0].ToString());
                    grdFestival.Rows[0].BackColor = System.Drawing.Color.LightGray;
                }
            }

        }
    }
Exemplo n.º 14
0
 protected void gridPageChanging(object sender, GridViewPageEventArgs e)
 {
     if (ddlSearchCategory.SelectedItem.Text == "Select" & ddlSearchCategory1.SelectedItem.Text == "Select")
     {
         DataSet ds1 = new DataSet();
         FestivalBAL fs = new FestivalBAL();
         ds1 = fs.FetchFestival();
         grdFestival.DataSource = ds1.Tables[0];
         grdFestival.PageIndex = e.NewPageIndex;
         grdFestival.DataBind();
     }
     else
     {
         DataTable ds = new DataTable();
         GeneralBAL lp = new GeneralBAL();
         ds = lp.FetchFestivalGridDetails(ddlSearchCategory1.SelectedItem.Text);
         grdFestival.DataSource = ds;
         grdFestival.PageIndex = e.NewPageIndex;
         grdFestival.DataBind();
     }
 }
Exemplo n.º 15
0
 protected void ddlSearchCategory_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlSearchCategory.SelectedItem.Text != "Select")
         ddlSearchCategory1.Enabled = true;
     else
     {
         ddlSearchCategory1.SelectedIndex = 0;
         ddlSearchCategory1.Enabled = false;
         // fetch value of the grid details....
         DataSet ds1 = new DataSet();
         FestivalBAL fs = new FestivalBAL();
         ds1 = fs.FetchFestival();
         grdFestival.DataSource = ds1.Tables[0];
         grdFestival.DataBind();
         //End fetch value of the grid details....
     }
 }
Exemplo n.º 16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region Fetch Grid Page Size Details...
            DataTable  pg = new DataTable();
            GeneralBAL pz = new GeneralBAL();
            pg = pz.FetchGridPageSize();
            if (pg.Rows.Count != 0 && pg.Rows[0][0].ToString() != string.Empty)
            {
                grdFestival.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString());
            }
            #endregion

            // Bind the banner of the image.
            DataSet    ds = new DataSet();
            GeneralDAL lp = new GeneralDAL();
            ds = lp.FetchBanner();
            if (ds.Tables[3].Rows.Count != 0)
            {
                imgBanner.ImageUrl = ds.Tables[3].Rows[0][1].ToString();
            }
            //End Bind the banner of the image.

            // fetch value of the grid details....
            DataSet     ds1 = new DataSet();
            FestivalBAL fs  = new FestivalBAL();
            ds1 = fs.FetchFestival();
            grdFestival.DataSource = ds1.Tables[0];
            grdFestival.DataBind();
            //End fetch value of the grid details....

            //if comes from index page
            if (Session["festivalId"] != null)
            {
                int rowno = 0;
                for (int i = 0; ds1.Tables[0].Rows.Count > i; i++)
                {
                    if (ds1.Tables[0].Rows[i]["festivalid"].ToString() == Session["festivalId"].ToString())
                    {
                        rowno = i;
                    }
                }
                FetchGridDetails(Session["festivalId"].ToString());
                grdFestival.PageIndex = rowno / grdFestival.PageSize;
                int SelectedRowIndex = rowno - (grdFestival.PageSize * grdFestival.PageIndex);
                grdFestival.DataBind();
                grdFestival.Rows[SelectedRowIndex].BackColor = System.Drawing.Color.LightGray;
                Session["festivalId"] = null;
            }//other load festival here.....
            else if (Request.QueryString["festivalId"] != null)
            {
                int rowno = 0;
                for (int i = 0; ds1.Tables[0].Rows.Count > i; i++)
                {
                    if (ds1.Tables[0].Rows[i]["festivalid"].ToString() == Request.QueryString["festivalId"].ToString())
                    {
                        rowno = i;
                    }
                }
                FetchGridDetails(Request.QueryString["festivalId"].ToString());
                grdFestival.PageIndex = rowno / grdFestival.PageSize;
                int SelectedRowIndex = rowno - (grdFestival.PageSize * grdFestival.PageIndex);
                grdFestival.DataBind();
                grdFestival.Rows[SelectedRowIndex].BackColor = System.Drawing.Color.LightGray;
            }
            else
            {
                if (ds1.Tables[0].Rows.Count != 0)
                {
                    FetchGridDetails(ds1.Tables[0].Rows[0][0].ToString());
                    grdFestival.Rows[0].BackColor = System.Drawing.Color.LightGray;
                }
            }
        }
    }
Exemplo n.º 17
0
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropDownList2.SelectedItem.Text == "Banner")
        {
            trBanner.Visible = true;
            trGallery.Visible = false;
            trGrid.Visible = false;
            tr2.Visible = false;
            trgrid4.Visible = false;

            DataSet ds1 = new DataSet();
            GeneralDAL lp = new GeneralDAL();
            ds1 = lp.FetchBanner();

            if (DropDownList1.SelectedItem.Text == "Historical Spots")
                GridView2.DataSource = ds1.Tables[1];
            else if (DropDownList1.SelectedItem.Text == "LP")
                GridView2.DataSource = ds1.Tables[2];
            else if (DropDownList1.SelectedItem.Text == "Festivals")
                GridView2.DataSource = ds1.Tables[3];
            else if (DropDownList1.SelectedItem.Text == "Home")
                GridView2.DataSource = ds1.Tables[0];
            GridView2.DataBind();

        }
        else if (DropDownList2.SelectedItem.Text == "Gallery")
        {
            tr2.Visible = false;
            trgrid4.Visible = false;
            trBanner.Visible = false;
            trGallery.Visible = true;
            trGrid.Visible = true;
            tr1.Visible = false;
            GridView1.DataSource = null;
            GridView1.DataBind();
            if (DropDownList1.SelectedItem.Text == "Historical Spots")
            {
                lblColumn.Text = "Spot Name";
                DataSet ds = new DataSet();
                SpotDetailsBAL sp = new SpotDetailsBAL();
                ds = sp.FetchSpotDetails1();

                ddlColumn.DataSource = ds.Tables[4];
                ddlColumn.DataTextField = "spotname";
                ddlColumn.DataValueField = "spotid";
                ddlColumn.DataBind();
                ddlColumn.Items.Insert(0, "Select");
                RequiredFieldValidator1.ErrorMessage = "Choose Spot Name";
            }
            else if (DropDownList1.SelectedItem.Text == "LP")
            {
                lblColumn.Text = "LP Category Name";
                DataSet ds = new DataSet();
                LPDetailsBAL lp = new LPDetailsBAL();
                ds = lp.FetchLP1();

                ddlColumn.DataSource = ds.Tables[2];
                ddlColumn.DataTextField = "lpcategoryname";
                ddlColumn.DataValueField = "lpcategoryid";
                ddlColumn.DataBind();
                ddlColumn.Items.Insert(0, "Select");
                RequiredFieldValidator1.ErrorMessage = "Choose LP Category Name";

            }
            else if (DropDownList1.SelectedItem.Text == "Festivals")
            {
                lblColumn.Text = "Festival Name";
                DataSet ds = new DataSet();
                FestivalBAL fs = new FestivalBAL();
                ds = fs.FetchFestival1();

                ddlColumn.DataSource = ds.Tables[0];
                ddlColumn.DataTextField = "Name";
                ddlColumn.DataValueField = "FestivalID";
                ddlColumn.DataBind();
                ddlColumn.Items.Insert(0, "Select");
                RequiredFieldValidator1.ErrorMessage = "Choose Festival Name";
            }
            else
            {
                lblColumn.Text = string.Empty;
                ddlColumn.Items.Clear();
                ddlColumn.Items.Add("Select");
            }
        }
        else if (DropDownList2.SelectedItem.Text == "Map")
        {
            tr2.Visible = true;
            trgrid4.Visible = true;
            trBanner.Visible = false;
            trGallery.Visible = false ;
            trGrid.Visible = false;
            tr1.Visible = false;
            // GridView3.DataSource = null;
            GridView3.DataBind();
            if (DropDownList1.SelectedItem.Text == "Historical Spots")
            {
                 Label8.Text = "Spot Name";
                DataSet ds = new DataSet();
                SpotDetailsBAL sp = new SpotDetailsBAL();
                ds = sp.FetchSpotDetails1();

                DropDownList3.DataSource = ds.Tables[4];
                DropDownList3.DataTextField = "spotname";
                DropDownList3.DataValueField = "spotid";
                DropDownList3.DataBind();
                DropDownList3.Items.Insert(0, "Select");
                RequiredFieldValidator1.ErrorMessage = "Choose Spot Name";

            }
            else if (DropDownList1.SelectedItem.Text == "LP")
            {
                lblColumn.Text = "LP Category Name";
                DataSet ds = new DataSet();
                LPDetailsBAL lp = new LPDetailsBAL();
                ds = lp.FetchLP1();

                ddlColumn.DataSource = ds.Tables[2];
                ddlColumn.DataTextField = "lpcategoryname";
                ddlColumn.DataValueField = "lpcategoryid";
                ddlColumn.DataBind();
                ddlColumn.Items.Insert(0, "Select");
                RequiredFieldValidator1.ErrorMessage = "Choose LP Category Name";

            }
            else if (DropDownList1.SelectedItem.Text == "Festivals")
            {
                lblColumn.Text = "Festival Name";
                DataSet ds = new DataSet();
                FestivalBAL fs = new FestivalBAL();
                ds = fs.FetchFestival1();

                ddlColumn.DataSource = ds.Tables[0];
                ddlColumn.DataTextField = "Name";
                ddlColumn.DataValueField = "FestivalID";
                ddlColumn.DataBind();
                ddlColumn.Items.Insert(0, "Select");
                RequiredFieldValidator1.ErrorMessage = "Choose Festival Name";
            }
            else
            {
                lblColumn.Text = string.Empty;
                ddlColumn.Items.Clear();
                ddlColumn.Items.Add("Select");
            }
        }

        else
        {
            trBanner.Visible = false;
            trGallery.Visible = false;
            trGrid.Visible = false;
            tr2.Visible = false;
            trgrid4.Visible = false;
        }
    }
Exemplo n.º 18
0
    protected void Gridview_OnRowCommand(object sender, GridViewCommandEventArgs e)
    {
        string _commandName;
        if (e.CommandArgument.ToString() == "Next" || e.CommandArgument.ToString() == "Last" || e.CommandArgument.ToString() == "First" || e.CommandArgument.ToString() == "Prev")
        {
        }
        else
        {
            // Get the selected index and the command name
            int _selectedIndex = int.Parse(e.CommandArgument.ToString());

            _commandName = e.CommandName;
            if (_commandName == "fesedit")
            {
                Label lpid = (Label)grdFestival.Rows[_selectedIndex].Cells[0].FindControl("lblGridFesId");
                DataTable editdetails = new DataTable();
                FestivalBAL fs = new FestivalBAL();
                editdetails = fs.FetchFestivalDetails(lpid.Text);

                lblFestivalEdit.Text = editdetails.Rows[0][0].ToString();
                txtFestivalName.Text = editdetails.Rows[0][1].ToString();
                ddlMonth.ClearSelection();
                ddlMonth.Items.FindByText(editdetails.Rows[0][2].ToString()).Selected = true;
                txtDescription.Text = editdetails.Rows[0][3].ToString();
                txtDuration.Text = editdetails.Rows[0][4].ToString();
                ddlSpotName.ClearSelection();
                ddlSpotName.Items.FindByText(editdetails.Rows[0][5].ToString()).Selected = true;
                if (Convert.ToInt32(editdetails.Rows[0][7].ToString()) == 1)
                    chkActive.Checked = true;
                else
                    chkActive.Checked = false;
            }
        }
    }
Exemplo n.º 19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Cache.SetNoStore();
        if (!IsPostBack)
        {
            #region Fetch Grid Page Size Details...
            DataTable pg = new DataTable();
            GeneralBAL gl = new GeneralBAL();
            pg = gl.FetchGridPageSize();
            if (pg.Rows.Count != 0 && pg.Rows[0][1].ToString() != string.Empty)
                grdFestival.PageSize = Convert.ToInt32(pg.Rows[0][1].ToString());
            #endregion

            FestivalBAL fs = new FestivalBAL();
            ds = fs.FetchFestival1();

            ddlSpotName.DataSource = ds.Tables[1];
            ddlSpotName.DataTextField = "SpotName";
            ddlSpotName.DataValueField = "SpotID";
            ddlSpotName.DataBind();
            ddlSpotName.Items.Insert(0, "Select");

            grdFestival.DataSource = ds.Tables[0];
            grdFestival.DataBind();

        }
    }
Exemplo n.º 20
0
    private void FetchDetails()
    {
        FestivalBAL fs = new FestivalBAL();
        ds = fs.FetchFestival();

        grdFestival.DataSource = ds.Tables[0];
        grdFestival.DataBind();
    }