Ejemplo n.º 1
0
        public getCustomerCountResponse getCustomerCount(getCustomerCountRequest request)
        {
            getCustomerCountResponse res = new getCustomerCountResponse();
            Int32 anzahlAdressen;
            anzahlAdressen = 0;

            try
            {
                using (DBConnect myConnect = new DBConnect())
                {
                    String sqlCommand;
                    sqlCommand = "SELECT count(kontonr)";
                    sqlCommand += " FROM bungert.adresse";
                    sqlCommand += " WHERE adresse.aktiv = 1";
                    OdbcCommand cmd = new OdbcCommand(sqlCommand, myConnect.conn);

                    myConnect.Connect();

                    OdbcDataReader reader;
                    //DataReader Objekt wird initialisiert

                    using (reader = cmd.ExecuteReader())
                    {

                        if (reader.HasRows)
                        {
                            anzahlAdressen = reader.GetInt32(0);
                        }

                        reader.Close();
                    }
                }

                res.@return = anzahlAdressen;

            }
            catch (System.Exception ex)
            {
                Trace.WriteLine(DateTime.Now.ToString() + " - " + ex.Message, "SmitService");
                res.@return = -1;
            }

            //Test Anzahl Adressen auf 1 beschränkt US 16.01.2014
            //res.@return = 1;
            return res;
        }
Ejemplo n.º 2
0
        public getCustomerCountResponse getChangedCustomerCount(getCustomerCountRequest request)
        {
            getCustomerCountResponse res = new getCustomerCountResponse();
            Int32 anzahlAdressen;
            anzahlAdressen = 0;

            SmitConfig sc = new SmitConfig();
            sc = ReadXML();

            using (DBConnect myConnect = new DBConnect())
            {
                String sqlCommand;
                sqlCommand = "SELECT count(kontonr)";
                sqlCommand += " FROM bungert.adresse a LEFT OUTER JOIN bungert.marketingkontakt b";
                sqlCommand += " ON a.adressid = b.adressid WHERE a.aktiv = 1";
                sqlCommand += " AND (a.modifieddate >= '" + sc.changedCustomerDate + "' OR b.modifieddate >= '" + sc.changedCustomerDate + "')";
                OdbcCommand cmd = new OdbcCommand(sqlCommand, myConnect.conn);

                myConnect.Connect();

                OdbcDataReader reader;
                //DataReader Objekt wird initialisiert

                using (reader = cmd.ExecuteReader())
                {

                    if (reader.HasRows)
                    {
                        anzahlAdressen = reader.GetInt32(0);
                    }

                    reader.Close();
                }
            }

            res.@return = anzahlAdressen;
            //Test Anzahl Adressen auf 1 beschränkt US 16.01.2014
            //res.@return = 1;
            return res;
        }