예제 #1
0
        /// <summary>
        /// Constructor, initialize the components.
        /// </summary>
        public Uploading()
        {
            this.InitializeComponent();

            ctx            = new CloudEDUEntities(new Uri(Constants.DataServiceURI));
            addImageButton = imageAddButton;
        }
예제 #2
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;

            ctx = new CloudEDUEntities(new Uri(Constants.DataServiceURI));
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Login"/> class.
        /// </summary>
        public Login()
        {
            this.InitializeComponent();

            //emptyUsername = InputUsername.Text;
            ctx = new CloudEDUEntities(new Uri(Constants.DataServiceURI));
        }
예제 #4
0
        /// <summary>
        /// Constructor, initialize the components
        /// </summary>
        public Courstore()
        {
            this.InitializeComponent();
            ctx = new CloudEDUEntities(new Uri(Constants.DataServiceURI));

            var appBarContent = globalAppBar.Content as AppbarContent;

            appBarContent.advanceSearchButton.Visibility = Visibility;
            appBarContent.advanceSearchButton.Click     += AdvanceSearchButton_Click;
        }
예제 #5
0
        /// <summary>
        /// Constructor, initilize the components.
        /// </summary>
        public Lecture()
        {
            this.InitializeComponent();
            ctx = new CloudEDUEntities(new Uri(Constants.DataServiceURI));
            dba = new DBAccessAPIs();

            allLessons = new List <LESSON>();

            Res_URL = new Dictionary <Image, string>();
            Img_Lsn = new Dictionary <Image, int>();
        }
예제 #6
0
        /// <summary>
        /// Setups this instance.
        /// </summary>
        private void Setup()
        {
            ctx = new CloudEDUEntities(new Uri(Constants.DataServiceURI));
            SetUser();
            UserSelButtonControl bt = new UserSelButtonControl();

            bt.user   = Constants.User;
            bt.Click += Button_Click;
            UsersStack.Children.Insert(0, bt);
            //test.user = new User("Fox", "http://www.gravatar.com/avatar/3c2986ad7ac1f2230ea3596f44563328");
            //test.UserName = test.user.NAME;
        }
예제 #7
0
        /// <summary>
        /// Handles the 1 event of the LogoutButton_Click control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private async void LogoutButton_Click_1(object sender, RoutedEventArgs e)
        {
            ((Frame)Window.Current.Content).Navigate(typeof(Login.LoginSel));
            string courseUplaodUri = "/AddDBLog?opr='Logout'&msg='" + Constants.User.NAME + "'";
            //ctx.UpdateObject(c);
            CloudEDUEntities ctx = new CloudEDUEntities(new Uri(Constants.DataServiceURI));

            try
            {
                TaskFactory <IEnumerable <bool> > tf = new TaskFactory <IEnumerable <bool> >();
                IEnumerable <bool> result            = await tf.FromAsync(ctx.BeginExecute <bool>(new Uri(courseUplaodUri, UriKind.Relative), null, null), iar => ctx.EndExecute <bool>(iar));
            }
            catch
            {
            }
        }
예제 #8
0
            /// <summary>
            /// Gets all learned.
            /// </summary>
            public async static void GetAllLearned()
            {
                if (LearnedCourses == null)
                {
                    LearnedCourses = new List <COURSE_AVAIL>();

                    CloudEDUEntities ctx = new CloudEDUEntities(new Uri(Constants.DataServiceURI));
                    TaskFactory <IEnumerable <COURSE_AVAIL> > tf = new TaskFactory <IEnumerable <COURSE_AVAIL> >();

                    IEnumerable <COURSE_AVAIL> attends = await tf.FromAsync(ctx.BeginExecute <COURSE_AVAIL>(
                                                                                new Uri("/GetAllCoursesAttendedByCustomer?customer_id=" + Constants.User.ID, UriKind.Relative), null, null),
                                                                            iar => ctx.EndExecute <COURSE_AVAIL>(iar));

                    foreach (var ca in attends)
                    {
                        LearnedCourses.Add(ca);
                    }
                }
            }
예제 #9
0
        /// <summary>
        /// Sets the attend teach number.
        /// </summary>
        public async void SetAttendTeachNumber()
        {
            try
            {
                ctx      = new CloudEDUEntities(new Uri(Constants.DataServiceURI));
                teachDsq = (DataServiceQuery <COURSE_AVAIL>)(from course in ctx.COURSE_AVAIL
                                                             where course.TEACHER_NAME == this.NAME
                                                             select course);
                TaskFactory <IEnumerable <COURSE_AVAIL> > tf = new TaskFactory <IEnumerable <COURSE_AVAIL> >();
                IEnumerable <COURSE_AVAIL> attends           = await tf.FromAsync(ctx.BeginExecute <COURSE_AVAIL>(
                                                                                      new Uri("/GetAllCoursesAttendedByCustomer?customer_id=" + this.ID, UriKind.Relative), null, null),
                                                                                  iar => ctx.EndExecute <COURSE_AVAIL>(iar));

                ATTEND_COUNT = attends.Count();
                IEnumerable <COURSE_AVAIL> teaches = await tf.FromAsync(teachDsq.BeginExecute(null, null), iar => teachDsq.EndExecute(iar));

                TEACH_COUNT = teaches.Count();
            }
            catch
            {
                ShowMessageDialog("Set Attend Teach Number ");
            }
        }
예제 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Profile"/> class.
 /// </summary>
 public Profile()
 {
     this.InitializeComponent();
     ctx = new CloudEDUEntities(new Uri(Constants.DataServiceURI));
 }
예제 #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DBAccessAPIs"/> class.
 /// </summary>
 public DBAccessAPIs()
 {
     ctx = new CloudEDUEntities(new Uri(Constants.DataServiceURI));
 }
예제 #12
0
 /// <summary>
 /// Constructor, initialize the components
 /// </summary>
 public CourseOverview()
 {
     this.InitializeComponent();
     ctx = new CloudEDUEntities(new Uri(Constants.DataServiceURI));
     dba = new DBAccessAPIs();
 }