public ResponseDto Delete(FicheDeleteDto deleteDto) { ResponseDto responseDto = new ResponseDto(); FicheDeleteBo deleteBo = new FicheDeleteBo() { FicheId = deleteDto.FicheId, Session = Session }; ResponseBo responseBo = ficheBusiness.Delete(deleteBo); responseDto = responseBo.ToResponseDto(); base.SendNotifyWsToList(responseBo.PersonNotifyList); return(responseDto); }
public ResponseBo Delete(FicheDeleteBo deleteBo) { ResponseBo responseBo = new ResponseBo(); try { using (SqlConnection conn = DbAccess.Connection.GetConn()) { var p = new DynamicParameters(); p.Add("@Message", dbType: DbType.String, direction: ParameterDirection.Output, size: 255); p.Add("@IsSuccess", dbType: DbType.Boolean, direction: ParameterDirection.Output); p.Add("@NotifyPersonListJson", dbType: DbType.String, direction: ParameterDirection.Output, size: 1000); p.Add("@FicheId", deleteBo.FicheId, DbType.Int64, ParameterDirection.Input); p.Add("@MyPersonId", deleteBo.Session.MyPerson.Id, DbType.Int64, ParameterDirection.Input); p.Add("@OperatorRealId", deleteBo.Session.RealPerson.Id, DbType.Int64, ParameterDirection.Input); p.Add("@LanguageId", deleteBo.Session.RealPerson.LanguageId, DbType.Int32, ParameterDirection.Input); p.Add("@Inner", false, DbType.Boolean, ParameterDirection.Input); // true means called inside db. conn.Execute("spFicheDel", p, commandType: CommandType.StoredProcedure); responseBo.Message = p.Get <string>("@Message"); responseBo.IsSuccess = p.Get <bool>("@IsSuccess"); string NotifyPersonListJson = p.Get <string>("@NotifyPersonListJson"); if (NotifyPersonListJson.IsNotNull()) { responseBo.PersonNotifyList = JsonConvert.DeserializeObject <List <PersonNotifyListBo> >(NotifyPersonListJson); } } } catch (Exception ex) { responseBo = base.SaveExLog(ex, this.GetType(), MethodBase.GetCurrentMethod().Name, deleteBo); } return(responseBo); }