Пример #1
0
        public void Delete(MedicineModel medicine)
        {
            Medicine obj;

            if (medicine.Id != 0)
            {
                obj = Medicine.Get(medicine.Id);
            }
            else
            {
                obj = Medicine.New();
            }
            _mapper.Map(medicine, obj);
            obj.Delete();
        }
Пример #2
0
        public MedicineModel Save(MedicineModel medicine)
        {
            Medicine obj;

            if (medicine.Id != 0)
            {
                obj = Medicine.Get(medicine.Id);
            }
            else
            {
                obj = Medicine.New();
            }
            _mapper.Map(medicine, obj);
            return(_mapper.Map <MedicineModel>(obj.Save()));
        }