public static decimal getItemValueAsDecimal(Domino.NotesDocumentClass Document, String Field) { if (Document == null) { return(0); } try { String r = (String)((Object[])Document.GetItemValue(Field))[0]; if (r == "") { return(0); } return(Decimal.Parse(r)); } catch { } try { Double d = (Double)((Object[])Document.GetItemValue(Field))[0]; return(Decimal.Parse(d.ToString())); } catch { } return((decimal)((Object[])Document.GetItemValue(Field))[0]); }
public static String getItemValue(Domino.NotesDocumentClass Document, String Field, int Maxlength) { if (Document == null) { return(""); } String ret = (String)((Object[])Document.GetItemValue(Field))[0].ToString(); return(Maxlength == 0 || (Maxlength != 0 && ret.Length <= Maxlength) ? ret : ret.Substring(0, Maxlength)); }
public static String[] getItemValues(Domino.NotesDocumentClass Document, String Field) { Object[] ar = ((Object[])Document.GetItemValue(Field)); String[] ret = new String[ar.Length]; for (int n = 0; n < ar.Length; n++) { ret[n] = ar[n].ToString(); } return(ret); }