protected void btSub_Click(object sender, EventArgs e) { try { FeedBack m = new FeedBack(); m.title = this.tbtitle.Value.Trim(); m.company = this.tbcompany.Value.Trim(); m.address = this.tbaddress.Value.Trim(); // m["zip"] = this.tbzip.Value.Trim(); m.username = this.tbusername.Value.Trim(); // m["mobile"] = this.tbmobile.Value.Trim(); m.phone = this.tbphone.Value.Trim(); // m["fax"] = this.tbFax.Value.Trim(); m.email = this.tbemail.Value.Trim(); m.content = this.tbcontent.Value; m.addtime = DateTime.Now; m.flag = false; m.type = 1; FeedBackService.InsertFeedBack(m); ShowJs.ShowAndRedirect("感谢您的留言!", Request.Url.ToString(), this.Page); } catch (Exception) { ShowJs.ShowAndBack("提交失败!", this.Page); } }
protected void Submit1_ServerClick(object sender, EventArgs e) { if (tbName.Text.Trim() != "" && tbPass.Text != "" && tbPass2.Text != "" && tbPass2.Text == tbPass.Text) { Admin ob = AdminService.GetAdminByUserName(tbName.Text.Trim()); if (ob == null) { ob = new Admin(); ob.username = tbName.Text.Trim(); ob.truename = tbTruename.Text; ob.password = AdminService.encry(tbPass.Text.Trim()); ob.p_id = AdminService.Adminid; ob.roleid = Convert.ToInt32(this.ddlrole.SelectedValue); ob.flag = rbFlag.SelectedValue == "1" ? true : false; ob.logincount = 0; ob.addtime = DateTime.Now; ob.lasttime = DateTime.Now; ob.modi_date = DateTime.Now; AdminService.InsertAdmin(ob); ShowJs.ShowAndRedirect("添加成功!", "admin_manage.aspx", this.Page); } else { ShowJs.ShowAndBack("此用户名已经存在!", this.Page); } } else { ShowJs.ShowAndBack("您的输入有误!", this.Page); } }
protected void Submit1_ServerClick(object sender, EventArgs e) { if (!System.IO.File.Exists(path1)) { System.IO.Directory.CreateDirectory(path1); } if (!System.IO.File.Exists(path2)) { System.IO.Directory.CreateDirectory(path2); } try { News ob = new News(); ob.title = tbTitle.Text.Trim(); ob.type = Convert.ToInt32(ddlType.SelectedValue); ob.content = txtFull.Text; ob.flag = rbComm.SelectedValue == "1" ? true : false; ob.author = tbAuthor.Text; ob.title2 = this.tbTitle2.Text; ob.isdiredict = this.rbisdiredict.SelectedValue == "1" ? true : false; ob.url = this.tburl.Text.Trim(); if (this.upFile.HasFile) { ob.img = App_ImgPath + UpFile(upFile, path1); } if (this.upFile1.HasFile) { ob.upfile = App_FilePath + UpFile(upFile1, path2); } if (this.tbfile.Text.Trim() != "" && this.tbfile.Visible == true) { ob.upfile = this.tbfile.Text.Trim(); } ob.addtime = Convert.ToDateTime(this.tbTime.Text); ob.adduser = AdminService.Adminid; ob.source = tbSource.Text; ob.istop = false; ob.isdelete = false; ob.hits = 0; ob.comm = false; ob.publish_new = true; NewsService.InsertNews(ob); string script = "<script>if(confirm('是否继续添加?')){location='" + Request.Url.ToString() + "';}else{location='news_manage.aspx?type=" + Request["type"] + "';}</script>"; Response.Write(script); Response.End(); } catch (Exception) { ShowJs.ShowAndBack("添加失败!", this.Page); } }
protected void sbEdit_ServerClick(object sender, EventArgs e) { if (!System.IO.File.Exists(path1)) { System.IO.Directory.CreateDirectory(path1); } try { News ob = NewsService.GetNewsById(int.Parse(Request["edit"])); if (ob != null) { ob.title = tbTitle.Text.Trim(); ob.type = Convert.ToInt32(ddlType.SelectedValue); ob.content = txtFull.Text; ob.flag = rbComm.SelectedValue == "1" ? true : false; ob.author = tbAuthor.Text; ob.title2 = this.tbTitle2.Text; ob.isdiredict = this.rbisdiredict.SelectedValue == "1" ? true : false; ob.url = this.tburl.Text.Trim(); if (upFile.HasFile) { if (!string.IsNullOrEmpty(ob.img)) { if (File.Exists(path1 + ob.img)) { File.Delete(path1 + ob.img); } } ob.img = App_ImgPath + UpFile(upFile, path1); } if (upFile1.HasFile) { if (!string.IsNullOrEmpty(ob.upfile)) { File.Delete(path2 + ob.upfile); } ob.upfile = App_FilePath + UpFile(upFile1, path2); } if (this.tbfile.Text.Trim() != "" && this.tbfile.Visible == true) { ob.upfile = this.tbfile.Text.Trim(); } ob.source = tbSource.Text; ob.adduser = AdminService.Adminid; NewsService.UpdateNews(ob); } ShowJs.ShowAndRedirect("修改成功!", hdUrl.Value, this.Page); } catch (Exception) { ShowJs.ShowAndBack("修改失败!", this.Page); } }
protected void Button1_Click(object sender, EventArgs e) { if (tbNewPass.Text == tbNewPass2.Text) { string mess = ""; mess = AdminService.SetPsw(AdminService.Adminid, tbOp.Text, tbNewPass.Text); ShowJs.ShowAndBack(mess, this.Page); } else { ShowJs.ShowAndBack("两次输入密码不一样!", this.Page); } }
protected void imgBut_Click(object sender, ImageClickEventArgs e) { string mes = AdminService.checklogin(this.txtUserName.Value, this.txtPassWord.Value, Page.Request.UserHostAddress); if (mes == "") { Response.Redirect("index.aspx"); } else { ShowJs.ShowAndBack(mes, this.Page); } }
protected void Submit1_ServerClick(object sender, EventArgs e) { if (tbtitle.Text.Trim() != "" && tburl.Text != "" && tbsort.Text != "") { Link ob = new Link(); ob.title = this.tbtitle.Text.Trim(); ob.url = this.tburl.Text; ob.sort = int.Parse(this.tbsort.Text); ob.flag = this.rbFlag.SelectedValue == "1" ? true : false; ob.type = int.Parse(this.ddltype.SelectedValue); LinkService.InsertLink(ob); ShowJs.ShowAndRedirect("添加成功!", "link_add.aspx", this.Page); } else { ShowJs.ShowAndBack("您的输入有误!", this.Page); } }
protected void Page_Load(object sender, EventArgs e) { // if (!LJH.Rank.IsModuleRank(1501)) // { // Response.Write("<div style='width:100%;margin-top:200px;text-align:center;color:red;'>您没有本模块的操作权限! 请与管理员联系!</div>"); // Response.End(); // } if (!IsPostBack) { if (Request["del"] != null) { int id = AdminService.GetAdminPid(int.Parse(Request["del"])); if (id != 0) { AdminService.DeleteByPid(int.Parse(Request["del"])); AdminService.DeleteAdmin(int.Parse(Request["del"])); // LJH.Admin.ExecuteNonQuery("delete tAdmin where p_id=" + Request["del"]); // LJH.Admin.ExecuteNonQuery("delete tAdmin where id=" + Request["del"]); // LJH.Admin.ExecuteNonQuery("delete tLogin_log where admin_id=" + Request["del"]); Response.Redirect("admin_manage.aspx"); } else { ShowJs.ShowAndBack("超级管理员不能删除!", this.Page); } } else if (Request["flag"] != null && Request["id"] != null) { AdminService.SetFlag(Request["flag"].ToString() == "1"?true:false, int.Parse(Request["id"])); Response.Redirect("admin_manage.aspx"); } else { rtAdmin.DataSource = AdminService.GetAdminByPid(AdminService.Adminid); rtAdmin.DataBind(); } } }