using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.OleDb;
using System.Data.Sql;
using System.Data.SqlClient;
public partial class ModifyOther : System.Web.UI.Page
{
LYS.UserData1 myud = new LYS.UserData1();
//int sID = 0;
protected void Page_Load(object sender, EventArgs e)
{
//if (Session["Username"] == null)
//{ Response.Redirect("LoginNew.aspx"); }
TextBox1.Text = myud.ReadCookies("Username").ToString();
int sID = Convert.ToInt16(Request.QueryString["ID"].ToString());
string myURL = myud.GetAddressUrl().ToString();
if (myURL.LastIndexOf("ID") < 0)
{
Response.Write("");
Response.End();
}
if (!IsPostBack)
{
TextBox1.Text = myud.GetFieldValueFromFieldName("督导姓名",sID, "OthProg").ToString();
ZJ.Text = Convert.ToDateTime(myud.GetFieldValueFromFieldName("督导时间", sID, "OthProg").ToString()).ToShortDateString();
DD.Text = myud.GetFieldValueFromFieldName("督导地点", sID, "OthProg").ToString();
XB.Text = myud.GetFieldValueFromFieldName("系部", sID, "OthProg").ToString();
ZZT.Text = myud.GetFieldValueFromFieldName("督导项目名", sID, "OthProg").ToString();
BJ.Text = myud.GetFieldValueFromFieldName("参与人员", sID, "OthProg").ToString();
XQ.Text = myud.GetFieldValueFromFieldName("星期", sID, "OthProg").ToString();
JC.Text = myud.GetFieldValueFromFieldName("节次", sID, "OthProg").ToString();
PF.Text = myud.GetFieldValueFromFieldName("备注", sID, "OthProg").ToString();
TextBox5.Text = myud.GetFieldValueFromFieldName("督导内容", sID, "OthProg").ToString();
TextBox2.Text = myud.GetFieldValueFromFieldName("建议或结果", sID, "OthProg").ToString();
FileAtt.Text = myud.GetFieldValueFromFieldName("文件附件", sID, "OthProg").ToString();
Literal2.Text = "";
Literal3.Text = "";
}
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("DispUPlist.aspx");
}
protected void Button1_Click(object sender, EventArgs e)
{
int ID = Convert.ToInt16(Request.QueryString["ID"].ToString());
if (DD.Text.Trim().Length == 0 || TextBox5.Text.Trim().Length == 0 || BJ.Text.Trim().Length == 0 || TextBox2.Text.Trim().Length == 0 || PF.Text.Trim().Length == 0)
{ Response.Write(""); }
else
{
//string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + HttpContext.Current.Server.MapPath("~\\App_Data\\ZY.mdb");
//检查是否有同样sql="SELECT * FROM Pengfeng where csid="&request.Form("CSID")&" and 评价人='"&request.Form("MyName1")&"' and 评价组='"&request.Form("MyName2")&"'"
//string sql = "select * from TKJL where 督导姓名='" + TextBox1.Text.Trim() + "' and 课程名='" + KM.Text.Trim() + "' and 教师姓名='" + JSXM.Text.Trim() + "' and 听课日期=#" + Convert.ToDateTime(ZJ.Text.Trim()).ToShortDateString() + "#";
//string sql1 ="select * from TKJL where id=" + Convert.ToInt16(Request.QueryString["ID"].ToString());
string connectionString = myud.ConnString();
myud.UpdateStringFieldValue("OthProg", "督导姓名", TextBox1.Text, ID);
myud.UpdateStringFieldValue("OthProg", "系部", XB.Text, ID);
myud.UpdateStringFieldValue("OthProg", "督导时间", ZJ.Text, ID);
myud.UpdateStringFieldValue("OthProg", "督导地点", DD.Text, ID);
myud.UpdateStringFieldValue("OthProg", "督导项目名", ZZT.Text, ID);
myud.UpdateStringFieldValue("OthProg", "参与人员", BJ.Text, ID);
myud.UpdateStringFieldValue("OthProg", "星期", XQ.Text, ID);
myud.UpdateStringFieldValue("OthProg", "节次", JC.Text, ID);
myud.UpdateStringFieldValue("OthProg", "备注", PF.Text, ID);
myud.UpdateStringFieldValue("OthProg", "督导内容", TextBox5.Text, ID);
myud.UpdateStringFieldValue("OthProg", "建议或结果", TextBox2.Text, ID);
myud.UpdateStringFieldValue("OthProg", "图片附件1", PIC1.Text, ID);
myud.UpdateStringFieldValue("OthProg", "图片附件2", PIC2.Text, ID);
myud.UpdateStringFieldValue("OthProg", "文件附件", FileAtt.Text, ID);
Response.Write("");
}
}
}