using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;

namespace Telerik.Web.Examples.Scheduler.AdvancedFormTemplate
{
	public partial class AdvancedEditForm : UserControl
	{
		protected RadScheduler Owner
		{
			get
			{
				return Appointment.Owner;
			}
		}

		protected Appointment Appointment
		{
			get
			{
				SchedulerFormContainer container = (SchedulerFormContainer) BindingContainer;
				return container.Appointment;
			}
		}

		#region Properties forwarded to AdvancedForm user control

		[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
		public string Subject
		{
			get
			{
				return AdvancedForm1.Subject;
			}

			set
			{
				AdvancedForm1.Subject = value;
			}
		}

		[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
		public DateTime Start
		{
			get
			{
				return AdvancedForm1.Start;
			}

			set
			{
				AdvancedForm1.Start = value;
			}
		}

		[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
		public DateTime End
		{
			get
			{
				return AdvancedForm1.End;
			}

			set
			{
				AdvancedForm1.End = value;
			}
		}

		[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
		public string RecurrenceRuleText
		{
			get
			{
				return AdvancedForm1.RecurrenceRuleText;
			}

			set
			{
				AdvancedForm1.RecurrenceRuleText = value;
			}
		}

		[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
		public string Description
		{
			get
			{
				return AdvancedForm1.Description;
			}

			set
			{
				AdvancedForm1.Description = value;
			}
		}

		[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
		public object RoomID
		{
			get
			{
				return AdvancedForm1.RoomID;
			}

			set
			{
				AdvancedForm1.RoomID = value;
			}
		}

		[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
		public object UserID
		{
			get
			{
				return AdvancedForm1.UserID;
			}

			set
			{
				AdvancedForm1.UserID = value;
			}
		}

		#endregion


		protected void Page_Load(object sender, EventArgs e)
		{

		}

		protected void UpdateButton_Click(object sender, EventArgs e)
		{
			// The command argument is used to indicate if the recurrence exceptions should be reset.
			UpdateButton.CommandArgument = AdvancedForm1.ResetExceptions.ToString();
		}
	}
}