public static Issues[] loadByAccountId(long accountId) { ArrayList list = new ArrayList(); DataSet ds = new DataSet(); Issues note = new Issues(); string[] s = new string[1]; s[0] = accountId.ToString(); ds = note.load(SQL_LOAD_BY_ACCOUNT_ID, s); note = null; foreach (DataRow dr in ds.Tables[0].Rows) { note = new Issues(); note.fill(dr); list.Add(note); note = null; } try { return((Issues[])list.ToArray(typeof(Issues))); } catch { return(null); } }
public static Issues[] load(long acctId, int field) { ArrayList list = new ArrayList(); DataSet ds = new DataSet(); Issues note = new Issues(); string xsql = string.Format("{0}{1};", SQL_LOAD_BY_ACCOUNT_ID_ORDER_BY, orderBy[field]); string[] s = new string[1]; s[0] = acctId.ToString(); ds = note.load(xsql, s); note = null; foreach (DataRow dr in ds.Tables[0].Rows) { note = new Issues(); note.fill(dr); list.Add(note); note = null; } try { return((Issues[])list.ToArray(typeof(Issues))); } catch (Exception ex) { return(null); } }
private void processMessage(System.Collections.Generic.KeyValuePair <string, Rfc822Message> msg) { string token = UtilFunctions.findIssueTag(msg.Value); string[] parts = null; // issueId, accountId, tenantId UtilFunctions.parseMailToken(token, ref parts); if ((parts != null)) { if (parts.Length > 2) { // Verify issueId int key = 0; int.TryParse(parts[0], out key); Issues issue = Issues.load((long)key); if ((issue == null)) { // Invalid issueId GlobalShared.Log.Log((int)LogClass.logType.ErrorCondition, "PopListener: Invalid IssueId found <" + parts[0] + "> in message <" + msg.Key + "<", false); return; } // Save the message string filename = UtilFunctions.saveEmail(msg.Value, Convert.ToInt64(parts[0]), issue.accountId, msg.Key); Messages message = new Messages(0, key, (int)issue.accountId, DateTime.Now, 1, DateTime.Now, false, false, GlobalShared.NULL_DATE, false, filename); message.save(); } } }
public static Issues load(long id) { Issues note = new Issues(); DataSet ds = new DataSet(); ds = note.loadByPrimaryKey(id.ToString()); try { DataRow dr = ds.Tables[0].Rows[0]; return(note.fill(dr)); } catch { return(null); } }
public static Issues[] loadBySequenceNumber(long sequenceNumber) { ArrayList list = new ArrayList(); DataSet ds = new DataSet(); Issues note = new Issues(); string[] s = new string[1]; s[0] = sequenceNumber.ToString(); ds = note.load(SQL_LOAD_BY_SEQUENCE_NUMBER, s); note = null; foreach (DataRow dr in ds.Tables[0].Rows) { note = new Issues(); note.fill(dr); list.Add(note); note = null; } return((Issues[])list.ToArray(typeof(Issues))); }
public static Issues[] load() { ArrayList list = new ArrayList(); DataSet ds = new DataSet(); Issues note = new Issues(); ds = note.loadAll(); note = null; foreach (DataRow dr in ds.Tables[0].Rows) { note = new Issues(); note.fill(dr); list.Add(note); note = null; } try { return((Issues[])list.ToArray(typeof(Issues))); } catch { return(null); } }
public static Issues[] load(int field) { ArrayList list = new ArrayList(); DataSet ds = new DataSet(); Issues note = new Issues(); string xsql = string.Format("{0}{1};", SQL_LOAD_ORDER_BY, orderBy[field]); ds = note.load(xsql, null); note = null; foreach (DataRow dr in ds.Tables[0].Rows) { note = new Issues(); note.fill(dr); list.Add(note); note = null; } try { return((Issues[])list.ToArray(typeof(Issues))); } catch { return(null); } }