示例#1
0
        public static bool AddCampaignStatisticsRecord(int campaignid, DateTime datetime, int shows, int clicks, decimal price, int projectid)
        {
            try
            {
                InitConnection();

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

                adapter.Connection = sqlCon;
                adapter.sp_AddCampaignStatisticsRecord(campaignid, datetime, shows, clicks, price, projectid);
                return true;
            }
            catch (Exception exObj)
            {
                lastErrorString = exObj.Message;
                string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase);
                System.IO.File.AppendAllText(path.Replace("file:\\", "") + "\\dblog.txt", "[AddCampaignStatisticsRecord - " + DateTime.Now.ToString() + "]" + exObj.Message + "\r\n");
            }

            return false;
        }
示例#2
0
        public static bool DeleteCampaignStatisticsRecords(int projectid, DateTime dt, string cid, string provider)
        {
            try
            {
                InitConnection();

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

                adapter.Connection = sqlCon;
                adapter.sp_DeleteCampaignStatisticsRecords(projectid, dt, cid, provider);
                return true;
            }
            catch (Exception exObj)
            {
                lastErrorString = exObj.Message;
                string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase);
                System.IO.File.AppendAllText(path.Replace("file:\\", "") + "\\dblog.txt", "[DeleteCampaignStatisticsRecord - " + DateTime.Now.ToString() + "]" + exObj.Message + "\r\n");
            }

            return false;
        }