You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSCustomerWeb/PriceCarrier/ClientChangePassword.aspx.cs

65 lines
2.5 KiB
C#

2 years ago
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using DSWeb.EntityDA;
using DSWeb.Models;
namespace DSWeb.PriceCarrier
{
public partial class ClientChangePassword : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
}
}
protected void btLogin_Click(object sender, EventArgs e)
{
if (tbLOGINNAME.Text.Trim().Equals("") || tbLOGINPASSWORD.Text.Trim().Equals("") || tbLPWNEW.Text.Trim().Equals("") || tbLPWACK.Text.Trim().Equals(""))
{
Response.Write("<script>alert('客户代码、密码等不能为空,请重新填写!');history.back();</script>");
return;
}
//
T_ALL_DA T_ALL_DA = new T_ALL_DA();
DataSet ds = T_ALL_DA.GetAllSQL("select * from [info_client] where 1=1 and LOGINNAME='" + tbLOGINNAME.Text.Trim() + "' and LOGINPASSWORD='" + tbLOGINPASSWORD.Text.Trim() + "'");
if (ds != null)
{
if (ds.Tables[0].Rows[0]["ISSTOP"].ToString().Trim().Equals("1"))
{
Response.Write("<script>alert('此用户已经停用,请联系管理员!');windows.close();</script>");
return;
}
else
{
bool bl = T_ALL_DA.GetExecuteSqlCommand("update [info_client] set LOGINNAME='" + tbLPWNEW.Text.Trim() + "',LOGINPASSWORD='" + tbLPWACK.Text.Trim() + "' where GID='" + ds.Tables[0].Rows[0]["GID"].ToString().Trim() + "' and ISSTOP=0");
if (bl)
{
Response.Write("<script>alert('操作成功!');history.back();</script>");
return;
}
else
{
Response.Write("<script>alert('操作失败!');history.back();</script>");
return;
}
}
}
else
{
Response.Write("<script>alert('用户名不存在,或用户名、密码错误,请重新填写!');history.back();</script>");
return;
}
}
}
}