Exemplo n.º 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();
        }
Exemplo n.º 2
0
		private void detach_Informations(Information entity)
		{
			this.SendPropertyChanging();
			entity.Schedule = null;
		}
Exemplo n.º 3
0
 partial void DeleteInformation(Information instance);
Exemplo n.º 4
0
 partial void UpdateInformation(Information instance);
Exemplo n.º 5
0
 partial void InsertInformation(Information instance);