readMessage() public method

Mark a message as read in the Addressee table. Set the ReadDate property to current timestamp toggle the date on. Or, set the ReadDate property to a new DateTime() - year of 1 - to toggle the read date off
This function retrieves the message ID from the row that is updated. It does this so as not to put the burden on the consuming client application to pass the message ID value. This should make it less confusing which identifier is which and therefore the service easier to consume
public readMessage ( Addressee addressee ) : Addressee
addressee gov.va.medora.mdo.domain.sm.Addressee
return gov.va.medora.mdo.domain.sm.Addressee
Example #1
0
        public dto.sm.MessageTO readMessage(string pwd, Int32 addresseeId, Int32 addresseeOplock)
        {
            MessageTO result = new MessageTO();

            if (String.IsNullOrEmpty(pwd))
            {
                result.fault = new FaultTO("Missing appPwd");
            }
            else if (addresseeId <= 0)
            {
                result.fault = new FaultTO("Must supply addressee ID");
            }
            if (result.fault != null)
            {
                return result;
            }

            try
            {
                using (MdoOracleConnection cxn = new MdoOracleConnection(new mdo.DataSource() { ConnectionString = pwd }))
                {
                    AddresseeDao dao = new AddresseeDao(cxn);
                    gov.va.medora.mdo.domain.sm.Addressee addressee = dao.readMessage(new Addressee() { Id = addresseeId, Oplock = addresseeOplock });
                    MessageTO message = new MessageTO(addressee.Message);
                    message.addressees = new AddresseeTO[1] { new AddresseeTO(addressee) };
                    result = message;
                }
            }
            catch (Exception exc)
            {
                result.fault = new FaultTO(exc);
            }

            return result;
        }