using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
/// <summary>
/// SqlDelete 的摘要说明
/// </summary>
public class SqlDelete
{
	public SqlDelete()
	{
        
		//
		// TODO: 在此处添加构造函数逻辑
		//
	}
    public void DeleteClassInfo(string ClassId)
    {
        
        SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
        con.Open();
        string sql = "delete from ClassInfo where ClassId='"+ClassId+"'";
        SqlCommand com = new SqlCommand(sql,con);
        com.ExecuteNonQuery();
       
        com.Dispose();
        con.Close();
    }
    public int DeleteStudent(int studentID)
    {
        int Resule=0;
        SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
        con.Open();
        string sql = "delete from studentInfo where StudentID="+studentID+" ";
        SqlCommand com = new SqlCommand(sql,con);
        Resule = com.ExecuteNonQuery();
        return Resule;
     

      
    }
    public int DeleteMyCalendar(int id)
    {
        int Resule = 0;
        SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
        con.Open();
        string sql = "delete from Calendar where CalendarID=" + id + "";
        SqlCommand com = new SqlCommand(sql,con);
        return Resule = com.ExecuteNonQuery();
        con.Close();
    }
}
