SysFNameModify.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:3k
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using com.etong.DAL.FC;
- public partial class SysManage_SysFNameModify : System.Web.UI.Page
- {
- protected string sN;
- protected int iN;
- EtongWord EWord = new EtongWord();
- protected void Page_Load(object sender, EventArgs e)
- {
- Response.Buffer = true;
- Response.ExpiresAbsolute = System.DateTime.Now;
- Response.Expires = 0;
- Response.CacheControl = "no-cache";
- sN = Convert.ToString(Request.QueryString["strN"]);
- if (sN == "M")
- {
- iN = Convert.ToInt32(Request.QueryString["strOp"]);
- }
- if (!IsPostBack)
- {
- if (sN == "M")
- {
- EWord.FID = iN;
- try
- {
- DataView dv = new DataView();
- dv = EWord.GetFNameByCondition();
- TID.Text = dv.Table.Rows.Count > 0 ? dv.Table.Rows[0][1].ToString() : "";
- tname.Value = dv.Table.Rows.Count > 0 ? dv.Table.Rows[0][1].ToString() : "";
- TDesc.Text = dv.Table.Rows.Count > 0 ? dv.Table.Rows[0][2].ToString() : "";
- }
- catch (Exception ex)
- {
- ClientScript.RegisterStartupScript(this.GetType(), "errorMessage", "<script>alert('" + ex.Message.Replace("'", "").Replace("rn", "") + "');</script>");
- }
- }
- }
- }
- protected void ImgSave_Click(object sender, ImageClickEventArgs e)
- {
- if (sN == "N")
- {
- try
- {
- EWord.FName = tname.Value ;
- EWord.FDesc = TDesc.Text;
- EWord.Insert();
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:添加记录成功!');</script>");
- }
- catch (Exception ex)
- {
- ClientScript.RegisterStartupScript(this.GetType(), "errorMessage", "<script>alert('" + ex.Message.Replace("'", "").Replace("rn", "") + "');</script>");
- }
- }
- else if (sN == "M")
- {
- try
- {
- EWord.FID = iN;
- EWord.FName = tname.Value;
- EWord.FDesc = TDesc.Text;
- EWord.Update();
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:修改记录成功!');</script>");
- }
- catch (Exception ex)
- {
- ClientScript.RegisterStartupScript(this.GetType(), "errorMessage", "<script>alert('" + ex.Message.Replace("'", "").Replace("rn", "") + "');</script>");
- }
- }
- }
- }