115 lines
3.9 KiB
C#
115 lines
3.9 KiB
C#
|
|
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 WeiSha.Common;
|
|||
|
|
|
|||
|
|
using Song.ServiceInterfaces;
|
|||
|
|
using Song.Entities;
|
|||
|
|
|
|||
|
|
namespace Song.Site.Manage.Admin
|
|||
|
|
{
|
|||
|
|
public partial class Student_Password : Extend.CustomPage
|
|||
|
|
{
|
|||
|
|
private int id = WeiSha.Common.Request.QueryString["id"].Int32 ?? 0;
|
|||
|
|
protected void Page_Load(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
if (!this.IsPostBack)
|
|||
|
|
{
|
|||
|
|
fill();
|
|||
|
|
}
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
|
//this.trPw1.Visible = this.trPw2.Visible = id == 0;
|
|||
|
|
}
|
|||
|
|
private void fill()
|
|||
|
|
{
|
|||
|
|
Song.Entities.Accounts ea;
|
|||
|
|
if (id == 0) return;
|
|||
|
|
ea = Business.Do<IAccounts>().AccountsSingle(id);
|
|||
|
|
//Ա<><D4B1><EFBFBD>ʺ<EFBFBD>
|
|||
|
|
this.tbStudentAcc.Text = ea.Ac_AccName;
|
|||
|
|
//Ա<><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
this.lbName.Text = ea.Ac_Name;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>֤<EFBFBD>˺<EFBFBD><CBBA>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="source"></param>
|
|||
|
|
/// <param name="args"></param>
|
|||
|
|
protected void cusv_ServerValidate(object source, ServerValidateEventArgs args)
|
|||
|
|
{
|
|||
|
|
Song.Entities.Organization org = Business.Do<IOrganization>().OrganCurrent();
|
|||
|
|
Song.Entities.Accounts th = Business.Do<IAccounts>().AccountsSingle(this.tbStudentAcc.Text.Trim(), org.Org_ID);
|
|||
|
|
if (th == null) th = new Entities.Accounts();
|
|||
|
|
th.Org_ID = org.Org_ID;
|
|||
|
|
th.Ac_AccName = this.tbStudentAcc.Text.Trim();
|
|||
|
|
//<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>֤
|
|||
|
|
Song.Entities.Accounts t = Business.Do<IAccounts>().IsAccountsExist(org.Org_ID, th);
|
|||
|
|
args.IsValid = t==null;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><EFBFBD><DEB8>˺<EFBFBD><CBBA><EFBFBD>Ϣ
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
protected void btnAcc_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if (!Extend.LoginState.Admin.IsAdmin) throw new Exception("<22>ǹ<EFBFBD><C7B9><EFBFBD>Ա<EFBFBD><D4B1>Ȩ<EFBFBD>˲<EFBFBD><CBB2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>");
|
|||
|
|
if (id == 0) throw new Exception("<22><>ǰ<EFBFBD><C7B0>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>");
|
|||
|
|
//<2F><>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
if (!cusv.IsValid)
|
|||
|
|
return;
|
|||
|
|
Song.Entities.Accounts obj;
|
|||
|
|
obj = Business.Do<IAccounts>().AccountsSingle(id);
|
|||
|
|
obj.Ac_AccName = tbStudentAcc.Text.Trim();
|
|||
|
|
Business.Do<IAccounts>().AccountsSave(obj);
|
|||
|
|
Master.AlertCloseAndRefresh("<22><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>");
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
Master.Alert(ex.Message);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
protected void btnPw_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if (!Extend.LoginState.Admin.IsAdmin) throw new Exception("<22>ǹ<EFBFBD><C7B9><EFBFBD>Ա<EFBFBD><D4B1>Ȩ<EFBFBD>˲<EFBFBD><CBB2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>");
|
|||
|
|
if (id == 0) throw new Exception("<22><>ǰ<EFBFBD><C7B0>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>");
|
|||
|
|
//<2F><>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
if (!cusv.IsValid)
|
|||
|
|
return;
|
|||
|
|
Song.Entities.Accounts obj;
|
|||
|
|
obj = Business.Do<IAccounts>().AccountsSingle(id);
|
|||
|
|
//Ա<><D4B1><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>룬Ϊ<EBA3AC><CEAA>
|
|||
|
|
if (tbPw1.Text.Trim() != "")
|
|||
|
|
obj.Ac_Pw = tbPw1.Text.Trim();
|
|||
|
|
obj.Ac_Pw = new WeiSha.Common.Param.Method.ConvertToAnyValue(obj.Ac_Pw).MD5;
|
|||
|
|
Business.Do<IAccounts>().AccountsSave(obj);
|
|||
|
|
Master.AlertCloseAndRefresh("<22><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>");
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
Master.Alert(ex.Message);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|