Ejemplo n.º 1
0
        public JsonResult Save(DrugBrandViewModel model)
        {
            int saveIndex = 0;

            var _drugBrand = new DrugBrand();

            _drugBrand.BrandId     = model.BrandId;
            _drugBrand.Name        = model.Name;
            _drugBrand.Preparation = model.Preparation;
            _drugBrand.GenericId   = model.GenericId;
            saveIndex = model.BrandId == 0 ? DrugBrandManager.SaveDrugBrand(_drugBrand) : DrugBrandManager.EditDrugBrand(_drugBrand);
            //return saveIndex > 0 ? Reload(saveIndex) : ErroeMessageResult();
            return(Reload(saveIndex));
        }