Beispiel #1
0
        public static bool DeleteExecLog(int projectid, DateTime dt, string methodname)
        {
            try
            {
                InitConnection();

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

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

            return false;
        }
Beispiel #2
0
        public static DateTime GetLastExecLogDate(int projectid)
        {
            try
            {
                InitConnection();

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

                adapter.Connection = sqlCon;

                object o = adapter.sp_GetLastExecLogDate(projectid);

                if (o == null)
                    return new DateTime(1977, 1, 1);

                return Convert.ToDateTime(o);
            }
            catch (Exception exObj)
            {
                lastErrorString = exObj.Message;
                string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase);
                System.IO.File.AppendAllText(path.Replace("file:\\", "") + "\\dblog.txt", "[GetLastExecLogDate - " + DateTime.Now.ToString() + "]" + exObj.Message + "\r\n");
            }

            return new DateTime(1977, 1, 1);
        }
Beispiel #3
0
        public static APIServiceProviderNamespace.main.execlogDataTable GetErrorLogs(int projectid)
        {
            try
            {
                InitConnection();

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

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

            return null;
        }
Beispiel #4
0
        public static int IsErrorExists(DateTime sd, DateTime ed)
        {
            try
            {
                InitConnection();

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

                adapter.Connection = sqlCon;

                return Convert.ToInt32(adapter.sp_IsErrorExists(sd, ed));
            }
            catch (Exception exObj)
            {
                lastErrorString = exObj.Message;
                string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase);
                System.IO.File.AppendAllText(path.Replace("file:\\", "") + "\\dblog.txt", "[IsErrorExists - " + DateTime.Now.ToString() + "]" + exObj.Message + "\r\n");
            }

            return 0;
        }