Esempio n. 1
0
        public IList<Core.Business.DocumentDespatcher> GetAllDocumentDespatcher()
        {
            IList<Core.Business.DocumentDespatcher> documentDespatcherlist = new List<Core.Business.DocumentDespatcher>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectDocumentDespatchersAll");

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.DocumentDespatcher documentDespatcher = new Core.Business.DocumentDespatcher();

                    if (!reader.IsDBNull(0)) documentDespatcher.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) documentDespatcher.DispatcherReceiver = reader.GetInt32(1);
                    if (!reader.IsDBNull(2)) documentDespatcher.ReceiveDate = reader.GetDateTime(2);
                    if (!reader.IsDBNull(3)) documentDespatcher.State = reader.GetInt32(3);

                    documentDespatcher.MarkOld();
                    documentDespatcherlist.Add(documentDespatcher);
                }
                reader.Close();
            }
            return documentDespatcherlist;
        }
Esempio n. 2
0
        public Core.Business.DocumentDespatcher Select(long id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectDocumentDespatcher");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.DocumentDespatcher documentDespatcher = new Core.Business.DocumentDespatcher();

                if (!reader.IsDBNull(0)) documentDespatcher.Id = reader.GetInt64(0);
                if (!reader.IsDBNull(1)) documentDespatcher.DispatcherReceiver = reader.GetInt32(1);
                if (!reader.IsDBNull(2)) documentDespatcher.ReceiveDate = reader.GetDateTime(2);
                if (!reader.IsDBNull(3)) documentDespatcher.State = reader.GetInt32(3);

                reader.Close();
                return documentDespatcher;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }