Example #1
0
 public Boolean CreateUser(User user)
 {
     DBUtil util = new DBUtil();
     if(util.AddUser(user))
         return true;
     return false;
 }
Example #2
0
        public DataSet GetEvents()
        {
            String query = "SELECT * FROM [event]";
            OleDbCommand cmd = new OleDbCommand(query);
            DBUtil util = new DBUtil();
            DataSet ds = util.FillDataSet(cmd, "event");

            return ds;
        }
Example #3
0
 public Boolean login(string username, string password)
 {
     string query = "select * from [user] where username='******' and password='******'";
     OleDbCommand cmd = new OleDbCommand(query);
     DBUtil util = new DBUtil();
     DataSet ds = util.FillDataSet(cmd, "user");
     int ResultRows = ds.Tables[0].Rows.Count;
     if ( ResultRows > 0)
         return true;
     else
         return false;
 }
Example #4
0
        public Event queryEvent(string date)
        {
            string sql = "SELECT * FROM [event] WHERE EventDate= #" + date + "#";
            OleDbCommand cmd = new OleDbCommand(sql);
            DBUtil util = new DBUtil();
            DataSet ds = util.FillDataSet(cmd, "event");

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                DateTime ddt = (DateTime)dr.Field<DateTime?>("EventDate");
                string title = dr.Field<string>("Title");
                string content = dr.Field<string>("Content");

                Event e = new Event();
                e.title = title;
                e.eventDate = ddt;
                e.content = content;
                return e;
            }

            return null;
        }