1 Star 3 Fork 0

Admin/MyWebSms

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
addtxlclass.aspx.cs 2.06 KB
一键复制 编辑 原始数据 按行查看 历史
Ai鹿子 提交于 2022-04-24 10:09 . 01
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 dal.tooldal;
public partial class addtxlclass : WebPage
{
Users us = new Users();
public string action = "";
protected void Page_Load(object sender, EventArgs e)
{
this.VerifyPage();
try
{
action = Request.QueryString.Get("action");
}
catch
{
}
if (!Page.IsPostBack)
{
if (action == "edit")
{
editbinds();
}
}
}
private void editbinds()
{
txlclassname.Value = Request.QueryString.Get("name");
}
protected void btnok_Click(object sender, EventArgs e)
{
string getValue = txlclassname.Value.Trim();
if (action == "edit")
{
string getid = Request.QueryString.Get("id");
editbinds(getid,getValue);
}
if (action == "add")
{
addbinds(getValue);
}
}
private void addbinds(string _value)
{
string sql = "insert into [Table_TxlClass] (name,userid) values ('" + _value + "',"+CurrentUser.UserID+")";
if (GetData.UpdateDatabase(sql) != -1)
{
WebPage.ShowMsgAndCloseAndLocation("分组添加成功!", "txml.aspx", Page);
}
else
{
WebPage.ShowMsg("添加失败!", this.Page);
}
}
private void editbinds(string _id,string _value)
{
string sql = "update [Table_TxlClass] set name='" + _value + "' where id="+_id +" and userid="+CurrentUser.UserID;
if (GetData.UpdateDatabase(sql) != -1)
{
WebPage.ShowMsgAndCloseAndLocation("分组编辑成功!", "txml.aspx", Page);
}
else
{
WebPage.ShowMsg("编辑失败!", this.Page);
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/huanghe_1_0/my-web-sms.git
git@gitee.com:huanghe_1_0/my-web-sms.git
huanghe_1_0
my-web-sms
MyWebSms
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385