Example #1
0
        /// <summary>
        /// PaymentDetails : DataTable To Object
        /// </summary>
        /// <param name="table"></param>
        public static int ReadPaymentDetails(DataTable table)
        {
            VPaymentMode vPayMode;
            int          id = 0;

            foreach (var row in table.AsEnumerable())
            {
                vPayMode              = new VPaymentMode();
                vPayMode.ID           = ++id;
                vPayMode.PaymentMode  = (string)row[VBEle.mode];
                vPayMode.PaymentValue = (string)row[VBEle.value];
                vBill.AddPaymentMode(vPayMode);
            }
            return(id);
        }
Example #2
0
 public void AddPaymentMode(VPaymentMode vPaymentMode)
 {
     payModes.Add(vPaymentMode);
 }
Example #3
0
        protected static void ReadPayMode( )
        {
            VPaymentMode vPay = null;

            ws.WriteLine("Reading PayMode...");
            do
            {
                reader.Read();
                if (reader.NodeType == XmlNodeType.Element)
                {
                    switch (reader.Name)
                    {
                    case VBEle.Payment_detail:
                        vPay = new VPaymentMode
                        {
                            ID = -1
                        };
                        ws.WriteLine("Payment mode.");

                        break;

                    case VBEle.notes:
                        ws.Write(reader.Name + ":");

                        reader.Read();
                        vPay.Notes = reader.Value;
                        ws.WriteLine(reader.Value);

                        reader.Read();
                        break;

                    case VBEle.Payvalue:
                        ws.Write(reader.Name + ":");

                        reader.Read();
                        vPay.Notes = reader.Value;
                        ws.WriteLine(reader.Value);

                        reader.Read();
                        break;

                    case VBEle.mode:
                        ws.Write(reader.Name + ":");
                        reader.Read();
                        vPay.Notes = reader.Value;
                        ws.WriteLine(reader.Value);
                        reader.Read();
                        break;
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    switch (reader.Name)
                    {
                    case VBEle.payment:
                        vBill.payModes.Add(vPay);
                        break;
                    }
                }
            } while (reader.Name == VBEle.Payment_Mode && reader.NodeType == XmlNodeType.EndElement);
        }