コード例 #1
0
ファイル: Page6.aspx.cs プロジェクト: ARHimes78/CIS2284
    protected void Page_Load(object sender, EventArgs e)
    {
        survey = new SurveyInput();

        rvCalendar.MinimumValue = DateTime.Now.AddDays(1).ToShortDateString();
        rvCalendar.MaximumValue = DateTime.Now.AddDays(10).ToShortDateString();
    }
コード例 #2
0
        private void populateTable(SurveyInput si)
        {
            SqlDataSource1.InsertParameters["name"].DefaultValue = si.Name;
            SqlDataSource1.InsertParameters["band"].DefaultValue = si.Band;
            SqlDataSource1.InsertParameters["season"].DefaultValue = ppSurvey.Season;
            SqlDataSource1.InsertParameters["yesno"].DefaultValue = ppSurvey.YesNo;
            SqlDataSource1.InsertParameters["colors"].DefaultValue = ppSurvey.Colors;
            SqlDataSource1.InsertParameters["matter"].DefaultValue = ppSurvey.Matter;
            SqlDataSource1.InsertParameters["date"].DefaultValue = ppSurvey.Date.ToShortDateString();

            SqlDataSource1.Insert();
        }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         ppSurvey = PreviousPage.survey;
         populateTable(ppSurvey);
         lblSummary.Text = ppSurvey.ToString();
         imgUploaded.ImageUrl = "/Images/" + ppSurvey.ImgUrl;
     }
     catch (NullReferenceException nre)
     {
         lblSummary.Text = "WARNING: Table not updated from survey data.";
         imgUploaded.ImageUrl = "/Images/no_image.png";
     }
 }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //TODO: -5 need to check to make sure you have a valid previous page. RJG
     if (PreviousPage!=null && PreviousPage.IsValid)
     {
         try
         {
             ppSurvey = PreviousPage.survey;
             populateTable(ppSurvey);
             lblSummary.Text = ppSurvey.ToString();
             imgUploaded.ImageUrl = "/Images/" + ppSurvey.ImgUrl;
         }
         catch (NullReferenceException nre)
         {
             lblSummary.Text = "WARNING: Table not updated from survey data.";
             imgUploaded.ImageUrl = "/Images/no_image.png";
         }
     }
     else
     {
         //TODO: -3 does not redirect to previous page when data invalid or not avaialble. RJG
         Response.Redirect("ValidationPage.aspx");
     }
 }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (PreviousPage!=null && PreviousPage.IsValid)
            {
                try
                {
                    ppSurvey = PreviousPage.survey;
                    populateTable(ppSurvey);
                    lblSummary.Text = ppSurvey.ToString();
                    imgUploaded.ImageUrl = "/Images/" + ppSurvey.ImgUrl;

                }
                catch (NullReferenceException)
                {
                    lblSummary.Text = "WARNING: Table not updated from survey data.";
                    imgUploaded.ImageUrl = "/Images/no_image.png";
                }
            }
            else
            {
                if (!Page.IsPostBack)
                    Response.Redirect("Page6.aspx");
            }
        }