public ResponseDto Delete(PersonRelationDeleteDto deleteDto) { ResponseDto responseDto = new ResponseDto(); PersonRelationDeleteBo deleteBo = new PersonRelationDeleteBo() { PersonRelationId = deleteDto.PersonRelationId, PersonId = deleteDto.PersonId, Session = Session }; ResponseBo responseBo = personRelationBusiness.Delete(deleteBo); base.UpdateMyPersonIdList(); base.SendNotifyWsToList(responseBo.PersonNotifyList); responseDto = responseBo.ToResponseDto(); return(responseDto); }
public ResponseBo Delete(PersonRelationDeleteBo 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("@PersonRelationId", deleteBo.PersonRelationId, DbType.Int64, ParameterDirection.Input); p.Add("@PersonId", deleteBo.PersonId, 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); conn.Execute("spPersonRelationDel", 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); }