public ResponseBo Save(ApprovalRelationSaveBo saveBo) { 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("@ApprovalRelationId", saveBo.ApprovalRelationId, DbType.Int64, ParameterDirection.Input); p.Add("@PersonRelationId", saveBo.PersonRelationId, DbType.Int64, ParameterDirection.Input); p.Add("@ApprovalStatId", saveBo.ApprovalStatId, DbType.Int32, ParameterDirection.Input); p.Add("@MyPersonId", saveBo.Session.MyPerson.Id, DbType.Int64, ParameterDirection.Input); p.Add("@OperatorRealId", saveBo.Session.RealPerson.Id, DbType.Int64, ParameterDirection.Input); p.Add("@LanguageId", saveBo.Session.RealPerson.LanguageId, DbType.Int32, ParameterDirection.Input); conn.Execute("spApprovalRelationSave", 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, saveBo); } return(responseBo); }
public ResponseDto Save(ApprovalRelationSaveDto saveDto) { ResponseDto responseDto = new ResponseDto(); ApprovalRelationSaveBo saveBo = new ApprovalRelationSaveBo() { ApprovalRelationId = saveDto.ApprovalRelationId, PersonRelationId = saveDto.PersonRelationId, ApprovalStatId = saveDto.ApprovalStatId, Session = Session }; ResponseBo responseBo = approvalRelationBusiness.Save(saveBo); base.UpdateMyPersonIdList(); base.SendNotifyWsToList(responseBo.PersonNotifyList); responseDto = responseBo.ToResponseDto(); return(responseDto); }