示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                CatergoriesID cat = new CatergoriesID();
                categoryList = cat.GetAll();

                DataListCategory.DataSource = categoryList;
                DataListCategory.DataBind();

                if (Session["catid"] != null)
                {
                    int Catid = Convert.ToInt32(Session["catid"]);


                    Place pl = new Place();
                    placeList = pl.GetAllPlacesByCat(Catid);

                    DataListPlaces.DataSource = placeList;
                    DataListPlaces.DataBind();
                }
                else
                {
                    Place pl = new Place();
                    placeList = pl.GetAllPlaces();

                    DataListPlaces.DataSource = placeList;
                    DataListPlaces.DataBind();
                }
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                CatergoriesID cat = new CatergoriesID();
                categoryList = cat.GetAll();

                DataListCategory.DataSource = categoryList;
                DataListCategory.DataBind();

                if (Session["catid"] != null)
                {
                    int Catid = Convert.ToInt32(Session["catid"]);
                    Label13.Text = Catid.ToString();

                    Activity ac = new Activity();
                    activityList = ac.GetAllActivityByCategory(Catid);

                    DataListActivity.DataSource = activityList;
                    DataListActivity.DataBind();
                }
                else
                {
                }
            }
        }
示例#3
0
        public void BindData()
        {
            CatergoriesID cat = new CatergoriesID();

            categoryList = cat.GetAll();

            GridViewCat.DataSource = categoryList;
            GridViewCat.DataBind();
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                CatergoriesID cat = new CatergoriesID();
                categoryList = cat.GetAll();

                DataListCategory.DataSource = categoryList;
                DataListCategory.DataBind();
            }
        }
示例#5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                CatergoriesID cc = new CatergoriesID();
                catList = cc.GetAll();

                category.Items.Clear();
                category.Items.Insert(0, new ListItem("--Select--", "0"));
                category.AppendDataBoundItems = true;
                category.DataTextField        = "CatName";
                category.DataValueField       = "CatId";
                category.DataSource           = catList;
                category.DataBind();
            }
        }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                Place pl = new Place();
                plList = pl.GetAllPlaces();

                DataListPlaces.DataSource = plList;
                DataListPlaces.DataBind();

                CatergoriesID cat = new CatergoriesID();
                categoryList = cat.GetAll();

                DataListCategory.DataSource = categoryList;
                DataListCategory.DataBind();
            }
        }
示例#7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack == false)
     {
         CatergoriesID cc = new CatergoriesID();
         catList = cc.GetAll();
         category.Items.Clear();
         category.Items.Insert(0, new ListItem("--Select--", "0"));
         category.AppendDataBoundItems = true;
         category.DataTextField        = "CatName";
         category.DataValueField       = "CatId";
         category.DataSource           = catList;
         category.DataBind();
         if (Session["ActId"] != null)
         {
             int acid = Convert.ToInt32(Session["ActId"]);
             lblAcId.Text = acid.ToString();
             Activity ac = new Activity();
             ac = ac.RetrieveOne(acid);
             if (ac != null)
             {
                 AName.Text             = ac.AName;
                 ADesc.Text             = ac.ADesc;
                 ALocation.Text         = ac.ALocation;
                 category.SelectedValue = ac.CatId.ToString();
                 string img = ac.ImagePath;
                 img            = img.Replace("~/uploads/", "");
                 imgName.Text   = img;
                 APrice.Text    = ac.APrice;
                 AProvided.Text = ac.AProvided;
                 ABring.Text    = ac.ABring;
             }
             else
             {
                 Response.Redirect("AddActivity.aspx");
             }
         }
         else
         {
             Response.Redirect("AddActivity.aspx");
         }
     }
 }
示例#8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                CatergoriesID cc = new CatergoriesID();
                catList = cc.GetAll();

                category.Items.Clear();
                category.Items.Insert(0, new ListItem("--Select--", "0"));
                category.AppendDataBoundItems = true;
                category.DataTextField        = "CatName";
                category.DataValueField       = "CatId";
                category.DataSource           = catList;
                category.DataBind();
                if (Session["PlaceId"] != null)
                {
                    int   id = Convert.ToInt32(Session["PlaceId"]);
                    Place pl = new Place();
                    pl = pl.retrieveOne(id);
                    if (pl != null)
                    {
                        Pname.Text             = pl.PName;
                        PDesc.Text             = pl.PDesc;
                        PLocation.Text         = pl.PLocation;
                        category.SelectedValue = pl.CatId.ToString();
                        region.SelectedValue   = pl.Region;
                        string img = pl.ImagePath;
                        img          = img.Replace("~/uploads/", "");
                        imgName.Text = img;
                    }
                    else
                    {
                        Response.Redirect("~/Views/Places/AddPlace.aspx");
                    }
                }
                else
                {
                    Response.Redirect("~/Views/Places/AddPlace.aspx");
                }
            }
        }
示例#9
0
        protected void BtnSearch_Click(object sender, EventArgs e)
        {
            string substring = TextBoxSearch.Text;

            if (substring == "")
            {
                CatergoriesID cat = new CatergoriesID();
                categoryList = cat.GetAll();

                DataListCategory.DataSource = categoryList;
                DataListCategory.DataBind();
            }
            else
            {
                CatergoriesID cat = new CatergoriesID();
                categoryList = cat.GetBySearch(substring);

                DataListCategory.DataSource = categoryList;
                DataListCategory.DataBind();
            }
        }