温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:网上办公系统源码
当前文件路径:OfficeOnline/CompanyDecision/CD_Add.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
12
public partial class CompanyDecision_CD_Add : System.Web.UI.Page 13
{ 14
WebService webService = new WebService(); 15
protected void Page_Load(object sender, EventArgs e) 16
{ 17
if (Session["UserID"] == null || Session["UserLevel"] == null) 18
{ 19
Response.Redirect("~/Error.aspx"); 20
} 21
if (Session["UserLevel"].ToString() != "总经理" && Session["UserLevel"].ToString() != "副总经理") 22
{ 23
Response.Redirect("~/Error.aspx"); 24
} 25
if (Session["UserLevel"].ToString() != "总经理") 26
{ 27
this.CheckBox1.Visible = false; 28
this.lblMsg.Text = "您所撰写的新决策不能立即实行,将等待总经理的审核!"; 29
} 30
} 31
protected void btnSubmit_Click(object sender, EventArgs e) 32
{ 33
string strSql; 34
if (this.tbTitle.Text == "" || this.tbContent.Text == "") 35
this.lblMsg.Text = "请填写完整的信息!"; 36
else 37
{ 38
string strTitle = this.tbTitle.Text; 39
string strContent = this.tbContent.Text; 40
if (this.CheckBox1.Checked) 41
{ 42
strSql = "Insert into z_CompanyDecision(CD_Title,CD_Content,CD_AddDate,CD_IsConfirm,CD_ConfirmDate,CD_AddPersonID) values ('" + strTitle + "','" + strContent + "','" + DateTime.Now + "','1','" + DateTime.Now + "','" + Session["UserID"].ToString() + "');"; 43
} 44
else 45
strSql = "Insert into z_CompanyDecision(CD_Title,CD_Content,CD_AddDate,CD_IsConfirm,CD_AddPersonID) values ('" + strTitle + "','" + strContent + "','" + DateTime.Now + "','0','" + Session["UserID"].ToString() + "');"; 46
webService.ExcuteSql(strSql); 47
Response.Redirect("CD_List.aspx"); 48
} 49
} 50
protected void btnCancel_Click(object sender, EventArgs e) 51
{ 52
Response.Redirect("CD_List.aspx"); 53
} 54
} 55




WebService webService 
}
}