Beispiel #1
0
        public DataTable GetData(string[] lot)
        {
            DataTable ret = new DataTable {
                TableName = "MyTable"
            };

            ret.Columns.Add("Kod");
            ret.Columns.Add("Name");
            String          sql        = @"SELECT KodRKC as [Kod], (NRKC +' | ' + left(NameRKC,70)) as Name FROM RKC WHERE LotKod=" + lot[0] + " order by LotKod, Npp";
            OleDbConnection connection = null;

            try
            {
                connection = new OleDbConnection(MainWindow.GetConnectionString());
                OleDbCommand     Command = new OleDbCommand(sql, connection);
                OleDbDataAdapter adRKC   = new OleDbDataAdapter(Command);
                connection.Open();
                adRKC.Fill(ret);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                throw;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Close();
                }
            }
            return(ret);
        }
Beispiel #2
0
        public DataTable GetData(string[] lot)
        {
            DataTable ret = new DataTable {
                TableName = "MyTable"
            };

            ret.Columns.Add("Kod");
            ret.Columns.Add("Name");
            String          sql        = @"SELECT КС.КодКС as [Kod], (КС.НомерКС & ' | ' & КС.ДатаДокумента & ' | ' & КС.Филиал) as Name FROM КС WHERE (КС.Лот)=" + lot[0] + " ORDER BY КС.[ДатаДокумента] DESC;";
            OleDbConnection connection = null;

            try
            {
                connection = new OleDbConnection(MainWindow.GetConnectionString());
                OleDbCommand     Command = new OleDbCommand(sql, connection);
                OleDbDataAdapter adRKC   = new OleDbDataAdapter(Command);
                connection.Open();
                adRKC.Fill(ret);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                throw;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Close();
                }
            }
            return(ret);
        }
Beispiel #3
0
        public DataTable GetData(string[] lot)
        {
            DataTable ret = new DataTable {
                TableName = "MyTable"
            };

            ret.Columns.Add("Kod");
            ret.Columns.Add("Name");
            String          sql        = @"SELECT КодРКЦ as [Kod], ([РКЦ].№РКЦ +' | ' + left([РКЦ].НазваниеРКЦ,70)) as Name FROM РКЦ WHERE Лот=" + lot[0] + " order by Лот, №пп";
            OleDbConnection connection = null;

            try
            {
                connection = new OleDbConnection(MainWindow.GetConnectionString());
                OleDbCommand     Command = new OleDbCommand(sql, connection);
                OleDbDataAdapter adapter = new OleDbDataAdapter(Command);
                connection.Open();
                adapter.Fill(ret);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                throw;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Close();
                }
            }
            return(ret);
        }