Exemple #1
0
        void LoadContentViews()
        {
            Device.BeginInvokeOnMainThread(async() =>
            {
                // load data first
                ApiServiceIndividual apiServ = new ApiServiceIndividual();
                AnnouncementsSource          = await apiServ.GetAnnouncementsAsync();

                // setup banners here
                // need to pull from db
                SwipeSource = new List <SfRotatorItem>()
                {
                    new SfRotatorItem()
                    {
                        ItemContent = new Label {
                            Text = "tab image 1 will be here", TextColor = Color.Black
                        }, BackgroundColor = Color.Transparent
                    },
                    new SfRotatorItem()
                    {
                        ItemContent = new Label {
                            Text = "tab image 2 will be here", TextColor = Color.Black
                        }, BackgroundColor = Color.Transparent
                    },
                    new SfRotatorItem()
                    {
                        ItemContent = new Label {
                            Text = "tab image 3 will be here", TextColor = Color.Black
                        }, BackgroundColor = Color.Transparent
                    },
                    new SfRotatorItem()
                    {
                        ItemContent = new Label {
                            Text = "tab image 4 will be here", TextColor = Color.Black
                        }, BackgroundColor = Color.Transparent
                    }
                };



                AnnouncementContent = new HomePageContent();
                SetAnnouncements();
            });

            Task.Run(async() =>
            {
                ApiServiceIndividual apiServ = new ApiServiceIndividual();
                AppliedJobsSource            = await apiServ.GetAppliedJobsAsync();
                AppliedJobsContent           = new AppliedJobsContent();
            });

            Task.Run(async() =>
            {
                ApiServiceIndividual apiServ = new ApiServiceIndividual();
                MyProgramsSource             = await apiServ.GetMyProgramsAsync(); // add employer id if logged on
                MyProgramsContent            = new MyProgramsContent();

                // bind data here
            });
        }
        public ActionResult ChangeStatus(int?home_page_Content_id, int status)
        {
            ResultObject    result_object          = new ResultObject();
            HomePageContent HomePageContent_object = new HomePageContent();

            HomePageContent_object.ChangeStatus(home_page_Content_id, status, result_object);
            return(Json(result_object, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Search(int?home_page_Content_id, string searchText, int status)
        {
            ResultObject    result_object          = new ResultObject();
            HomePageContent HomePageContent_object = new HomePageContent();

            HomePageContent_object.Search(home_page_Content_id, searchText, status, result_object);
            return(Json(result_object, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Save(int hdnAddressID, string Content_text)
        {
            ResultObject    result_object          = new ResultObject();
            HomePageContent HomePageContent_object = new HomePageContent();

            HomePageContent_object.Save(hdnAddressID, Content_text, result_object);
            return(Json(result_object, JsonRequestBehavior.AllowGet));
        }
        public ActionResult HomePageContentManagement()
        {
            ResultObject    result_object          = new ResultObject();
            HomePageContent HomePagecontent_object = new HomePageContent();

            HomePagecontent_object.GetList(null, "", 1, result_object);
            return(View(HomePagecontent_object));
        }
Exemple #6
0
        public async Task <ActionResult> EditOrAddHomePageContent(HomePageContent homePageContent)
        {
            var aCopyOfDatabase = new Internship_Management_SystemEntities();

            if (db.HomePageContents.Any(h => h.HomePageContentId == homePageContent.HomePageContentId))
            {
                var thisHomePageContent = db.HomePageContents.Where(h => h.HomePageContentId == homePageContent.HomePageContentId).FirstOrDefault();
                thisHomePageContent.Content = homePageContent.Content;
                thisHomePageContent.Title   = homePageContent.Title;
            }
            else
            {
                db.HomePageContents.Add(homePageContent);
            }
            try {
                await db.SaveChangesAsync();
            }catch (Exception e)
            {
                db = aCopyOfDatabase;
            }
            return(PartialView("_HomePageContents", new HomePageContentViewModel(db.HomePageContents.ToList())));
        }
Exemple #7
0
 public void AddToHomePageContents(HomePageContent homePageContent)
 {
     base.AddObject("HomePageContents", homePageContent);
 }
Exemple #8
0
 public static HomePageContent CreateHomePageContent(int homePageContentID)
 {
     HomePageContent homePageContent = new HomePageContent();
     homePageContent.HomePageContentID = homePageContentID;
     return homePageContent;
 }