예제 #1
0
 protected static void CopyForUpdate(CABankStatementDetail aDest, STMTTRN aSrc)
 {
     if (aSrc.TRNAMT >= 0)
     {
         aDest.CuryDebitAmt = aSrc.TRNAMT;
     }
     else
     {
         aDest.CuryCreditAmt = -aSrc.TRNAMT;
     }
 }
예제 #2
0
        protected static void Read(XmlReader reader, BankTransList aTransList)
        {
            string lastName = String.Empty;

            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    lastName = reader.Name;
                    if (lastName == "STMTTRN")
                    {
                        STMTTRN tran = new STMTTRN();
                        aTransList.Trans.Add(tran);
                        Read(reader, tran);
                    }
                }

                if (reader.NodeType == XmlNodeType.Text)
                {
                    try
                    {
                        if (lastName == "DTSTART")
                        {
                            string value = reader.Value.Trim();
                            aTransList.DTSTART = ParseDateTime(value);
                        }
                        if (lastName == "DTEND")
                        {
                            string value = reader.Value.Trim();
                            aTransList.DTEND = ParseDateTime(value);
                        }
                    }
                    catch (FormatException ex)
                    {
                        throw new PXException(Messages.OFXParsingErrorValueHasInvalidFormat, lastName, ex.Message);
                    }
                }
                if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "BANKTRANLIST")
                {
                    return;
                }
            }
        }
예제 #3
0
 protected static void Copy(CABankStatementDetail aDest, STMTTRN aSrc)
 {
     aDest.TranCode  = aSrc.TRNTYPE;
     aDest.TranDate  = aSrc.DTPOSTED;
     aDest.ExtTranID = aSrc.FITID;
     aDest.ExtRefNbr = (string.IsNullOrEmpty(aSrc.CHECKNUM) == false) ? aSrc.CHECKNUM
                         : (string.IsNullOrEmpty(aSrc.REFNUM) == false && aSrc.REFNUM.Length < 15 ? aSrc.REFNUM : (aSrc.FITID.Length < 15 ? aSrc.FITID : null));
     aDest.TranDesc = aSrc.NAME + " " + aSrc.MEMO;
     if (aSrc.HasPayeeInfo())
     {
         aDest.PayeeName       = aSrc.PAYEE.NAME;
         aDest.PayeeAddress1   = aSrc.PAYEE.ADDR1;
         aDest.PayeePostalCode = aSrc.PAYEE.POSTALCODE;
         aDest.PayeePhone      = aSrc.PAYEE.PHONE;
         aDest.PayeeState      = aSrc.PAYEE.STATE;
         aDest.PayeeCity       = aSrc.PAYEE.CITY;
     }
     else
     {
         aDest.PayeeName = aSrc.NAME;
     }
 }
예제 #4
0
		protected static void CopyForUpdate(CABankStatementDetail aDest, STMTTRN aSrc)
		{
			if (aSrc.TRNAMT >= 0)
			{
				aDest.CuryDebitAmt = aSrc.TRNAMT;
			}
			else
			{
				aDest.CuryCreditAmt = -aSrc.TRNAMT;
			}
		}
예제 #5
0
		protected static void Copy(CABankStatementDetail aDest, STMTTRN aSrc)
		{
			aDest.TranCode = aSrc.TRNTYPE;
			aDest.TranDate = aSrc.DTPOSTED;
			aDest.ExtTranID = aSrc.FITID;
			aDest.ExtRefNbr = (string.IsNullOrEmpty(aSrc.CHECKNUM) == false) ? aSrc.CHECKNUM
				: (string.IsNullOrEmpty(aSrc.REFNUM) == false && aSrc.REFNUM.Length < 15 ? aSrc.REFNUM : (aSrc.FITID.Length < 15 ? aSrc.FITID : null));
			aDest.TranDesc = aSrc.NAME + " " + aSrc.MEMO;
			if (aSrc.HasPayeeInfo())
			{
				aDest.PayeeName = aSrc.PAYEE.NAME;
				aDest.PayeeAddress1 = aSrc.PAYEE.ADDR1;
				aDest.PayeePostalCode = aSrc.PAYEE.POSTALCODE;
				aDest.PayeePhone = aSrc.PAYEE.PHONE;
				aDest.PayeeState = aSrc.PAYEE.STATE;
				aDest.PayeeCity = aSrc.PAYEE.CITY;
			}
			else
			{
				aDest.PayeeName = aSrc.NAME;
			}
		}
예제 #6
0
        protected static void Read(XmlReader reader, STMTTRN aTran)
        {
            string lastName = String.Empty;
            Type type = aTran.GetType();
            PropertyInfo[] members = type.GetProperties(BindingFlags.Instance | BindingFlags.Public);
            foreach (PropertyInfo iMem in members)
            {
                string name = iMem.Name;
                Type tp = iMem.PropertyType;
            }
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    lastName = reader.Name;
                    if(reader.Name == "PAYEE")
                    {
                        Read(reader,aTran.PAYEE);
                    }
                }
                try
                {
                    if (reader.NodeType == XmlNodeType.Text)
                    {
                        if (lastName == "DTPOSTED")
                        {
                            string value = reader.Value.Trim();
                            aTran.DTPOSTED = ParseDateTime(value); 
                        }
                        if (lastName == "DTUSER")
                        {
                            string value = reader.Value.Trim();
                            aTran.DTUSER = ParseDateTime(value); 
                        }
                        if (lastName == "DTAVAIL")
                        {
                            string value = reader.Value.Trim();
                            aTran.DTAVAIL = ParseDateTime(value);
                        }

                        if (lastName == "TRNTYPE")
                        {
                            aTran.TRNTYPE = reader.Value.Trim();
                        }
                        if (lastName == "FITID")
                        {
                            aTran.FITID = reader.Value.Trim();
                        }
                        if (lastName == "NAME")
                        {
                            aTran.NAME = reader.Value.Trim();
                        }
                        if (lastName == "MEMO")
                        {
                            aTran.MEMO = reader.Value.Trim();
                        }
                        if (lastName == "CHECKNUM")
                        {
                            aTran.CHECKNUM = reader.Value.Trim();
                        }
                        if (lastName == "REFNUM")
                        {
                            aTran.CHECKNUM = reader.Value.Trim();
                        }
                        if (lastName == "SIC")
                        {
                            aTran.CHECKNUM = reader.Value.Trim();
                        }
                        if (lastName == "PAYEEID")
                        {
                            aTran.CHECKNUM = reader.Value.Trim();
                        }
                        if (lastName == "TRNAMT")
                        {
                            aTran.TRNAMT = ParseAmount(reader.Value.Trim());
                        }                        
                    }
                }
                catch (FormatException ex)
                {
                     throw new PXException(Messages.OFXParsingErrorTransactionValueHasInvalidFormat, reader.Value, lastName, aTran.FITID, ex.Message);
                }               

                if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "STMTTRN")
                {
                    return;
                }
            }
        }
예제 #7
0
        protected static void Read(XmlReader reader, BankTransList aTransList)
        {
            string lastName = String.Empty;
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    lastName = reader.Name;
                    if (lastName == "STMTTRN")
                    {
                        STMTTRN tran = new STMTTRN();
                        aTransList.Trans.Add(tran);
                        Read(reader, tran);
                    }
                }

                if (reader.NodeType == XmlNodeType.Text)
                {
                    try
                    {
                        if (lastName == "DTSTART")
                        {
                            string value = reader.Value.Trim();
                            aTransList.DTSTART = ParseDateTime(value); 
                        }
                        if (lastName == "DTEND")
                        {
                            string value = reader.Value.Trim();
                            aTransList.DTEND = ParseDateTime(value); 
                        }
                    }
                    catch (FormatException ex)
                    {
                        throw new PXException(Messages.OFXParsingErrorValueHasInvalidFormat, lastName, ex.Message);
                    }
                }
                if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "BANKTRANLIST")
                {
                    return;
                }
            }
        }
 public void RemoveSTMTTRN(STMTTRN STMTTRN)
 {
     DbSetSTM.Remove(STMTTRN);
 }
 public void UpdateSTMTTRN(STMTTRN STMTTRN)
 {
     DbSetSTM.Update(STMTTRN);
 }
예제 #10
0
 public void AddSTMTTRN(STMTTRN STMTTRN)
 {
     DbSetSTM.Add(STMTTRN);
 }
예제 #11
0
        protected static void Read(XmlReader reader, STMTTRN aTran)
        {
            string lastName = String.Empty;
            Type   type     = aTran.GetType();

            PropertyInfo[] members = type.GetProperties(BindingFlags.Instance | BindingFlags.Public);
            foreach (PropertyInfo iMem in members)
            {
                string name = iMem.Name;
                Type   tp   = iMem.PropertyType;
            }
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    lastName = reader.Name;
                    if (reader.Name == "PAYEE")
                    {
                        Read(reader, aTran.PAYEE);
                    }
                }
                try
                {
                    if (reader.NodeType == XmlNodeType.Text)
                    {
                        if (lastName == "DTPOSTED")
                        {
                            string value = reader.Value.Trim();
                            aTran.DTPOSTED = ParseDateTime(value);
                        }
                        if (lastName == "DTUSER")
                        {
                            string value = reader.Value.Trim();
                            aTran.DTUSER = ParseDateTime(value);
                        }
                        if (lastName == "DTAVAIL")
                        {
                            string value = reader.Value.Trim();
                            aTran.DTAVAIL = ParseDateTime(value);
                        }

                        if (lastName == "TRNTYPE")
                        {
                            aTran.TRNTYPE = reader.Value.Trim();
                        }
                        if (lastName == "FITID")
                        {
                            aTran.FITID = reader.Value.Trim();
                        }
                        if (lastName == "NAME")
                        {
                            aTran.NAME = reader.Value.Trim();
                        }
                        if (lastName == "MEMO")
                        {
                            aTran.MEMO = reader.Value.Trim();
                        }
                        if (lastName == "CHECKNUM")
                        {
                            aTran.CHECKNUM = reader.Value.Trim();
                        }
                        if (lastName == "REFNUM")
                        {
                            aTran.CHECKNUM = reader.Value.Trim();
                        }
                        if (lastName == "SIC")
                        {
                            aTran.CHECKNUM = reader.Value.Trim();
                        }
                        if (lastName == "PAYEEID")
                        {
                            aTran.CHECKNUM = reader.Value.Trim();
                        }
                        if (lastName == "TRNAMT")
                        {
                            aTran.TRNAMT = ParseAmount(reader.Value.Trim());
                        }
                    }
                }
                catch (FormatException ex)
                {
                    throw new PXException(Messages.OFXParsingErrorTransactionValueHasInvalidFormat, reader.Value, lastName, aTran.FITID, ex.Message);
                }

                if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "STMTTRN")
                {
                    return;
                }
            }
        }