您目前尚未登陆,请选择【登陆】或【注册
首页->全站代码->达达ASP.NET企业信息管理系统>>Admin/Admin_EditWorks.aspx.cs>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:达达ASP.NET企业信息管理系统


当前文件路径:DaDaEnterprise/Admin/Admin_EditWorks.aspx.cs 文件类型
普通视图
		            
1using System; 2using System.Collections; 3using System.Configuration; 4using System.Data; 5using System.Web; 6using System.IO; 7using System.Web.Security; 8using System.Web.UI; 9using System.Web.UI.HtmlControls; 10using System.Web.UI.WebControls; 11using System.Web.UI.WebControls.WebParts; 12 13public partial class Admin_Admin_EditWorks : System.Web.UI.Page 14{ 15 protected void Page_Load(object sender, EventArgs e) 16 { 17 DataAccess.IsAdmin(); 18 string sql = "select * from [Works] where id=" + Request.QueryString["id"]; 19 DataTable Dt = DataAccess.GetDataTable(sql); 20 if (!IsPostBack) 21 { 22 if (Dt.Rows[0]["show"].ToString() == "1") 23 { 24 CheckBox1.Checked = true; 25 } 26 else CheckBox1.Checked = false; 27 28 TextBox1.Text = Dt.Rows[0]["Name"].ToString(); 29 Content.Value = Dt.Rows[0]["Content"].ToString(); 30 TextBox2.Text = Dt.Rows[0]["PhotoUrl"].ToString(); 31 Money.Text = Dt.Rows[0]["Money"].ToString(); 32 TextBox4.Text = Dt.Rows[0]["WorksUrl"].ToString(); 33 Demo.Text = Dt.Rows[0]["Demo"].ToString(); 34 } 35 } 36 37 //上传事件 38 protected void UpFile_Click(object sender, EventArgs e) 39 { 40 if (FileUpload1.HasFile) 41 { 42 string Name = FileUpload1.FileName; 43 //文档上传到的固定目录 如果需要修改必须必须2个都修改 44 string SaveSoft = Server.MapPath("..\\Photo\\"); 45 46 string Fe = Name.Substring(Name.LastIndexOf(".") + 1); 47 48 SaveSoft += Name; 49 50 Directory.CreateDirectory(Server.MapPath("..\\Photo\\")); 51 52 FileUpload1.SaveAs(SaveSoft); 53 54 TextBox2.Text = "Photo\\" + Name; 55 56 } 57 else Response.Write("<script>alert('请选择要上传的文件');</script>"); 58 } 59 60 protected void Sub_Click(object sender, EventArgs e) 61 { 62 int show; 63 if (CheckBox1.Checked) 64 { 65 show = 1; 66 } 67 else show = 2; 68 string sql = "update [Works] set Name='" 69 + TextBox1.Text + "', Content='" 70 + Content.Value + "',PhotoUrl='" 71 + TextBox2.Text + "',[Money]='" 72 + Money.Text + "',WorksUrl='" 73 + TextBox4.Text + "',Demo='" 74 + Demo.Text + "',show='" + show + "' where id=" + Request.QueryString["id"]; 75 if (!String.IsNullOrEmpty(TextBox1.Text)) 76 { 77 if (DataAccess.ExecuteCmd(sql) > 0) 78 { 79 Response.Redirect("./Admin_Works.aspx"); 80 } 81 else Response.Write("<script>alert('编辑失败!');</script>"); 82 } 83 else Response.Write("<script>alert('作品名不能为空!');</script>"); 84 } 85} 86
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:达达ASP.NET企业信息管理系统

- 深圳某模具厂网站源码

- 51aspx无刷新仿google波形扭..

- 简单文章管理系统

- Solog音乐Blog三层开源版1.0

- ASP.NET网站广告管理系统

- 留缘木头Asp.net多用户留言板2.0

- 信管家园整站系统源码

- B2C商城综合系统项目源码

51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号