示例#1
0
        public override void Prepare(IMvxBundle parameters)
        {
            base.Prepare(parameters);

            VmNavigationType = NavigationType.Push;

            ContentVm = (IContentSearchInternalViewModel)Activator.CreateInstance(LookupService.Resolve <IContentSearchInternalViewModel>());
            ContentVm.Prepare(new BaseBundle(NavigationType.InsideScreen));
        }
示例#2
0
        /// <summary>
        /// Contacts
        /// </summary>
        /// <param name="Name"></param>
        /// <param name="Email"></param>
        /// <param name="Subject"></param>
        /// <param name="Message"></param>
        /// <returns></returns>

        public ActionResult Contact(string Name, string Email, string Subject, string Message)
        {
            ContentVm cont = new ContentVm()
            {
                Contact = db.Contacts.ToList()
            };

            return(View(cont));
        }
示例#3
0
        // GET: Home
        public ActionResult Index()
        {
            ContentVm vm = new ContentVm()
            {
                SliderList = db.Sliders.OrderByDescending(s => s.Id).Take(4).OrderBy(s => s.Id).ToList(),
                //Products = db.Products.OrderByDescending(p => p.Id).Take(8).OrderBy(p => p.Id).ToList(),
                Products = db.Products.OrderByDescending(x => Guid.NewGuid()).Take(8).ToList(),
                Blogs    = db.Blog.OrderByDescending(x => x.Id).Take(3).OrderBy(x => x.Id).ToList(),
            };

            return(View(vm));
        }
示例#4
0
        public IActionResult Post(ContentVm model)
        {
            var content = _context.Content.FirstOrDefault(c => c.Key == model.Key);

            if (content != null)
            {
                var contentText = _context.ContentText.FirstOrDefault(t => t.ContentId == content.Id);
                if (contentText != null)
                {
                    contentText.Text = model.Value;
                    _context.ContentText.Add(contentText);
                    _context.Entry(contentText).State = EntityState.Modified;
                    _context.SaveChanges();
                    return(Ok(model));
                }
            }
            return(BadRequest("Unable to update content"));
        }
示例#5
0
        public override Task Initialize()
        {
            ContentVm.Initialize();

            return(LoadContent());
        }
 private void Map(IContent src, ContentVm vm, MapperContext arg3)
 {
     vm.Id   = src.Id;
     vm.Name = src.Name;
 }
示例#7
0
 public IActionResult Post(ContentVm model)
 {
     throw new NotImplementedException();
 }