示例#1
0
        public static bool GaDeleteAdWords(DateTime from, DateTime to, int profileid)
        {
            try
            {
                InitConnection();

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

                adapter.Connection = sqlCon;

                adapter.sp_GaDeleteAdWords(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", "[GaDeleteAdWords - " + DateTime.Now.ToString() + "]" + exObj.Message + "\r\n");
            }

            return false;
        }
示例#2
0
        public static bool GaAddAdWords(DateTime dt, string name, int impressions, int adclicks, float adcost, float ctr, float cpc, float cpm, int profileid, int projectid, int datagroup, int dimension, int campaignid)
        {
            try
            {
                InitConnection();

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

                adapter.Connection = sqlCon;

                adapter.sp_GaAddAdWords(dt, name, impressions, adclicks, adcost, ctr, cpc, cpm, profileid, projectid, datagroup, dimension, campaignid); 
                return true;
            }
            catch (Exception exObj)
            {
                lastErrorString = exObj.Message;
                string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase);
                System.IO.File.AppendAllText(path.Replace("file:\\", "") + "\\dblog.txt", "[GaAddAdSense - " + DateTime.Now.ToString() + "]" + exObj.Message + "\r\n");
            }

            return false;
        }