public int Add(SingerDto model) { model.CreateTime = DateTime.Now; model.IsDel = false; var entity = Mapper.Map<Singer>(model); if (!string.IsNullOrEmpty(model.Name)) { //entity.Image = BllHelper.RemoveImg(_rootpath, entity.Image); model.Image = entity.Image; } return _singerRepository.Insert(entity); }
public bool Update(SingerDto model) { model.CreateTime = DateTime.Now; model.IsDel = false; return _singerRepository.Update(Mapper.Map<Singer>(model)); }
public JsonResult Singer_Edit(SingerDto model) { var result = _singerService.Update(model); return ReturnJson(result, JsonMsg.Error_Edit); }
public JsonResult Singer_Add(SingerDto model) { var result = _singerService.Add(model); return ReturnJson(result > 0, JsonMsg.Error_Add); }