Car/Admin/Log/AddLog.aspx.cs
(完整代码) 2KBusing System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Car.Admin.Log
{
public partial class AddLog : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
OptionInfoID.DataSource = DBUtility.DbHelperSQL.Query("select * from UserOption where Verify = 1 and Flag = 1 and State = 0 and OptionType = 1").Tables[0];
OptionInfoID.DataTextField = "Title";
OptionInfoID.DataValueField = "InfoID";
OptionInfoID.DataBind();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Hashtable ht = new Hashtable();
ht.Add("Flag", 0);
ht.Add("LogID", DateTime.Now.ToString("yyyyMMddHHmmssfff"));
ht.Add("Category", 1);
ht.Add("UserType", usertype.Items[usertype.SelectedIndex].Value);
ht.Add("OptionInfoID", OptionInfoID.Value);
if (usertype.Items[usertype.SelectedIndex].Value == "临时用户")
{
ht.Add("CarID", carid.Value);
ht.Add("UserLoginName", Text1.Value);
}
else
{
ht.Add("UserInfoID", HiddenField1.Value);
DataTable dt = new BLL.Models.Car().GetContentInfo(int.Parse(HiddenField1.Value), "UserTable");
ht.Add("CarID",dt.Rows[0]["CarID"].ToString());
ht.Add("UserLoginName", dt.Rows[0]["LoginName"].ToString());
}
if (new BLL.Models.Car().AddContent("CarLog", ht) > 0)
{
DBUtility.DbHelperSQL.ExecuteSql("update UserOption set State = 1 where InfoID = " + OptionInfoID.Items[OptionInfoID.SelectedIndex].Value);
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), System.DateTime.Now.Ticks.ToString(), "layer.alert('操作成功!', {icon: 1,kin: 'layer-ext-moon',closeBtn: 0}, function () { location.href = 'CarLog.aspx';})", true);
}
else
{
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), System.DateTime.Now.Ticks.ToString(), "layer.alert('操作失败!', {icon: 2,kin: 'layer-ext-moon',closeBtn: 0})", true);
}
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。