protected override void CreateKeyParameters(BusinessObject businessObject, System.Data.IDbCommand cmd) { NotaInutilizada nota = (NotaInutilizada)businessObject; DALObject.CreateParameter(cmd, "@CNPJ", System.Data.DbType.String, nota.empresa); DALObject.CreateParameter(cmd, "@NumeroNota", System.Data.DbType.String, nota.numeroNota); DALObject.CreateParameter(cmd, "@SerieNota", System.Data.DbType.String, nota.serieNota); }
public override void SetKey(BusinessObject businessObject) { NotaInutilizada nota = (NotaInutilizada)businessObject; numeroNota = nota.numeroNota; empresa = nota.empresa; serieNota = nota.serieNota; }
protected override void CreateInsertParameters(BusinessObject businessObject, System.Data.IDbCommand cmd) { NotaInutilizada nota = (NotaInutilizada)businessObject; CreateKeyParameters(businessObject, cmd); DALObject.CreateParameter(cmd, "@Data", System.Data.DbType.DateTime, nota.data); DALObject.CreateParameter(cmd, "@XMLResposta", System.Data.DbType.String, nota.XMLResposta); DALObject.CreateParameter(cmd, "@XMLPedido", System.Data.DbType.String, nota.XMLPedido); }
protected override void DataReaderToPersistentObject(System.Data.IDataReader dataReader, BusinessObject businessObject, string radical) { NotaInutilizada nota = (NotaInutilizada)businessObject; nota.BeginInit(); try { nota.empresa = Utils.FieldAsString(dataReader, "CNPJ"); nota.numeroNota = Utils.FieldAsString(dataReader, "numeroNota"); nota.serieNota = Utils.FieldAsString(dataReader, "SerieNota"); nota.data = Utils.FieldAsDateTime(dataReader, "data"); nota.XMLPedido = Utils.FieldAsString(dataReader, "XMLPedido"); nota.XMLResposta = Utils.FieldAsString(dataReader, "XMLResposta"); nota.isRecorded = true; nota.isModified = false; } finally { nota.EndInit(); } }