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) { AdvInfo ob = new AdvInfo(); ob.title = tbtitle.Text; ob.imgurl = tbimgUrl.Text; ob.imglink = tbimgLink.Text; ob.flyimagewidth = int.Parse(tbFlyImageWidth.Text); ob.flyimageheight = int.Parse(tbFlyImageHeight.Text); ob.addtime = Convert.ToDateTime(tbAddTime.Text); ob.flag = this.rbFlag.SelectedValue == "1" ? true : false; AdvInfoService.InsertAdvInfo(ob); try { string script = "<script>if(confirm('是否继续添加?')){location='" + Request.Url.ToString() + "';}else{location='advInfo_add.aspx';}</script>"; Response.Write(script); Response.End(); } catch { ShowJs.ShowAndRedirect("添加失败!", "advInfo_add.aspx", this.Page); } }
protected void sbEdit_ServerClick(object sender, EventArgs e) { if (Request["id"] != null) { try { AdvInfo ob = AdvInfoService.GetAdvInfoById(int.Parse(Request["id"])); if (ob != null) { ob.title = tbtitle.Text; ob.imgurl = tbimgUrl.Text; ob.imglink = tbimgLink.Text; ob.flyimagewidth = int.Parse(tbFlyImageWidth.Text); ob.flyimageheight = int.Parse(tbFlyImageHeight.Text); ob.addtime = Convert.ToDateTime(tbAddTime.Text); ob.flag = this.rbFlag.SelectedValue == "1" ? true : false; AdvInfoService.UpdateAdvInfo(ob); } } catch { ShowJs.ShowAndRedirect("修改失败!", hdUrl.Value, this.Page); } } ShowJs.ShowAndRedirect("修改成功!", hdUrl.Value, 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 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 Submit1_ServerClick(object sender, EventArgs e) { Role ob = new Role(); ob.rolename = this.tbName.Text.Trim(); ob.depth = 0; ob.pid = 0; ShowJs.ShowAndRedirect("添加成功!", "role_add.aspx", this.Page); }
protected void Submit1_ServerClick(object sender, EventArgs e) { NewsType ob = new NewsType(); ob.typename = tbTitle.Text.Trim(); ob.p_id = Request["id"] != null?int.Parse(Request["id"]) : 0; ob.issimple = int.Parse(rbIssimple.SelectedValue); ob.sort = int.Parse(tbSord.Text); NewsTypeService.InsertNewsType(ob); ShowJs.ShowAndRedirect("添加成功!", Request.Url.ToString(), this.Page); }
protected void btEdit_Click(object sender, EventArgs e) { if (Request["edit"] != null) { Role ob = RoleService.GetRoleById(int.Parse(Request["edit"])); if (ob != null) { ob.rolename = this.tbName.Text.Trim(); RoleService.UpdateRole(ob); } ShowJs.ShowAndRedirect("修改成功!", "role_add.aspx", this.Page); } }
protected void sbEdit_ServerClick(object sender, EventArgs e) { NewsType ob = NewsTypeService.GetNewsTypeById(int.Parse(Request["edit"])); if (ob != null) { ob.typename = tbTitle.Text.Trim(); ob.issimple = int.Parse(rbIssimple.SelectedValue); ob.sort = int.Parse(tbSord.Text); NewsTypeService.UpdateNewsType(ob); } ShowJs.ShowAndRedirect("修改成功!", hdUrl.Value, this.Page); }
protected void btSub_Click(object sender, EventArgs e) { SettingManager.WebName = this.tsName.Text; SettingManager.SetParam("SEO.DefaultTitle", this.tsTitle.Text); SettingManager.SetParam("SEO.DefaultMetaDescription", this.tsDescription.Text); SettingManager.SetParam("SEO.DefaultMetaKeywords", this.tsKeywords.Text); SettingManager.Copyright = this.tbContent.Text; SettingManager.WebUrl = this.tsSiteUrl.Text; SettingManager.Address = this.tsAddress.Text; SettingManager.Fax = this.tsFax.Text; SettingManager.MobilePhone = this.tsPhone.Text; SettingManager.TelPhone = this.tsTel.Text; SettingManager.WeiXin = this.tsWeiXin.Text; SettingManager.QQ = this.tsQQ.Text; ShowJs.ShowAndRedirect("设置成功!", Request.Url.ToString(), this.Page); }
protected void btEdit_Click(object sender, EventArgs e) { if (Request["edit"] != null) { Link ob = LinkService.GetLinkById(int.Parse(Request["edit"])); if (ob != null) { 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.UpdateLink(ob); } ShowJs.ShowAndRedirect("修改成功!", "link_manage.aspx", 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 btEdit_Click(object sender, EventArgs e) { if (Request["edit"] != null) { Admin ob = AdminService.GetAdminById(int.Parse(Request["edit"])); if (ob != null) { ob.truename = tbTruename.Text; ob.flag = rbFlag.SelectedValue == "1"?true:false; ob.roleid = int.Parse(this.ddlrole.SelectedValue); if (this.tbRestPass.Text.Trim() != "") { ob.password = AdminService.encry(this.tbRestPass.Text.Trim()); } AdminService.UpdateAdmin(ob); } ShowJs.ShowAndRedirect("修改成功!", "admin_manage.aspx", this.Page); } }
protected void btSub_Click(object sender, EventArgs e) { if (Request["roleid"] != null) { int roleid = int.Parse(Request["roleid"]); checkRank(cblmodule11, roleid); checkRank(cblmodule10, roleid); checkRank(cblmodule9, roleid); checkRank(cblmodule8, roleid); checkRank(cblmodule7, roleid); checkRank(cblmodule6, roleid); checkRank(cblmodule5, roleid); checkRank(cblmodule4, roleid); checkRank(cblmodule3, roleid); checkRank(cblmodule2, roleid); checkRank(cblmodule1, roleid); ShowJs.ShowAndRedirect("设置成功!", hdback.Value, this.Page); } }