コード例 #1
0
ファイル: EditTripDetails.aspx.cs プロジェクト: ivanpyw/EADP
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         TripDAO       tripDao     = new TripDAO();
         List <String> countryList = tripDao.getCountry();
         ddlUpdateLocation.DataSource = countryList;
         ddlUpdateLocation.DataBind();
         ddlUpdateLocation.Items.Insert(0, new ListItem("--Select--", "-1"));
         int  tripId  = Convert.ToInt32(Request.QueryString["tripId"]);
         Trip tripObj = tripDao.getTripById(tripId);
         if (tripObj == null)
         {
             Response.Redirect("Oops.aspx");
         }
         else if (Session["role"].ToString() != "Incharge")
         {
             Response.Redirect("Oops.aspx");
         }
         else
         {
             tbUpdateTitle.Text = tripObj.tripTitle.ToString();
             ddlUpdateLocation.SelectedValue = tripObj.tripLocation.ToString();
             tripImage.ImageUrl          = tripObj.tripImg.ToString();
             tbUpdateStart.Text          = tripObj.tripStart.ToString("yyyy-MM-dd");
             tbUpdateEnd.Text            = tripObj.tripEnd.ToString("yyyy-MM-dd");
             tbUpdateOpeningday.Text     = tripObj.tripOpen.ToString("yyyy-MM-dd");
             tbUpdateActivities.Text     = tripObj.tripActivities;
             tbUpdateCost.Text           = tripObj.tripCost.ToString();
             DdlUpdateType.SelectedValue = tripObj.tripType.ToString();
         }
     }
 }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if ((Session["role"].ToString() == "Teacher") || (Session["role"].ToString() == "Incharge"))
                {
                    if (!IsPostBack)
                    {
                        FeedbackFormDAO     tdDAO  = new FeedbackFormDAO();
                        List <FeedbackForm> tdList = new List <FeedbackForm>();
                        tdList = tdDAO.GetAllFeedBack();
                        GridView_GetFB.DataSource = tdList;
                        GridView_GetFB.DataBind();

                        TripDAO       tripDao     = new TripDAO();
                        List <String> countryList = tripDao.getCountry();
                        CountryFilterDropDown.DataSource = countryList;
                        CountryFilterDropDown.DataBind();
                        CountryFilterDropDown.Items.Insert(0, new ListItem("All", "All"));
                    }
                }
                else
                {
                    Response.Redirect("./Oops.aspx");
                }
            }
            catch (Exception)
            {
                Response.Redirect("./Oops.aspx");
            }
        }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["role"] != null)
     {
         role = Session["role"].ToString();
         if (role == "Incharge" || role == "Teacher")
         {
             adminNo = null;
         }
         else if (role == "1" || role == "2" || role == "3")
         {
             adminNo = Session["AdminNo"].ToString();
         }
     }
     if (!IsPostBack)
     {
         tripType = Request.QueryString["tripType"];
         tripObj  = tripDao.getTrip(tripType);
         count    = tripDao.count;
         listId   = tripDao.getSignedUpTrip(adminNo);
         foreach (var i in listId)
         {
             System.Diagnostics.Debug.Write(i + "_");
         }
         List <String> countryList = tripDao.getCountry();
         ddlAddLocation.DataSource = countryList;
         ddlAddLocation.DataBind();
         ddlAddLocation.Items.Insert(0, new ListItem("--Select--", "-1"));
         if (role == "")
         {
             System.Diagnostics.Debug.WriteLine("its empty");
         }
         else if (role == null)
         {
             System.Diagnostics.Debug.WriteLine("its null");
         }
         else
         {
             System.Diagnostics.Debug.WriteLine(role);
         }
     }
 }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if ((Session["role"].ToString() == "Teacher") || (Session["role"].ToString() == "Incharge"))
                {
                    if (!IsPostBack)
                    {
                        buildBarChart("All", "All", DateTime.Parse("1-1-1753"), DateTime.Parse("1-1-9999"));
                        buildPieChart("All");
                        buildHorizontalChart("All");
                        buildLineChart("All", "All");

                        Chart1.Series[0]["PieLabelStyle"] = "Outside";
                        Chart1.Legends.Add("Legend1");
                        Chart1.Legends[0].Enabled   = true;
                        Chart1.Series[0].LegendText = "#PERCENT{P1}";



                        TripDAO       tripDao     = new TripDAO();
                        List <String> countryList = tripDao.getCountry();
                        CountryDropDown.DataSource = countryList;
                        CountryDropDown.DataBind();
                        CountryDropDown.Items.Insert(0, new ListItem("All", "All"));

                        DropDownListCountryPieChart.DataSource = countryList;
                        DropDownListCountryPieChart.DataBind();
                        DropDownListCountryPieChart.Items.Insert(0, new ListItem("All", "All"));
                    }
                }
                else
                {
                    Response.Redirect("./Oops.aspx");
                }
            }
            catch (Exception)
            {
                Response.Redirect("./Oops.aspx");
            }
        }