using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Count : System.Web.UI.Page
{
LYS.UserData1 myud = new LYS.UserData1();
//string QueryConditions = "";
string SQL = "select ID,教师姓名,系部,课程名,督导姓名,听课日期 from TKJL";
string TableName = "TKJL";
string sql = "";
protected void Page_Load(object sender, EventArgs e)
{
//tbEndTime.Value = DateTime.Now.ToShortDateString();
//tbStartTime.Value = DateTime.Now.ToShortDateString();
Session["SQL"] = "";
HttpContext.Current.Session["TableName"] = "";
HttpContext.Current.Session["SQL"] = SQL;
HttpContext.Current.Session["TableName"] = TableName;
if (!Page.IsPostBack)
{
// myud.BindFiledToDropDownList(QueryField, SQL, TableName);
}
//DateTime startTime = Convert.ToDateTime("2017-9-1");
//DateTime endTime = Convert.ToDateTime("2017-9-11");
// string sql = "select count(*) as 总计 from TKJL where 听课日期 >= #2017-9-1# and 听课日期 <=#2017-9-10#"; //OK
//DateTime time3 = DateTime.D dateTimePicker1.Value.Date.ToString("yyyy-MM-dd");
//DateTime time4 = dateTimePicker2.Value.Date.ToString("yyyy-MM-dd");
// checkCmd = "SELECT sum([单笔账单总计]) As 总计 FROM Account where 时间 between #" + time3 + "# and #" + time4 + "#";
//Literal1.Text = myud.DispLineCount(sql).ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
Panel1.Visible = true;
Literal2.Text = "《" + sDemp.Value + "》" + ReportName.Value + "督导统计报表";
DateTime startTime = Convert.ToDateTime(tbStartTime.Value.ToString());
DateTime endTime = Convert.ToDateTime(tbEndTime.Value.ToString());
//2.督导听课
if (sDemp.Value.Trim().ToString() == "全院")
{
// sql = "select count(*) as " + ReportName.Value + " from TKJL where 听课日期 >= '" + tbStartTime.Value + "' and 听课日期 <='" + tbEndTime.Value + "'"; //OK
sql = "select count(*) from TKJL where 听课日期 >= '" + tbStartTime.Value + "' and 听课日期 <='" + tbEndTime.Value + "'"; //OK
}
else
{
// sql = "select count(*) as " + ReportName.Value + " from TKJL where 听课日期 >= '" + tbStartTime.Value + "' and 听课日期 <='" + tbEndTime.Value + "' and 系部='" + sDemp.Value.Trim().ToString() + "'"; //OK
sql = "select count(*) from TKJL where 听课日期 >= '" + tbStartTime.Value + "' and 听课日期 <='" + tbEndTime.Value + "' and 系部='" + sDemp.Value.Trim().ToString() + "'"; //OK
}
//string sql = "select count(*) as " + ReportName.Value + " from TKJL where 听课日期 >= #" + tbStartTime.Value + "# and 听课日期 <=#" + tbEndTime.Value + "#"; //OK ACCESS
XB.Text = sDemp.Value.ToString();
DDTK.Text = myud.DispLineCountNum(sql).ToString();
//1.督导会议
if (sDemp.Value.Trim().ToString() == "全院")
{
sql = "select count(*) from OthProg where 督导时间 >= '" + tbStartTime.Value + "' and 督导时间 <='" + tbEndTime.Value + "' and 督导项目名 Like '%督导会议%'"; //OK
}
else
{
sql = "select count(*) from OthProg where 督导时间 >= '" + tbStartTime.Value + "' and 督导时间 <='" + tbEndTime.Value + "' and 督导项目名 Like '%督导会议%' and 系部='" + sDemp.Value.Trim().ToString() + "'"; //OK
}
DDHY.Text = myud.DispLineCountNum(sql).ToString();
//3.评课次数
//if (sDemp.Value.Trim().ToString() == "全院")
//{
// sql = "select count(*) from OthProg where 督导时间 >= '" + tbStartTime.Value + "' and 督导时间 <='" + tbEndTime.Value + "' and 督导项目名 Like '%教学评课%'"; //OK
//}
//else
//{
// sql = "select count(*) from OthProg where 督导时间 >= '" + tbStartTime.Value + "' and 督导时间 <='" + tbEndTime.Value + "' and 督导项目名 Like '%教学评课%' and 系部='" + sDemp.Value.Trim().ToString() + "'"; //OK
//}
if (sDemp.Value.Trim().ToString() == "全院")
{
sql = "select count(*) from TKJL where 听课日期 >= '" + tbStartTime.Value + "' and 听课日期 <='" + tbEndTime.Value + "' and 综合评价 IS NOT NULL"; //OK
}
else
{
sql = "select count(*) from TKJL where 听课日期 >= '" + tbStartTime.Value + "' and 听课日期 <='" + tbEndTime.Value + "' and 综合评价 IS NOT NULL and 系部='" + sDemp.Value.Trim().ToString() + "'"; //OK
}
DDPK.Text = myud.DispLineCountNum(sql).ToString();
//4.督学情况
if (sDemp.Value.Trim().ToString() == "全院")
{
sql = "select count(*) from OthProg where 督导时间 >= '" + tbStartTime.Value + "' and 督导时间 <='" + tbEndTime.Value + "' and 督导项目名 Like '%督学情况%'"; //OK
}
else
{
sql = "select count(*) from OthProg where 督导时间 >= '" + tbStartTime.Value + "' and 督导时间 <='" + tbEndTime.Value + "' and 督导项目名 Like '%督学情况%' and 系部='" + sDemp.Value.Trim().ToString() + "'"; //OK
}
DXCS.Text = myud.DispLineCountNum(sql).ToString();
//5.教学检查
if (sDemp.Value.Trim().ToString() == "全院")
{
sql = "select count(*) from OthProg where 督导时间 >= '" + tbStartTime.Value + "' and 督导时间 <='" + tbEndTime.Value + "' and 督导项目名 Like '%教学检查%'"; //OK
}
else
{
sql = "select count(*) from OthProg where 督导时间 >= '" + tbStartTime.Value + "' and 督导时间 <='" + tbEndTime.Value + "' and 督导项目名 Like '%教学检查%' and 系部='" + sDemp.Value.Trim().ToString() + "'"; //OK
}
JXJC.Text = myud.DispLineCountNum(sql).ToString();
//7.项目评审
if (sDemp.Value.Trim().ToString() == "全院")
{
sql = "select count(*) from OthProg where 督导时间 >= '" + tbStartTime.Value + "' and 督导时间 <='" + tbEndTime.Value + "' and 督导项目名 Like '%项目评审%'"; //OK
}
else
{
sql = "select count(*) from OthProg where 督导时间 >= '" + tbStartTime.Value + "' and 督导时间 <='" + tbEndTime.Value + "' and 督导项目名 Like '%项目评审%' and 系部='" + sDemp.Value.Trim().ToString() + "'"; //OK
}
XMPH.Text = myud.DispLineCountNum(sql).ToString();
//8.培训交流
if (sDemp.Value.Trim().ToString() == "全院")
{
sql = "select count(*) from OthProg where 督导时间 >= '" + tbStartTime.Value + "' and 督导时间 <='" + tbEndTime.Value + "' and 督导项目名 Like '%培训交流%'"; //OK
}
else
{
sql = "select count(*) from OthProg where 督导时间 >= '" + tbStartTime.Value + "' and 督导时间 <='" + tbEndTime.Value + "' and 督导项目名 Like '%培训交流%' and 系部='" + sDemp.Value.Trim().ToString() + "'"; //OK
}
PXJL.Text = myud.DispLineCountNum(sql).ToString();
//9.其它
if (sDemp.Value.Trim().ToString() == "全院")
{
sql = "select count(*) from OthProg where 督导时间 >= '" + tbStartTime.Value + "' and 督导时间 <='" + tbEndTime.Value + "' and 督导项目名 Like '%其它%'"; //OK
}
else
{
sql = "select count(*) from OthProg where 督导时间 >= '" + tbStartTime.Value + "' and 督导时间 <='" + tbEndTime.Value + "' and 督导项目名 Like '%其它%' and 系部='" + sDemp.Value.Trim().ToString() + "'"; //OK
}
Othe.Text = myud.DispLineCountNum(sql).ToString();
}
///
" + objreader.GetName(i) + " "); // } // sb.Append("\n |
" + objreader.GetValue(i).ToString() + " | "); // } // sb.Append("\n