温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:网上办公系统源码
当前文件路径:OfficeOnline/CompanyDecision/CD_Edit.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_Edit : 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 (!Page.IsPostBack) 26
{ 27
if (Session["UserLevel"].ToString() != "总经理") 28
{ 29
this.CheckBox1.Visible = false; 30
this.lblMsg.Text = "您所撰写的新决策不能立即实行,将等待总经理的审核!"; 31
} 32
string strID = Request.QueryString["cdid"]; 33
string strSql = "SELECT CD_ID,CD_Title,CD_Content,CD_AddPersonID from z_CompanyDecision where CD_ID='" + strID + "';"; 34
DataTable table = webService.ExcuteSelect(strSql); 35
this.tbTitle.Text = table.Rows[0]["CD_Title"].ToString(); 36
this.tbContent.Text = table.Rows[0]["CD_Content"].ToString(); 37
if (Session["UserID"].ToString() != table.Rows[0]["CD_AddPersonID"].ToString()) 38
{ 39
Response.Redirect("~/Error.aspx"); 40
} 41
} 42
} 43
protected void btnSubmit_Click(object sender, EventArgs e) 44
{ 45
string strSql; 46
if (this.tbTitle.Text == "" || this.tbContent.Text == "") 47
{ 48
this.lblMsg.Text = "请填写完整的信息!"; 49
} 50
else 51
{ 52
string strTitle = this.tbTitle.Text; 53
string strContent = this.tbContent.Text; 54
if (this.CheckBox1.Checked) 55
{ 56
strSql = "Update z_CompanyDecision set CD_Title='" + strTitle + "',CD_Content='" + strContent + "',CD_IsConfirm='1',CD_ConfirmDate='" + DateTime.Now + "',CD_AddDate='" + DateTime.Now + "' where CD_ID='" + Request.QueryString["cdid"] + "';"; 57
} 58
else 59
strSql = "Update z_CompanyDecision set CD_Title='" + strTitle + "',CD_Content='" + strContent + "',CD_AddDate='" + DateTime.Now + "' where CD_ID='" + Request.QueryString["cdid"] + "';"; 60
webService.ExcuteSql(strSql); 61
Response.Redirect("CD_List3.aspx"); 62
} 63
} 64
protected void Button1_Click(object sender, EventArgs e) 65
{ 66
string strSql = "Delete from z_CompanyDecision where CD_ID='" + Request.QueryString["cdid"] + "';"; 67
webService.ExcuteSql(strSql); 68
Response.Redirect("CD_List3.aspx"); 69
} 70
} 71




WebService webService 
}
}