public virtual ActionResult Delete(int id, string returnUrl)
        {
            var content = string.Empty;
            var success = true;
            var model = new MessageViewModel {IsError = true, Message = string.Empty};

            
            if (id > 0)
            {
                try
                {
                    var user = userService.GetUserById(id);

                    if (user != null)
                    {
                        userService.Delete(id);
                    }
                    else
                    {
                        model.Message = "Nepavyko ištrinti, vartotojas nerastas";
                        success = false;     
                    }

                }
                catch (Exception ex)
                {
                    model.Message = "Trinant įvyko klaida, bandykite dar kartą";
                    success = false;
                }

            }
            else
            {
                model.Message = "Nepavyko ištrinti, vartotojas nerastas";
                success = false;         
            }

            if (!success)
            {
                content = this.RenderPartialView(MVC.Shared.Views.Partial.Message, model);
            }

            return Json(new
                {
                    Success = success,
                    Content = content
                });
                  
        }
 public ItemEditViewModel()
 {
     Message = new MessageViewModel();
 }
 public ItemCreateViewModel()
 {
     Message = new MessageViewModel();
 }
 public UserViewModel()
 {
     Message = new MessageViewModel();
 }
        public virtual ActionResult CreateItem(ItemCreateViewModel model)
        {
            var message = new MessageViewModel
                        {
                            IsError = false,
                            Message = string.Empty
                        };

            if (model != null && ModelState.IsValid)
            {
                try
                {
                    var item = ViewModelToEntityMapper.Mapper.Map(model, new Item());

                    var savedItem = itemService.Create(item);

                    return RedirectToAction(MVC.Item.CreateItem(true));

                }
                catch (Exception ex)
                {
                    message.IsError = true;
                    message.Message = "Sukuriant naują įrašą įvyko klaida, bandykite dar kartą";
                }

            }

            model = model ?? new ItemCreateViewModel(); 
            model.Message = message;

            return View(model);
        }