Ejemplo n.º 1
0
        public async Task <ActionResult> MakeActive()
        {
            return(await Task.Run(() =>
            {
                var list = new NewsActivationlList();
                list.Message = "Select news and click on submit to make active.";
                list.ActivationlList = new List <NewsActivation>();

                var newsBL = new StateNewsBL();
                var result = newsBL.SelectToActive();
                result.ToList().ForEach(v =>
                {
                    list.ActivationlList.Add(
                        new NewsActivation
                    {
                        Selected = false,
                        TopNewsID = v.NewsID,
                        StateCode = v.StateCode,
                        StateName = v.StateName,
                        ImageUrl = v.ImageUrl,
                        IsActive = v.IsActive,
                        IsTopNews = v.IsTopNews,
                        Heading = v.Heading,
                        DttmCreated = v.DttmCreated
                    });
                });

                return View(list);
            }));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> NeedApproval()
        {
            return(await Task.Run(() =>
            {
                var list = new NewsApprovalList();
                list.Message = "Select news to approve.";
                list.ApprovalList = new List <NewsApproval>();

                var newsBL = new StateNewsBL();
                var result = newsBL.SelectToApprove();
                result.ToList().ForEach(v =>
                {
                    list.ApprovalList.Add(
                        new NewsApproval
                    {
                        Selected = false,
                        TopNewsID = v.NewsID,
                        StateCode = v.StateCode,
                        StateName = v.StateName,
                        ImageUrl = v.ImageUrl,
                        IsApproved = v.IsApproved,
                        IsTopNews = v.IsTopNews,
                        Heading = v.Heading,
                        DttmCreated = v.DttmCreated
                    });
                });

                return View(list);
            }));
        }