예제 #1
0
 public ActionResult AddTags(TagRegisterModel model)
 {
     if (ModelState.IsValid)
     {
         if (tagServices.AddTag(model) != Guid.Empty)
         {
             return(Redirect("Tags"));
         }
         return(HttpNotFound());
     }
     else
     {
         return(View(model));
     }
 }
예제 #2
0
 public Guid AddTag(TagRegisterModel model)
 {
     try
     {
         var result = new Tags()
         {
             TagName  = model.TagName,
             TagType  = model.TagType,
             IsActive = true,
         };
         unitOfWork.TagRepo.Insert(result);
         if (unitOfWork.Save() > 0)
         {
             return(result.Id);
         }
         return(Guid.Empty);
     }
     catch (Exception)
     {
         throw;
     }
 }