Example #1
0
        public void insertEvent(int locID, int catID, int useID, string decr, DateTime date)
        {
            DataTable dt = new DataTable();
            Connection dataConnecter = new Connection();

            SqlConnection con = new SqlConnection(dataConnecter.createSqlServerConnection());
            SqlCommand com = new SqlCommand();

            com.CommandText = "sp_InsertEvent";
            com.CommandType = CommandType.StoredProcedure;

            com.Parameters.Add("@LocationID", SqlDbType.Int).Value = locID;
            com.Parameters.Add("@CategoryID", SqlDbType.Int).Value = catID;
            com.Parameters.Add("@UserID", SqlDbType.Int).Value = useID;
            com.Parameters.Add("@Descr", SqlDbType.VarChar).Value = decr;
            com.Parameters.Add("@EventDate", SqlDbType.DateTime).Value = date;
            com.Parameters.Add("@Active", SqlDbType.Bit).Value = true;

            com.Connection = con;

            con.Open();

            com.ExecuteNonQuery();

            con.Close();
        }
Example #2
0
        public void insertLog(int userID, DateTime logTime, string descr, string progLoc, string message)
        {
            DataTable dt = new DataTable();
            Connection dataConnecter = new Connection();

            SqlConnection con = new SqlConnection(dataConnecter.createSqlServerConnection());
            SqlCommand com = new SqlCommand();

            com.CommandText = "sp_InsertLog";
            com.CommandType = CommandType.StoredProcedure;

            com.Parameters.Add("@UserID", SqlDbType.VarChar).Value = userID;
            com.Parameters.Add("@Logtime", SqlDbType.DateTime).Value = logTime;
            com.Parameters.Add("@Descr", SqlDbType.VarChar).Value = descr;
            com.Parameters.Add("@ProgramLocation", SqlDbType.VarChar).Value = progLoc;
            com.Parameters.Add("@Message", SqlDbType.VarChar).Value = message;

            com.Connection = con;

            con.Open();

            com.ExecuteNonQuery();

            con.Close();
        }
Example #3
0
        public DataTable getLocPickList()
        {
            DataTable dt = new DataTable();
            SqlDataAdapter adapter;
            Connection dataConnecter = new Connection();

            SqlConnection con = new SqlConnection(dataConnecter.createSqlServerConnection());
            SqlCommand com = new SqlCommand();

            com.CommandText = "sp_GetLocationPickList";
            com.CommandType = CommandType.StoredProcedure;

            com.Connection = con;

            adapter = new SqlDataAdapter(com);
            adapter.Fill(dt);

            con.Close();

            return dt;
        }
Example #4
0
        public DataTable getMap()
        {
            DataTable dt = new DataTable();
            SqlDataAdapter adapter;
            Connection dataConnecter = new Connection();

            SqlConnection con = new SqlConnection(dataConnecter.createSqlServerConnection("sqlinstance-1.cnsq0dkjy1df.us-west-2.rds.amazonaws.com,1433", "CMAS", "*050987Wwhite", "awsuserwill"));
            SqlCommand com = new SqlCommand();

            com.CommandText = "MapProcedure";
            com.CommandType = CommandType.StoredProcedure;

            com.Connection = con;

            adapter = new SqlDataAdapter(com);
            adapter.Fill(dt);

            con.Close();

            return dt;
        }
Example #5
0
        public DataTable getEmailList()
        {
            DataTable dt = new DataTable();
            SqlDataAdapter adapter;
            Connection dataConnecter = new Connection();

            SqlConnection con = new SqlConnection(dataConnecter.createSqlServerConnection());
            SqlCommand com = new SqlCommand();

            //this needs to be updated with the proper email sp
            com.CommandText = "sp_getEmailPickList";
            com.CommandType = CommandType.StoredProcedure;

            com.Connection = con;

            adapter = new SqlDataAdapter(com);
            adapter.Fill(dt);

            con.Close();

            return dt;
        }
Example #6
0
        public DataTable getEventByID(int ID)
        {
            DataTable dt = new DataTable();
            SqlDataAdapter adapter;
            Connection dataConnecter = new Connection();

            SqlConnection con = new SqlConnection(dataConnecter.createSqlServerConnection());
            SqlCommand com = new SqlCommand();

            com.CommandText = "sp_GetEventByID";
            com.CommandType = CommandType.StoredProcedure;

            com.Parameters.Add("@EventID", SqlDbType.Int).Value = ID;

            com.Connection = con;

            adapter = new SqlDataAdapter(com);
            adapter.Fill(dt);

            con.Close();

            return dt;
        }