예제 #1
0
        private static void ReSyncLocalData(SalesOrderDetailTableAdapter MainAdapter, int HeaderID, bool deletion)
        {
            int DetailReceived_rows = 0;
            int HeaderReceived_rows = 0;

            HeaderReceived_rows = MainAdapter.FillBySalesOrderID(DataADO.SalesOrderDetail, HeaderID);
            Console.WriteLine("Registros OrderHeader recibidos (resync): {0}", HeaderReceived_rows);

            using (SalesOrderHeaderTableAdapter SecondaryAdapter = new SalesOrderHeaderTableAdapter())
            {
                DetailReceived_rows = deletion ?
                                      SecondaryAdapter.Fill(DataADO.SalesOrderHeader) :
                                      SecondaryAdapter.FillBySalesOrderID(DataADO.SalesOrderHeader, HeaderID);
            }

            Console.WriteLine("Registros OrderHeader recibidos (resync): {0}", DetailReceived_rows);
        }
예제 #2
0
        private static void ADOShowOrderHeaders()
        {
            int    counter      = 0;
            string prompt_input = "";

            if (DataADO.SalesOrderHeader.Rows.Count == 0)
            {
                using (SalesOrderHeaderTableAdapter OrderHeadTabAdpt = new SalesOrderHeaderTableAdapter())
                {
                    OrderHeadTabAdpt.Fill(DataADO.SalesOrderHeader);
                }
            }

            foreach (ADOM9Dataset.SalesOrderHeaderRow OrderHeader in DataADO.SalesOrderHeader.Rows)
            {
                Console.WriteLine("ID: {0} " +
                                  "\n\t- Fecha de pedido:  {1} " +
                                  "\n\t- Núm pedido: {2} " +
                                  "\n\t- Núm cliente: {3} " +
                                  "\n\t- Importe total: {4} ",
                                  OrderHeader.SalesOrderID,
                                  OrderHeader.OrderDate,
                                  OrderHeader.IsNull("PurchaseOrderNumber") ? "----" : OrderHeader.PurchaseOrderNumber,
                                  OrderHeader.CustomerID,
                                  OrderHeader.TotalDue);
                counter++;

                if (counter % 10 == 0)
                {
                    Console.Write("Introduzca X para salir. Si quiere 10 elementos siguientes, pulse una tecla: ");
                    prompt_input = Console.ReadLine();

                    if (prompt_input.ToLower() == "x")
                    {
                        break;
                    }
                    else
                    {
                        continue;
                    }
                }
            }
        }