예제 #1
0
    public DataSet SelectEventByCategory(BALEvent obj)
    {
        DataSet ds = new DataSet();
        query = "select * from event e inner join organizer o on e.organizerid=o.organizerid inner join area a on e.areaid=a.areaid inner join category c on e.categoryid=c.categoryid where e.categoryid=" + obj.CategoryId;

        SqlDataAdapter adp = new SqlDataAdapter(query, con);
        adp.Fill(ds);

        return ds;
    }
예제 #2
0
    public void DeleteEvent(BALEvent obj)
    {
        query = "Delete from Event where eventid=" + obj.EventId;
        SqlCommand cmd = new SqlCommand(query, con);

        con.Open();
        cmd.ExecuteNonQuery();
        con.Close();

    }
예제 #3
0
    public void UpdateEventWithoutImage(BALEvent obj)
    {
        query = "update Event set eventtitle='" + obj.EventTitle + "',eventdetail='" + obj.EventDetail + "',areaid=" + obj.AreaId + ",eventlocation='" + obj.EventLocation + "',eventdate='" + obj.EventDate + "',eventtime='" + obj.EventTime + "',eventemail='" + obj.EventEmail + "',eventwebsite='" + obj.EventWebsite + "',eventcontact=" + obj.EventContact + "',organizerid=" + obj.OrganizerId + ",categoryid=" + obj.CategoryId + ",postdate='" + obj.PostDate + "' where eventid=" + obj.EventId;

        SqlCommand cmd = new SqlCommand(query, con);

        con.Open();
        cmd.ExecuteNonQuery();
        con.Close();

    }
예제 #4
0
    public void InsertEvent(BALEvent obj)
    {
        query = "insert into Event(eventtitle,eventdetail,eventimage,areaid,eventlocation,eventdate,eventtime,eventemail,eventwebsite,eventcontact,organizerid,categoryid,postdate) values ('" + obj.EventTitle + "','" + obj.EventDetail + "','" + obj.EventImage + "'," + obj.AreaId + ",'" + obj.EventLocation + "','" + obj.EventDate + "','" + obj.EventTime + "','" + obj.EventEmail + "','"+obj.EventWebsite+"','" + obj.EventContact + "'," + obj.OrganizerId + "," + obj.CategoryId + ",'" + obj.PostDate+"')";

        SqlCommand cmd = new SqlCommand(query,con);

        con.Open();
        cmd.ExecuteNonQuery();
        con.Close();

    }