public ActionResult Edit(OrganizationModel model)
        {
            var organization = _organizationRepository.GetById(model.Id);

            if (ModelState.IsValid)
            {
                organization = model.ToEntity(organization);
                //always set IsNew to false when saving
                organization.IsNew = false;
                _organizationRepository.Update(organization);

                // save settings
                _settingService.SaveSetting(new InventorySettings {
                    CostingType = (int?)model.CostingType
                });

                //commit all changes
                this._dbContext.SaveChanges();

                //notification
                SuccessNotification(_localizationService.GetResource("Record.Saved"));
                return(new NullJsonResult());
            }
            else
            {
                return(Json(new { Errors = ModelState.SerializeErrors() }));
            }
        }