96 lines
3.0 KiB
C#
96 lines
3.0 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;
|
|||
|
|
using System.Text.RegularExpressions;
|
|||
|
|
using WeiSha.WebControl;
|
|||
|
|
|
|||
|
|
namespace Song.Site.Manage.Sys
|
|||
|
|
{
|
|||
|
|
public partial class Organization_Admin : Extend.CustomPage
|
|||
|
|
{
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>id
|
|||
|
|
private int id = WeiSha.Common.Request.QueryString["id"].Decrypt().Int32 ?? 0;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>ɫ<EFBFBD><C9AB>id
|
|||
|
|
protected string superid = "";
|
|||
|
|
protected void Page_Load(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
Song.Entities.Position super = Business.Do<IPosition>().GetAdmin(id);
|
|||
|
|
superid = super.Posi_Id.ToString();
|
|||
|
|
if (!this.IsPostBack)
|
|||
|
|
{
|
|||
|
|
BindData(null,null);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
protected void BindData(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
//<2F>ܼ<EFBFBD>¼<EFBFBD><C2BC>
|
|||
|
|
//<2F><>ǰѡ<C7B0><D1A1><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD>id
|
|||
|
|
int orgId = (int)Extend.LoginState.Admin.CurrentUser.Org_ID;
|
|||
|
|
EmpAccount[] eas = null;
|
|||
|
|
eas = Business.Do<IEmployee>().GetAll4Org(id, true, "");
|
|||
|
|
|
|||
|
|
GridView1.DataSource = eas;
|
|||
|
|
GridView1.DataKeyNames = new string[] { "acc_id" };
|
|||
|
|
GridView1.DataBind();
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
Message.ExceptionShow(ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><EFBFBD><DEB8>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ<EFBFBD><CABE>״̬
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
protected void sbAdmin_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
StateButton ub = (StateButton)sender;
|
|||
|
|
int index = ((GridViewRow)(ub.Parent.Parent)).RowIndex;
|
|||
|
|
//<2F><>ȡԱ<C8A1><D4B1>id
|
|||
|
|
int accid = int.Parse(this.GridView1.DataKeys[index].Value.ToString());
|
|||
|
|
Song.Entities.EmpAccount entity = Business.Do<IEmployee>().GetSingle(accid);
|
|||
|
|
//<2F>ֳ<EFBFBD><D6B3>Ĺ<EFBFBD><C4B9><EFBFBD><EFBFBD><EFBFBD>λ
|
|||
|
|
Song.Entities.Position posi = Business.Do<IPosition>().GetAdmin(id);
|
|||
|
|
|
|||
|
|
entity.Posi_Id = posi.Posi_Id;
|
|||
|
|
entity.Posi_Name = posi.Posi_Name;
|
|||
|
|
Business.Do<IEmployee>().Save(entity);
|
|||
|
|
BindData(null, null);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
Message.ExceptionShow(ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>жϵ<D0B6>ǰԱ<C7B0><D4B1><EFBFBD>Dz<EFBFBD><C7B2>Ƿֳ<C7B7><D6B3><EFBFBD><EFBFBD><EFBFBD>Ա
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="accid"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
protected bool GetAminState(string accid)
|
|||
|
|
{
|
|||
|
|
return Business.Do<IEmployee>().IsAdmin(Convert.ToInt32(accid));
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|