Exemple #1
0
        private void BindData()
        {
            // connect to database
            DatabaseDataContext db = new DatabaseDataContext();

            // fetch current schedule
            Schedule schedule = db.Schedules.SingleOrDefault(z => z.ID == new Guid(Request.QueryString["id"]));

            // set form properties
            this.txtName.Text           = schedule.Name;
            this.txtOccurrence.Text     = schedule.Occurrence;
            this.txtEndpoint.Text       = schedule.Endpoint;
            this.txtNextOccurrence.Text = schedule.NextOccurrence.ToString();

            this.lnkInformation.NavigateUrl = "~/information.aspx?id=" + schedule.ID;

            // fetch last information
            Common.Information information = schedule.Informations.OrderByDescending(z => z.CreatedDate).FirstOrDefault();

            if (information != null)
            {
                // set form properties
                this.lblLastOccurrence.Text = "This job was last executed on " + information.CreatedDate.ToString();
                if (information.Result == 200)
                {
                    this.lblLastStatus.Text = "succeeded with a status code of " + information.Result.ToString();
                }
                else
                {
                    this.lblLastStatus.Text = "failed with a status code of " + information.Result.ToString();
                }
            }
            else
            {
                this.lblLastOccurrence.Text = "This job has not been excuted";
                this.lblLastStatus.Text     = "does not have a status yet";
            }

            // close connection
            db.Dispose();
        }
		private void detach_Informations(Information entity)
		{
			this.SendPropertyChanging();
			entity.Schedule = null;
		}
 partial void DeleteInformation(Information instance);
 partial void UpdateInformation(Information instance);
 partial void InsertInformation(Information instance);