Exemplo n.º 1
0
        public static bool GaDeleteTrafficSources(DateTime from, DateTime to, int profileid)
        {
            try
            {
                InitConnection();

                ga_trafficsourcesTableAdapter adapter = new ga_trafficsourcesTableAdapter();
                if (adapter.Connection != null)
                    adapter.Connection.Close();

                adapter.Connection = sqlCon;

                adapter.sp_GaDeleteTrafficSources(from, to, profileid);
                return true;
            }
            catch (Exception exObj)
            {
                lastErrorString = exObj.Message;
                string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase);
                System.IO.File.AppendAllText(path.Replace("file:\\", "") + "\\dblog.txt", "[GaDeleteTrafficSources - " + DateTime.Now.ToString() + "]" + exObj.Message + "\r\n");
            }

            return false;
        }
Exemplo n.º 2
0
        public static int GaAddTrafficSource(DateTime dt, int sourcetype, string name, int visits, float viewspervisit, float avgduration, float newvisits, float bouncerate, int profileid)
        {
            try
            {
                InitConnection();

                ga_trafficsourcesTableAdapter adapter = new ga_trafficsourcesTableAdapter();
                if (adapter.Connection != null)
                    adapter.Connection.Close();

                adapter.Connection = sqlCon;

                return Convert.ToInt32(adapter.sp_GaAddTrafficSource(dt, sourcetype, name, visits, viewspervisit, avgduration, newvisits, bouncerate, profileid));
            }
            catch (Exception exObj)
            {
                lastErrorString = exObj.Message;
                string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase);
                System.IO.File.AppendAllText(path.Replace("file:\\", "") + "\\dblog.txt", "[GaAddTrafficSource - " + DateTime.Now.ToString() + "]" + exObj.Message + "\r\n");
            }

            return 0;
        }