示例#1
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)
            {
                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());
                    }
                }
            }
        }
    }
示例#2
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)
            {
                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
        }
    }
示例#3
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)
            {
                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());
                    }
                }
            }
        }
    }
示例#4
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)
            {
                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
    }
示例#5
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)
            {
                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
        }
    }