Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AuthenticateUser();
     intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
     oResourceRequest = new ResourceRequest(intProfile, dsn);
     if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
     {
         if (!IsPostBack)
         {
             int     intId = Int32.Parse(Request.QueryString["id"]);
             DataSet ds    = oResourceRequest.GetMilestone(intId);
             if (ds.Tables[0].Rows.Count > 0)
             {
                 txtApproved.Text    = DateTime.Parse(ds.Tables[0].Rows[0]["approved"].ToString()).ToShortDateString();
                 txtForecasted.Text  = DateTime.Parse(ds.Tables[0].Rows[0]["forecasted"].ToString()).ToShortDateString();
                 chkComplete.Checked = (ds.Tables[0].Rows[0]["complete"].ToString() == "1");
                 txtMilestone.Text   = ds.Tables[0].Rows[0]["milestone"].ToString();
                 txtDescription.Text = ds.Tables[0].Rows[0]["description"].ToString();
                 btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
                 btnSubmit.Attributes.Add("onclick", "return ValidateDate('" + txtApproved.ClientID + "','Please enter a valid date') && ValidateDate('" + txtForecasted.ClientID + "','Please enter a valid date') && ValidateText('" + txtMilestone.ClientID + "','Please enter a milestone');");
                 imgApproved.Attributes.Add("onclick", "return OpenCalendar('" + txtApproved.ClientID + "');");
                 imgForecasted.Attributes.Add("onclick", "return OpenCalendar('" + txtForecasted.ClientID + "');");
             }
         }
     }
 }