protected void Button1_Click(object sender, EventArgs e) { int active = 0; if (chkActive.Checked == true) active = 1; if (string.IsNullOrEmpty(lblSpotEdit.Text)) { int a; SpotDetailsBAL sp = new SpotDetailsBAL(); a = sp.SaveSpotDetails(txtSpotName.Text, txtDescription.Text, ddlReligion.SelectedItem.Text, txtDeity.Text, ddlPeriod.SelectedItem.Text, ddlBuiltBy.SelectedItem.Text, txtArchitecture.Text, txtSculpture.Text, txtPainting.Text, txtInscription.Text, txtHymns.Text, txtMythology.Text, txtEvents.Text, txtTiming.Text, txtLocation.Text, txtSketch.Text, ddlSpotCategory.SelectedItem.Text, ddlSanctifiedBy.SelectedItem.Text, active); if (a != 0) Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Spot Details Added.');location='AddSpotDetails.aspx'", true); Clear(); FetchDetails(); } else { int a; SpotDetailsBAL sp = new SpotDetailsBAL(); a = sp.UpdateSpotDetails(lblSpotEdit.Text,txtSpotName.Text, txtDescription.Text, ddlReligion.SelectedItem.Text, txtDeity.Text, ddlPeriod.SelectedItem.Text, ddlBuiltBy.SelectedItem.Text, txtArchitecture.Text, txtSculpture.Text, txtPainting.Text, txtInscription.Text, txtHymns.Text, txtMythology.Text, txtEvents.Text, txtTiming.Text, txtLocation.Text, txtSketch.Text, ddlSpotCategory.SelectedItem.Text, ddlSanctifiedBy.SelectedItem.Text, active); if (a != 0) Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Spot Details updated.');location='AddSpotDetails.aspx'", true); Clear(); FetchDetails(); } }
private void FetchDetails() { SpotDetailsBAL sp = new SpotDetailsBAL(); ds = sp.FetchSpotDetails(); gridviewSpot.DataSource = ds.Tables[4]; gridviewSpot.DataBind(); }
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 == "spotedit") { Label spotid = (Label)gridviewSpot.Rows[_selectedIndex].Cells[0].FindControl("lblGridSpotId"); DataTable editdetails = new DataTable(); SpotDetailsBAL sp = new SpotDetailsBAL(); editdetails = sp.EditSpotDetails(spotid.Text); lblSpotEdit.Text = editdetails.Rows[0][0].ToString(); txtSpotName.Text = editdetails.Rows[0][1].ToString(); txtDescription.Text = editdetails.Rows[0][2].ToString(); ddlReligion.ClearSelection(); ddlReligion.Items.FindByText(editdetails.Rows[0][3].ToString()).Selected = true; txtDeity.Text = editdetails.Rows[0][4].ToString(); ddlPeriod.ClearSelection(); ddlPeriod.Items.FindByText(editdetails.Rows[0][5].ToString()).Selected = true; ddlBuiltBy.ClearSelection(); ddlBuiltBy.Items.FindByText(editdetails.Rows[0][6].ToString()).Selected = true; txtArchitecture.Text = editdetails.Rows[0][7].ToString(); txtSculpture.Text = editdetails.Rows[0][8].ToString(); txtPainting.Text = editdetails.Rows[0][9].ToString(); txtInscription.Text = editdetails.Rows[0][10].ToString(); txtHymns.Text = editdetails.Rows[0][11].ToString(); txtMythology.Text = editdetails.Rows[0][12].ToString(); txtEvents.Text = editdetails.Rows[0][13].ToString(); txtTiming.Text = editdetails.Rows[0][14].ToString(); txtLocation.Text = editdetails.Rows[0][15].ToString(); txtSketch.Text = editdetails.Rows[0][16].ToString(); ddlSpotCategory.ClearSelection(); ddlSpotCategory.Items.FindByText(editdetails.Rows[0][17].ToString()).Selected = true; ddlSanctifiedBy.ClearSelection(); ddlSanctifiedBy.Items.FindByText(editdetails.Rows[0][18].ToString()).Selected = true; if (Convert.ToInt32(editdetails.Rows[0][19].ToString()) == 1) { chkActive.Checked = true; } else { chkActive.Checked = false; } } } }
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 pz = new GeneralBAL(); pg = pz.FetchGridPageSize(); if (pg.Rows.Count != 0 && pg.Rows[0][1].ToString() != string.Empty) { gridviewSpot.PageSize = Convert.ToInt32(pg.Rows[0][1].ToString()); } #endregion SpotDetailsBAL sp = new SpotDetailsBAL(); ds = sp.FetchSpotDetails1(); ddlReligion.DataSource = ds.Tables[1]; ddlReligion.DataTextField = "ReligionName"; ddlReligion.DataValueField = "ReligionID"; ddlReligion.DataBind(); ddlReligion.Items.Insert(0, "==Select=="); ddlPeriod.DataSource = ds.Tables[2]; ddlPeriod.DataTextField = "Century"; ddlPeriod.DataValueField = "Century"; ddlPeriod.DataBind(); ddlPeriod.Items.Insert(0, "==Select=="); ddlBuiltBy.DataSource = ds.Tables[0]; ddlBuiltBy.DataTextField = "LPName"; ddlBuiltBy.DataValueField = "LPID"; ddlBuiltBy.DataBind(); ddlBuiltBy.Items.Insert(0, "==Select=="); ddlSanctifiedBy.DataSource = ds.Tables[5]; ddlSanctifiedBy.DataTextField = "LPName"; ddlSanctifiedBy.DataValueField = "LPID"; ddlSanctifiedBy.DataBind(); ddlSanctifiedBy.Items.Insert(0, "==Select=="); ddlSpotCategory.DataSource = ds.Tables[3]; ddlSpotCategory.DataTextField = "SpotCategoryName"; ddlSpotCategory.DataValueField = "SpotCategoryID"; ddlSpotCategory.DataBind(); ddlSpotCategory.Items.Insert(0, "==Select=="); gridviewSpot.DataSource = ds.Tables[4]; gridviewSpot.DataBind(); } }
protected void btnSpotDelete_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(lblSpotEdit.Text)) { int a; SpotDetailsBAL sp = new SpotDetailsBAL(); a = sp.DeleteSpotDetails(lblSpotEdit.Text); if (a != 0) Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Spot Details Deleted.');location='AddSpotDetails.aspx'", true); Clear(); FetchDetails(); } else Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Select Spot Details to Delete.');location='AddSpotDetails.aspx'", true); }
protected void btnSpotDelete_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(lblSpotEdit.Text)) { int a; SpotDetailsBAL sp = new SpotDetailsBAL(); a = sp.DeleteSpotDetails(lblSpotEdit.Text); if (a != 0) { Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Spot Details Deleted.');location='AddSpotDetails.aspx'", true); } Clear(); FetchDetails(); } else { Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Select Spot Details to Delete.');location='AddSpotDetails.aspx'", true); } }
protected void gridPageChanging(object sender, GridViewPageEventArgs e) { if (ddlSearchCategory.SelectedItem.Text == "Select" & ddlSearchCategory1.SelectedItem.Text == "Select") { DataSet fetchspotdetails = new DataSet(); SpotDetailsBAL det = new SpotDetailsBAL(); fetchspotdetails = det.FetchSpotDetails(); grdSpotName.DataSource = fetchspotdetails.Tables[4]; grdSpotName.PageIndex = e.NewPageIndex; grdSpotName.DataBind(); } else { DataTable ds = new DataTable(); GeneralBAL lp = new GeneralBAL(); ds = lp.SearchBySearchCategory(ddlSearchCategory1.SelectedItem.Text); grdSpotName.DataSource = ds; grdSpotName.PageIndex = e.NewPageIndex; grdSpotName.DataBind(); } }
protected void ddlSearchCategory_SelectedIndexChanged(object sender, EventArgs e) { if (ddlSearchCategory.SelectedItem.Text != "Select") { // Bind the search category value in second ddl DataTable ds = new DataTable(); GeneralBAL lp = new GeneralBAL(); ds = lp.FetchDetailBySearchCategory(ddlSearchCategory.SelectedItem.Text); ddlSearchCategory1.DataSource = ds; if (ddlSearchCategory.SelectedItem.Text == "Religion") { ddlSearchCategory1.DataTextField = "ReligionName"; ddlSearchCategory1.DataValueField = "ReligionID"; } else if (ddlSearchCategory.SelectedItem.Text == "Spot Category") { ddlSearchCategory1.DataTextField = "SpotCategoryName"; ddlSearchCategory1.DataValueField = "SpotCategoryID"; } ddlSearchCategory1.DataBind(); ddlSearchCategory1.Items.Insert(0, "Select"); //End Bind the search category value in second ddl } else { ddlSearchCategory1.Items.Clear(); ddlSearchCategory1.Items.Add("Select"); // fetch value of the grid details.... DataSet fetchspotdetails = new DataSet(); SpotDetailsBAL det = new SpotDetailsBAL(); fetchspotdetails = det.FetchSpotDetails(); grdSpotName.DataSource = fetchspotdetails.Tables[4]; grdSpotName.DataBind(); //End value of the grid details.... } }
protected void ddlSearchCategory_SelectedIndexChanged(object sender, EventArgs e) { if (ddlSearchCategory.SelectedItem.Text != "Select") { // Bind the search category value in second ddl DataTable ds = new DataTable(); GeneralBAL lp = new GeneralBAL(); ds = lp.FetchDetailBySearchCategory(ddlSearchCategory.SelectedItem.Text); ddlSearchCategory1.DataSource = ds; if (ddlSearchCategory.SelectedItem.Text == "Religion") { ddlSearchCategory1.DataTextField = "ReligionName"; ddlSearchCategory1.DataValueField = "ReligionID"; } else if (ddlSearchCategory.SelectedItem.Text == "Spot Category") { ddlSearchCategory1.DataTextField = "SpotCategoryName"; ddlSearchCategory1.DataValueField = "SpotCategoryID"; } ddlSearchCategory1.DataBind(); ddlSearchCategory1.Items.Insert(0, "Select"); //End Bind the search category value in second ddl } else { ddlSearchCategory1.Items.Clear(); ddlSearchCategory1.Items.Add("Select"); // fetch value of the grid details.... DataSet fetchspotdetails = new DataSet(); SpotDetailsBAL det = new SpotDetailsBAL(); fetchspotdetails = det.FetchSpotDetails(); grdSpotName.DataSource = fetchspotdetails.Tables[4]; grdSpotName.DataBind(); //End first value of the grid details.... } }
protected void gridPageChanging1(object sender, GridViewPageEventArgs e) { if (ddlSearchCategory.SelectedItem.Text == "Select" & ddlSearchCategory1.SelectedItem.Text == "Select") { DataSet fetchspotdetails = new DataSet(); SpotDetailsBAL det = new SpotDetailsBAL(); fetchspotdetails = det.FetchSpotDetails(); grdSpotName.DataSource = fetchspotdetails.Tables[4]; grdSpotName.PageIndex = e.NewPageIndex; grdSpotName.DataBind(); } else { DataTable ds = new DataTable(); GeneralBAL lp = new GeneralBAL(); ds = lp.SearchBySearchCategory(ddlSearchCategory1.SelectedItem.Text); grdSpotName.DataSource = ds; grdSpotName.PageIndex = e.NewPageIndex; grdSpotName.DataBind(); } }
protected void Button1_Click(object sender, EventArgs e) { int active = 0; if (chkActive.Checked == true) { active = 1; } if (string.IsNullOrEmpty(lblSpotEdit.Text)) { int a; SpotDetailsBAL sp = new SpotDetailsBAL(); a = sp.SaveSpotDetails(txtSpotName.Text, txtDescription.Text, ddlReligion.SelectedItem.Text, txtDeity.Text, ddlPeriod.SelectedItem.Text, ddlBuiltBy.SelectedItem.Text, txtArchitecture.Text, txtSculpture.Text, txtPainting.Text, txtInscription.Text, txtHymns.Text, txtMythology.Text, txtEvents.Text, txtTiming.Text, txtLocation.Text, txtSketch.Text, ddlSpotCategory.SelectedItem.Text, ddlSanctifiedBy.SelectedItem.Text, active); if (a != 0) { Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Spot Details Added.');location='AddSpotDetails.aspx'", true); } Clear(); FetchDetails(); } else { int a; SpotDetailsBAL sp = new SpotDetailsBAL(); a = sp.UpdateSpotDetails(lblSpotEdit.Text, txtSpotName.Text, txtDescription.Text, ddlReligion.SelectedItem.Text, txtDeity.Text, ddlPeriod.SelectedItem.Text, ddlBuiltBy.SelectedItem.Text, txtArchitecture.Text, txtSculpture.Text, txtPainting.Text, txtInscription.Text, txtHymns.Text, txtMythology.Text, txtEvents.Text, txtTiming.Text, txtLocation.Text, txtSketch.Text, ddlSpotCategory.SelectedItem.Text, ddlSanctifiedBy.SelectedItem.Text, active); if (a != 0) { Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Spot Details updated.');location='AddSpotDetails.aspx'", true); } Clear(); FetchDetails(); } }
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) { grdSpotName.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString()); grdFestival.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString()); } #endregion // Bind the search category value in first ddl DataTable ds = new DataTable(); GeneralBAL lp = new GeneralBAL(); ds = lp.FetchSearchCategory(); ddlSearchCategory.DataSource = ds; ddlSearchCategory.DataTextField = "SearchCategoryName"; ddlSearchCategory.DataValueField = "SearchCategoryID"; ddlSearchCategory.DataBind(); ddlSearchCategory.Items.Insert(0, "Select"); //End Bind the search category value in first ddl // Bind the banner of the image. DataSet dsphoto = new DataSet(); GeneralDAL lpphoto = new GeneralDAL(); dsphoto = lpphoto.FetchBanner(); if (dsphoto.Tables[1].Rows.Count != 0) // imgBanner.ImageUrl = dsphoto.Tables[1].Rows[0][1].ToString(); //End Bind the banner of the image. //// Bind the map of the image. //DataSet dsmapphoto = new DataSet(); //GeneralDAL lpmapphoto = new GeneralDAL(); //dsmapphoto = lpmapphoto.FetchMap(); //if (dsmapphoto.Tables[1].Rows.Count != 0) // Image1.ImageUrl = dsmapphoto.Tables[1].Rows[0][1].ToString(); //// End Bind the map of the image. // fetch value of the grid details.... { DataSet fetchspotdetails = new DataSet(); SpotDetailsBAL det = new SpotDetailsBAL(); fetchspotdetails = det.FetchSpotDetails(); grdSpotName.DataSource = fetchspotdetails.Tables[4]; grdSpotName.DataBind(); //End value of the grid details.... if (Session["SpotId"] != null) { int rowno = 0; for (int i = 0; fetchspotdetails.Tables[4].Rows.Count > i; i++) { if (fetchspotdetails.Tables[4].Rows[i]["spotid"].ToString() == Session["SpotId"].ToString()) { rowno = i; } } FetchGridDetails(Session["SpotId"].ToString()); grdSpotName.PageIndex = rowno / grdSpotName.PageSize; int SelectedRowIndex = rowno - (grdSpotName.PageSize * grdSpotName.PageIndex); grdSpotName.DataBind(); grdSpotName.Rows[SelectedRowIndex].BackColor = System.Drawing.Color.LightGray; Session["SpotId"] = null; } else if (Request.QueryString["SpotId"] != null) { int rowno = 0; for (int i = 0; fetchspotdetails.Tables[4].Rows.Count > i; i++) { if (fetchspotdetails.Tables[4].Rows[i]["spotid"].ToString() == Request.QueryString["SpotId"].ToString()) { rowno = i; } } FetchGridDetails(Request.QueryString["SpotId"].ToString()); grdSpotName.PageIndex = rowno / grdSpotName.PageSize; int SelectedRowIndex = rowno - (grdSpotName.PageSize * grdSpotName.PageIndex); grdSpotName.DataBind(); grdSpotName.Rows[SelectedRowIndex].BackColor = System.Drawing.Color.LightGray; } else { if (fetchspotdetails.Tables[4].Rows.Count != 0) { grdSpotName.Rows[0].BackColor = System.Drawing.Color.LightGray; FetchGridDetails(fetchspotdetails.Tables[4].Rows[0][0].ToString()); } } } } }
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) { grdSpotName.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString()); grdFestival.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString()); } #endregion // Bind the banner of the image. DataSet ds = new DataSet(); DataTable fest = new DataTable(); GeneralBAL lp = new GeneralBAL(); ds = lp.FetchBanner(); if (ds.Tables[0].Rows.Count != 0) imgBanner.ImageUrl = ds.Tables[0].Rows[0][1].ToString(); //End Bind the banner of the image. fest = lp.FetchFestivalByMonth(); grdFestival.DataSource = fest; grdFestival.DataBind(); // Bind the search category value in first ddl DataTable ds1 = new DataTable(); GeneralBAL lp1 = new GeneralBAL(); ds1 = lp1.FetchSearchCategory(); ddlSearchCategory.DataSource = ds1; ddlSearchCategory.DataTextField = "SearchCategoryName"; ddlSearchCategory.DataValueField = "SearchCategoryID"; ddlSearchCategory.DataBind(); ddlSearchCategory.Items.Insert(0, "Select"); //End Bind the search category value in first ddl // fetch value of the grid details.... DataSet fetchspotdetails = new DataSet(); SpotDetailsBAL det = new SpotDetailsBAL(); fetchspotdetails = det.FetchSpotDetails(); grdSpotName.DataSource = fetchspotdetails.Tables[4]; grdSpotName.DataBind(); //End first value of the grid details.... Lbl_Festival.Text = "Festival(s) in " + GetMonthName(DateTime.Now); // Bind Active list details DataSet ds2 = new DataSet(); GeneralBAL act = new GeneralBAL(); ds2 = act.FetchNoOfActiveList(); if (ds2.Tables[0].Rows.Count != 0) { lblSpot.Visible = true; lblSpot.Text = ds2.Tables[0].Rows[0][0].ToString(); } else lblSpot.Visible = false; if (ds2.Tables[1].Rows.Count != 0) { lblLp.Visible = true; lblLp.Text = ds2.Tables[1].Rows[0][0].ToString(); } else lblLp.Visible = false; if (ds2.Tables[2].Rows.Count != 0) { lblFest.Visible = true; lblFest.Text = ds2.Tables[2].Rows[0][0].ToString(); } else lblFest.Visible = false; //end Bind Active list details } }
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) { grdSpotName.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString()); grdFestival.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString()); } #endregion } // Bind the banner of the image. DataSet ds = new DataSet(); DataTable fest = new DataTable(); GeneralBAL lp = new GeneralBAL(); ds = lp.FetchBanner(); if (ds.Tables[0].Rows.Count != 0) // imgBanner.ImageUrl = ds.Tables[0].Rows[0][1].ToString(); //End Bind the banner of the image. fest = lp.FetchFestivalByMonth(); grdFestival.DataSource = fest; grdFestival.DataBind(); // Bind the search category value in first ddl DataTable ds1 = new DataTable(); GeneralBAL lp1 = new GeneralBAL(); ds1 = lp1.FetchSearchCategory(); ddlSearchCategory.DataSource = ds1; ddlSearchCategory.DataTextField = "SearchCategoryName"; ddlSearchCategory.DataValueField = "SearchCategoryID"; ddlSearchCategory.DataBind(); ddlSearchCategory.Items.Insert(0, "Select"); //End Bind the search category value in first ddl // fetch value of the grid details.... DataSet fetchspotdetails = new DataSet(); SpotDetailsBAL det = new SpotDetailsBAL(); fetchspotdetails = det.FetchSpotDetails(); //grdSpotName.DataSource = fetchspotdetails.Tables[4]; //grdSpotName.DataBind(); //End first value of the grid details.... DataTable dt = fetchspotdetails.Tables[4]; DataTable dt1 = new DataTable(); dt1.Columns.Add("id"); dt1.Columns.Add("pid"); dt1.Columns.Add("name"); dt1.Columns.Add("desc"); foreach (DataRow row in dt.Rows) { string[] s = row["spotname"].ToString().Split('-'); if (dt1.Select("name = '" + s[0] + "'").Length == 0) { dt1.Rows.Add(s[0], null, s[0]); } dt1.Rows.Add(row["spotid"].ToString(), s[0], s[1], row[2].ToString()); } Addmenu(dt1); Lbl_Festival.Text = "Festival(s) in " + GetMonthName(DateTime.Now); // Bind Active list details DataSet ds2 = new DataSet(); GeneralBAL act = new GeneralBAL(); ds2 = act.FetchNoOfActiveList(); if (ds2.Tables[0].Rows.Count != 0) { lblSpot.Visible = true; lblSpot.Text = ds2.Tables[0].Rows[0][0].ToString(); } else lblSpot.Visible = false; if (ds2.Tables[1].Rows.Count != 0) { lblLp.Visible = true; lblLp.Text = ds2.Tables[1].Rows[0][0].ToString(); } else lblLp.Visible = false; if (ds2.Tables[2].Rows.Count != 0) { lblFest.Visible = true; lblFest.Text = ds2.Tables[2].Rows[0][0].ToString(); } else lblFest.Visible = false; //end Bind Active list details }
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) { grdSpotName.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString()); grdFestival.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString()); } #endregion // Bind the search category value in first ddl DataTable ds = new DataTable(); GeneralBAL lp = new GeneralBAL(); ds = lp.FetchSearchCategory(); ddlSearchCategory.DataSource = ds; ddlSearchCategory.DataTextField = "SearchCategoryName"; ddlSearchCategory.DataValueField = "SearchCategoryID"; ddlSearchCategory.DataBind(); ddlSearchCategory.Items.Insert(0, "Select"); //End Bind the search category value in first ddl // Bind the banner of the image. DataSet dsphoto = new DataSet(); GeneralDAL lpphoto = new GeneralDAL(); dsphoto = lpphoto.FetchBanner(); if (dsphoto.Tables[1].Rows.Count != 0) // imgBanner.ImageUrl = dsphoto.Tables[1].Rows[0][1].ToString(); //End Bind the banner of the image. //// Bind the map of the image. //DataSet dsmapphoto = new DataSet(); //GeneralDAL lpmapphoto = new GeneralDAL(); //dsmapphoto = lpmapphoto.FetchMap(); //if (dsmapphoto.Tables[1].Rows.Count != 0) // Image1.ImageUrl = dsmapphoto.Tables[1].Rows[0][1].ToString(); //// End Bind the map of the image. // fetch value of the grid details.... { DataSet fetchspotdetails = new DataSet(); SpotDetailsBAL det = new SpotDetailsBAL(); fetchspotdetails = det.FetchSpotDetails(); grdSpotName.DataSource = fetchspotdetails.Tables[4]; grdSpotName.DataBind(); //End value of the grid details.... if (Session["SpotId"] != null) { int rowno = 0; for (int i = 0; fetchspotdetails.Tables[4].Rows.Count > i; i++) { if (fetchspotdetails.Tables[4].Rows[i]["spotid"].ToString() == Session["SpotId"].ToString()) rowno = i; } FetchGridDetails(Session["SpotId"].ToString()); grdSpotName.PageIndex = rowno / grdSpotName.PageSize; int SelectedRowIndex = rowno - (grdSpotName.PageSize * grdSpotName.PageIndex); grdSpotName.DataBind(); grdSpotName.Rows[SelectedRowIndex].BackColor = System.Drawing.Color.LightGray; Session["SpotId"] = null; } else if (Request.QueryString["SpotId"] != null) { int rowno = 0; for (int i = 0; fetchspotdetails.Tables[4].Rows.Count > i; i++) { if (fetchspotdetails.Tables[4].Rows[i]["spotid"].ToString() == Request.QueryString["SpotId"].ToString()) rowno = i; } FetchGridDetails(Request.QueryString["SpotId"].ToString()); grdSpotName.PageIndex = rowno / grdSpotName.PageSize; int SelectedRowIndex = rowno - (grdSpotName.PageSize * grdSpotName.PageIndex); grdSpotName.DataBind(); grdSpotName.Rows[SelectedRowIndex].BackColor = System.Drawing.Color.LightGray; } else { if (fetchspotdetails.Tables[4].Rows.Count != 0) { grdSpotName.Rows[0].BackColor = System.Drawing.Color.LightGray; FetchGridDetails(fetchspotdetails.Tables[4].Rows[0][0].ToString()); } } } } }
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) { grdSpotName.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString()); grdFestival.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString()); } #endregion // Bind the banner of the image. DataSet ds = new DataSet(); DataTable fest = new DataTable(); GeneralBAL lp = new GeneralBAL(); ds = lp.FetchBanner(); if (ds.Tables[0].Rows.Count != 0) { imgBanner.ImageUrl = ds.Tables[0].Rows[0][1].ToString(); } //End Bind the banner of the image. fest = lp.FetchFestivalByMonth(); grdFestival.DataSource = fest; grdFestival.DataBind(); // Bind the search category value in first ddl DataTable ds1 = new DataTable(); GeneralBAL lp1 = new GeneralBAL(); ds1 = lp1.FetchSearchCategory(); ddlSearchCategory.DataSource = ds1; ddlSearchCategory.DataTextField = "SearchCategoryName"; ddlSearchCategory.DataValueField = "SearchCategoryID"; ddlSearchCategory.DataBind(); ddlSearchCategory.Items.Insert(0, "Select"); //End Bind the search category value in first ddl // fetch value of the grid details.... DataSet fetchspotdetails = new DataSet(); SpotDetailsBAL det = new SpotDetailsBAL(); fetchspotdetails = det.FetchSpotDetails(); //grdSpotName.DataSource = fetchspotdetails.Tables[4]; //grdSpotName.DataBind(); //End first value of the grid details.... DataTable dt = fetchspotdetails.Tables[4]; DataTable dt1 = new DataTable(); dt1.Columns.Add("id"); dt1.Columns.Add("pid"); dt1.Columns.Add("name"); dt1.Columns.Add("desc"); foreach (DataRow row in dt.Rows) { string[] s = row["spotname"].ToString().Split('-'); if (dt1.Select("name = '" + s[0] + "'").Length == 0) { dt1.Rows.Add(s[0], null, s[0]); } dt1.Rows.Add(row["spotid"].ToString(), s[0], s[1], row[2].ToString()); } Addmenu(dt1); Lbl_Festival.Text = "Festival(s) in " + GetMonthName(DateTime.Now); // Bind Active list details DataSet ds2 = new DataSet(); GeneralBAL act = new GeneralBAL(); ds2 = act.FetchNoOfActiveList(); if (ds2.Tables[0].Rows.Count != 0) { lblSpot.Visible = true; lblSpot.Text = ds2.Tables[0].Rows[0][0].ToString(); } else { lblSpot.Visible = false; } if (ds2.Tables[1].Rows.Count != 0) { lblLp.Visible = true; lblLp.Text = ds2.Tables[1].Rows[0][0].ToString(); } else { lblLp.Visible = false; } if (ds2.Tables[2].Rows.Count != 0) { lblFest.Visible = true; lblFest.Text = ds2.Tables[2].Rows[0][0].ToString(); } else { lblFest.Visible = false; } //end Bind Active list details } }
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; } }
private void FetchDetails() { SpotDetailsBAL sp = new SpotDetailsBAL(); ds = sp.FetchSpotDetails(); gridviewSpot.DataSource = ds.Tables[4]; gridviewSpot.DataBind(); }
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 pz = new GeneralBAL(); pg = pz.FetchGridPageSize(); if (pg.Rows.Count != 0 && pg.Rows[0][1].ToString() != string.Empty) gridviewSpot.PageSize = Convert.ToInt32(pg.Rows[0][1].ToString()); #endregion SpotDetailsBAL sp = new SpotDetailsBAL(); ds = sp.FetchSpotDetails1(); ddlReligion.DataSource = ds.Tables[1]; ddlReligion.DataTextField = "ReligionName"; ddlReligion.DataValueField = "ReligionID"; ddlReligion.DataBind(); ddlReligion.Items.Insert(0, "==Select=="); ddlPeriod.DataSource = ds.Tables[2]; ddlPeriod.DataTextField = "Century"; ddlPeriod.DataValueField = "Century"; ddlPeriod.DataBind(); ddlPeriod.Items.Insert(0, "==Select=="); ddlBuiltBy.DataSource = ds.Tables[0]; ddlBuiltBy.DataTextField = "LPName"; ddlBuiltBy.DataValueField = "LPID"; ddlBuiltBy.DataBind(); ddlBuiltBy.Items.Insert(0, "==Select=="); ddlSanctifiedBy.DataSource = ds.Tables[5]; ddlSanctifiedBy.DataTextField = "LPName"; ddlSanctifiedBy.DataValueField = "LPID"; ddlSanctifiedBy.DataBind(); ddlSanctifiedBy.Items.Insert(0, "==Select=="); ddlSpotCategory.DataSource = ds.Tables[3]; ddlSpotCategory.DataTextField = "SpotCategoryName"; ddlSpotCategory.DataValueField = "SpotCategoryID"; ddlSpotCategory.DataBind(); ddlSpotCategory.Items.Insert(0, "==Select=="); gridviewSpot.DataSource = ds.Tables[4]; gridviewSpot.DataBind(); } }
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; } }
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 == "spotedit") { Label spotid = (Label)gridviewSpot.Rows[_selectedIndex].Cells[0].FindControl("lblGridSpotId"); DataTable editdetails = new DataTable(); SpotDetailsBAL sp = new SpotDetailsBAL(); editdetails = sp.EditSpotDetails(spotid.Text); lblSpotEdit.Text = editdetails.Rows[0][0].ToString(); txtSpotName.Text = editdetails.Rows[0][1].ToString(); txtDescription.Text = editdetails.Rows[0][2].ToString(); ddlReligion.ClearSelection(); ddlReligion.Items.FindByText(editdetails.Rows[0][3].ToString()).Selected = true; txtDeity.Text = editdetails.Rows[0][4].ToString(); ddlPeriod.ClearSelection(); ddlPeriod.Items.FindByText(editdetails.Rows[0][5].ToString()).Selected = true; ddlBuiltBy.ClearSelection(); ddlBuiltBy.Items.FindByText(editdetails.Rows[0][6].ToString()).Selected = true; txtArchitecture.Text = editdetails.Rows[0][7].ToString(); txtSculpture.Text = editdetails.Rows[0][8].ToString(); txtPainting.Text = editdetails.Rows[0][9].ToString(); txtInscription.Text = editdetails.Rows[0][10].ToString(); txtHymns.Text = editdetails.Rows[0][11].ToString(); txtMythology.Text = editdetails.Rows[0][12].ToString(); txtEvents.Text = editdetails.Rows[0][13].ToString(); txtTiming.Text = editdetails.Rows[0][14].ToString(); txtLocation.Text = editdetails.Rows[0][15].ToString(); txtSketch.Text = editdetails.Rows[0][16].ToString(); ddlSpotCategory.ClearSelection(); ddlSpotCategory.Items.FindByText(editdetails.Rows[0][17].ToString()).Selected = true; ddlSanctifiedBy.ClearSelection(); ddlSanctifiedBy.Items.FindByText(editdetails.Rows[0][18].ToString()).Selected = true; if (Convert.ToInt32(editdetails.Rows[0][19].ToString()) == 1) chkActive.Checked = true; else chkActive.Checked = false; } } }