Esempio n. 1
0
        public async Task <IActionResult> CreateUrl(CreateUrlViewModel model)
        {
            var user = await userManager.FindByNameAsync(User.Identity.Name);

            if (ModelState.IsValid)
            {
                LHUrl lHUrl = new LHUrl()
                {
                    UrlTitle    = model.UrlTitle,
                    LHUrlName   = model.LHUrlName,
                    Description = model.Description,
                    CategoryId  = model.CategoryId,
                    IsApproved  = false,
                    Id          = user.Id
                };
                LHUrlBs.Create(lHUrl);
                return(RedirectToAction("CreateUrl"));
            }
            ViewBag.Categories = CategoryBs.GetAll();
            return(View());
        }
Esempio n. 2
0
 public bool Update(LHUrl LHUrl)
 {
     LHDbContext.Update <LHUrl>(LHUrl);
     LHDbContext.SaveChanges();
     return(true);
 }
Esempio n. 3
0
 public bool Create(LHUrl LHUrl)
 {
     LHDbContext.Add(LHUrl);
     LHDbContext.SaveChanges();
     return(true);
 }
Esempio n. 4
0
 public bool Update(LHUrl LHUrl)
 {
     return(LHUrlDb.Update(LHUrl));
 }
Esempio n. 5
0
 public bool Create(LHUrl LHUrl)
 {
     return(LHUrlDb.Create(LHUrl));
 }