public Item Map(ItemCreateViewModel source, Item destination)
        {
            if (source == null)
            {
                return null;
            }

            if (destination == null)
            {
                destination = new Item();
            }

            destination.SerialNumber = source.SerialNumber;
            destination.Name = source.Name;
            destination.Type = source.Type;
            destination.Length = source.Length;
            destination.Height = source.Height;
            destination.Width = source.Width;
            destination.Weight = source.Weight;


            if (destination.States == null)
            {
                destination.States = new List<State>();
            }

            return destination;
        }
        public virtual ActionResult CreateItem(bool created = false)
        {
            var model = new ItemCreateViewModel();

            model.Message = new MessageViewModel();

            if (created)
            {
                model.Message.IsError = false;
                model.Message.Message = "Naujas įrašas sukurtas sėkmingai";
            }
            

            return View(model);
        }
        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);
        }