public ActionResult DeletePurchase(string id, string version)
        {
            var request = new PurchaseViewModel { Id = id.ToGuidOrDefault(), Version = version.ToIntOrDefault() };
            var success = GetCommand<DeletePurchaseCommand>().ExecuteCommand(request);
            if (success)
            {
                if (!request.Id.HasDefaultValue())
                {
                    Messages.AddSuccess(SalesGlobalization.DeletePurchase_DeletedSuccessfully_Message);
                }
            }

            return WireJson(success);
        }
        public ActionResult SavePurchase(PurchaseViewModel model)
        {
            var success = false;
            PurchaseViewModel response = null;
            if (ModelState.IsValid)
            {
                response = GetCommand<SavePurchaseCommand>().ExecuteCommand(model);
                if (response != null)
                {
                    if (model.Id.HasDefaultValue())
                    {
                        Messages.AddSuccess(SalesGlobalization.CreatePurchase_CreatedSuccessfully_Message);
                    }

                    success = true;
                }
            }

            return WireJson(success, response);
        }