Ejemplo n.º 1
0
        public List <Event> GetAllEvent(string username)
        {
            string        query  = "SELECT * FROM Users WHERE Username='******'";
            SqlDataReader reader = this.dataAcces.GetAll(query);

            reader.Read();
            int    id     = (int)reader["UserId"];
            string query1 = "SELECT * FROM Event2 WHERE UserId=" + id;

            dataAcces = new DataAcces();
            reader    = this.dataAcces.GetAll(query1);
            List <Event> list = new List <Event>();

            while (reader.Read())
            {
                Event note = new Event();
                note.EventId  = (int)reader["EventId"];
                note.Title    = reader["Title"].ToString();
                note.WriteTab = reader["WriteTab"].ToString();
                note.Priority = reader["Priority"].ToString();
                note.Date     = reader["Date"].ToString();
                note.Id       = (int)reader["UserId"];
                list.Add(note);
            }
            return(list);
        }
Ejemplo n.º 2
0
        public int Add(Event events)
        {
            string query = "INSERT INTO Event2(Title,WriteTab,Priority,Date,UserId) VALUES('" + events.Title + "','" + events.WriteTab + "','" + events.Priority + "','" + events.Date + "','" + events.Id + "')";

            dataAcces = new DataAcces();
            int result = this.dataAcces.ExecuteQuery(query);

            return(result);
        }
 public ModifyEventDataAccess()
 {
     this.dataAcces = new DataAcces();
 }
Ejemplo n.º 4
0
 public AddEventDataAccess()
 {
     this.dataAcces = new DataAcces();
 }
 public SignUpDataAccess()
 {
     this.dataAcces = new DataAcces();
 }
Ejemplo n.º 6
0
 public HomeDataAccess()
 {
     this.dataAcces = new DataAcces();
 }
 public DeleteEventDataAccess()
 {
     this.dataAcces = new DataAcces();
 }
 public LoginDataAcces()
 {
     this.dataAcces = new DataAcces();
 }