温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:某贸易公司项目管理系统源码
当前文件:
ProjectEva/Admin_Evaluate_WorkPlan.aspx.cs,打开代码结构图
ProjectEva/Admin_Evaluate_WorkPlan.aspx.cs,打开代码结构图1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
using System.Data.SqlClient; 12
public partial class Admin_Evaluate_WorkPlan : System.Web.UI.Page 13
{ 14
public static SqlConnection MyConnection; 15
public static SqlCommand MyCommand; 16
protected void Page_Load(object sender, EventArgs e) 17
{ 18
if (Session["Name"] == null) 19
{ 20
JS.Alert("您还未登陆或登陆超时!"); 21
Response.Redirect("Default.aspx"); 22
} 23
int ID = Convert.ToInt32(Request.QueryString["ID"].ToString()); 24
string name = Request.QueryString["Name"].ToString(); 25
26
lbNotice.Text = "您好, 您将要对员工" + name + "" + "本次的工作任务进行评定!"; 27
} 28
protected void btnSubmit_Click(object sender, ImageClickEventArgs e) 29
{ 30
int ID = Convert.ToInt32(Request.QueryString["ID"].ToString()); 31
string evaluate=txtEva_Content.Text; 32
if (EvaWorkPlanInfo(ID, evaluate)) 33
{ 34
JS.Alert("评价已经提交!"); 35
Response.Redirect("Admin_SheduReport.aspx"); 36
} 37
} 38
protected void btnReset_Click(object sender, ImageClickEventArgs e) 39
{ 40
txtEva_Content.Text = ""; 41
} 42
public static bool EvaWorkPlanInfo(int i, string s1) 43
{ 44
MyConnection = DB.createCon(); 45
MyCommand = new SqlCommand("Eva_WorkPlan_Info", MyConnection); 46
MyCommand.CommandType = CommandType.StoredProcedure; 47
48
SqlParameter ID = new SqlParameter("@ID", SqlDbType.Int); 49
ID.Value = i; 50
MyCommand.Parameters.Add(ID); 51
52
SqlParameter Evaluate = new SqlParameter("@Evaluate", SqlDbType.VarChar); 53
Evaluate.Value = s1; 54
MyCommand.Parameters.Add(Evaluate); 55
56
MyConnection.Open(); 57
int result; 58
result = MyCommand.ExecuteNonQuery(); 59
MyConnection.Close(); 60
if (result > 0) 61
{ 62
return true; 63
} 64
else 65
{ 66
return false; 67
} 68
} 69
} 70





}
}