Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //LOGIN and EVENT SELECT check
        if (Session["UserName"] == null)
        {
            Response.Redirect("MainPage.aspx");
        }
        else if (Session["EventId"] == null)
        {
            Response.Redirect("EventList.aspx");
        }

        Session["ShowSelectedEvent"] = "true";

        bl               = new EventerBL();
        guestList        = bl.generateEventGuestList(Session["UserName"].ToString(), Convert.ToInt32(Session["EventId"].ToString()));
        allUserGuestList = bl.getGuestList(Session["UserName"].ToString());
        if (!this.IsPostBack)
        {
            refreshGroupDropDownList();
            refreshExistGuestDropDownList();

            DataTable dt = new DataTable();
            dt.Columns.AddRange(new DataColumn[5]
            {
                new DataColumn("id", typeof(int)),
                new DataColumn("first_name", typeof(string)),
                new DataColumn("last_name", typeof(string)),
                new DataColumn("phone", typeof(string)),
                new DataColumn("group", typeof(string))
            });


            if (guestList.Count > 0)
            {
                int i = 1;
                foreach (Guest guestFromList in guestList)
                {
                    dt.Rows.Add(i++, guestFromList.FirstName, guestFromList.LastName, guestFromList.Phone, guestFromList.GroupName);
                }
            }
            else
            {
                No_Guest_LBL.Text = "No Guests To Show!";
            }
            Guest_list_GridView.DataSource = dt;
            Guest_list_GridView.DataBind();
        }
    }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //LOGIN and GROUP SELECT check
        if (Session["UserName"] == null)
        {
            Response.Redirect("MainPage.aspx");
        }

        Session["ShowSelectedEvent"] = "true";

        bl        = new EventerBL();
        groupList = bl.getGroupList(Session["UserName"].ToString());

        if (!this.IsPostBack)
        {
            createGroupTable();
        }
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserName"] == null)
        {
            Response.Redirect("MainPage.aspx");
        }
        bl = new EventerBL();
        Session["ShowSelectedEvent"] = "true";
        eventList = bl.getEventList(Session["UserName"].ToString());

        if (!this.IsPostBack)
        {
            DataTable dt = new DataTable();
            dt.Columns.AddRange(new DataColumn[6]
            {
                new DataColumn("id", typeof(int)),
                new DataColumn("event_name", typeof(string)),
                new DataColumn("event_type", typeof(string)),
                new DataColumn("event_date", typeof(string)),
                new DataColumn("number_of_guests", typeof(string)),
                new DataColumn("event_location", typeof(string))
            });


            if (eventList.Count > 0)
            {
                int i = 1;
                foreach (Event ev in eventList)
                {
                    dt.Rows.Add(i++, ev.Name, ev.Type, ev.Date, ev.NumOfGuests, ev.Location);
                }
            }
            else
            {
                No_Events_LBL.Text = "No Events To Show!";
            }
            Event_list_GridView.DataSource = dt;
            Event_list_GridView.DataBind();
        }
    }
Esempio n. 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     bl = new EventerBL();
     Session["ShowSelectedEvent"] = "false";
 }