📄 bindstaff.aspx.cs
字号:
InitCurRole();
InitAllRole();
InitCurPosition();
InitAllPosition();
InitCurTeam();
InitAllTeam();
InitCurTeamLeader();
InitAllTeamLeader();
InitCurStaff();
InitAllStaff();
InitAllMember();
}
#endregion
private void InitHeadLine()
{
UDS.Components.DocumentFlow df = new UDS.Components.DocumentFlow();
labTitle.Text = df.GetFlowTitle(FlowID) + "->" + df.GetStepTitle(FlowID,StepID);
df = null;
}
protected void cmdAdd_Click(object sender, System.EventArgs e)
{
if(lstAllRole.SelectedIndex >=0)
{
Database mySQL = new Database();
foreach(ListItem li in lstAllRole.Items)
{
if(li.Selected ==true)
{
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@StepID",SqlDbType.Int ,4,StepID),
mySQL.MakeInParam("@RoleID",SqlDbType.Int ,4,Int32.Parse (li.Value) )
};
mySQL.RunProc("sp_Flow_AddBangdingRole",parameters);
}
}
mySQL.Close();
mySQL = null;
//Response.Write("<script language='javascript'>alert('绑定成功!');</script>");
Bangding();
}
}
protected void cmdDelete_Click(object sender, System.EventArgs e)
{
if(lstCurRole.SelectedIndex>=0)
{
Database mySQL = new Database();
foreach(ListItem li in lstCurRole.Items)
{
if(li.Selected ==true)
{
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@StepID",SqlDbType.Int ,4,StepID),
//mySQL.MakeInParam("@RoleID",SqlDbType.Int ,4,Int32.Parse(lstCurRole.Items[lstCurRole.SelectedIndex].Value) )
mySQL.MakeInParam("@RoleID",SqlDbType.Int ,4,Int32.Parse(li.Value) )
};
mySQL.RunProc("sp_Flow_DeleteBangdingRole",parameters);
}
}
mySQL.Close();
mySQL = null;
//Response.Write("<script language='javascript'>alert('取消绑定成功!');</script>");
Bangding();
}
}
protected void lstAllRole_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
protected void cmdReturn_Click(object sender, System.EventArgs e)
{
Server.Transfer("ManageFlow.aspx?FlowID=" + FlowID.ToString());
}
protected void cmdAddPositon_Click(object sender, System.EventArgs e)
{
if(lstAllPosition.SelectedIndex >=0)
{
Database mySQL = new Database();
foreach(ListItem li in lstAllPosition.Items )
{
if(li.Selected ==true)
{
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@StepID",SqlDbType.Int ,4,StepID),
mySQL.MakeInParam("@PositionID",SqlDbType.Int ,4,Int32.Parse (li.Value) )
};
mySQL.RunProc("sp_Flow_AddBangdingPosition",parameters);
}
}
mySQL.Close();
mySQL = null;
Bangding();
}
}
protected void cmdDeletePosition_Click(object sender, System.EventArgs e)
{
if(lstCurPosition.SelectedIndex>=0)
{
Database mySQL = new Database();
foreach(ListItem li in lstCurPosition.Items )
{
if(li.Selected ==true)
{
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@StepID",SqlDbType.Int ,4,StepID),
mySQL.MakeInParam("@PositionID",SqlDbType.Int ,4,Int32.Parse (li.Value) )
};
mySQL.RunProc("sp_Flow_DeleteBangdingPosition",parameters);
}
}
mySQL.Close();
mySQL = null;
//Response.Write("<script language='javascript'>alert('取消绑定成功!');</script>");
Bangding();
}
}
protected void cmdDeleteTeam_Click(object sender, System.EventArgs e)
{
if(lstCurTeam.SelectedIndex>=0)
{
Database mySQL = new Database();
foreach(ListItem li in lstCurTeam.Items )
{
if(li.Selected==true)
{
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@StepID",SqlDbType.Int ,4,StepID),
mySQL.MakeInParam("@TeamID",SqlDbType.Int ,4,Int32.Parse (li.Value) )
};
mySQL.RunProc("sp_Flow_DeleteBangdingTeam",parameters);
}
}
mySQL.Close();
mySQL = null;
//Response.Write("<script language='javascript'>alert('取消绑定成功!');</script>");
Bangding();
}
}
protected void cmdDeleteStaff_Click(object sender, System.EventArgs e)
{
if(lstCurStaff.SelectedIndex>=0)
{
Database mySQL = new Database();
foreach(ListItem li in lstCurStaff.Items)
{
if(li.Selected ==true)
{
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@StepID",SqlDbType.Int ,4,StepID),
mySQL.MakeInParam("@StaffID",SqlDbType.Int ,4,Int32.Parse (li.Value) )
};
mySQL.RunProc("sp_Flow_DeleteBangdingStaff",parameters);
}
}
mySQL.Close();
mySQL = null;
//Response.Write("<script language='javascript'>alert('取消绑定成功!');</script>");
Bangding();
}
}
protected void cmdAddTeam_Click(object sender, System.EventArgs e)
{
if(lstAllTeam.SelectedIndex >=0)
{
Database mySQL = new Database();
foreach(ListItem li in lstAllTeam.Items)
{
if(li.Selected ==true)
{
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@StepID",SqlDbType.Int ,4,StepID),
mySQL.MakeInParam("@TeamID",SqlDbType.Int ,4,Int32.Parse (li.Value) )
};
mySQL.RunProc("sp_Flow_AddBangdingTeam",parameters);
}
}
mySQL.Close();
mySQL = null;
Bangding();
}
}
protected void cmdAddStaff_Click(object sender, System.EventArgs e)
{
if(lstAllStaff.SelectedIndex >=0)
{
Database mySQL = new Database();
foreach(ListItem li in lstAllStaff.Items)
{
if(li.Selected ==true)
{
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@StepID",SqlDbType.Int ,4,StepID),
mySQL.MakeInParam("@StaffID",SqlDbType.Int ,4,Int32.Parse (li.Value) )
};
mySQL.RunProc("sp_Flow_AddBangdingStaff",parameters);
}
}
mySQL.Close();
mySQL = null;
Bangding();
}
}
protected void lstCurRole_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
protected void cmdAddTeamLeader_Click(object sender, System.EventArgs e)
{
if(lstAllTeamLeader.SelectedIndex >=0)
{
Database mySQL = new Database();
foreach(ListItem li in lstAllTeamLeader.Items)
{
if(li.Selected ==true)
{
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@StepID",SqlDbType.Int ,4,StepID),
mySQL.MakeInParam("@TeamID",SqlDbType.Int ,4,Int32.Parse (li.Value) )
};
mySQL.RunProc("sp_Flow_AddBangdingTeamLeader",parameters);
}
}
mySQL.Close();
mySQL = null;
Bangding();
}
}
protected void cmdDeleteTeamLeader_Click(object sender, System.EventArgs e)
{
if(lstCurTeamLeader.SelectedIndex>=0)
{
Database mySQL = new Database();
foreach(ListItem li in lstCurTeamLeader.Items )
{
if(li.Selected==true)
{
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@StepID",SqlDbType.Int ,4,StepID),
mySQL.MakeInParam("@TeamID",SqlDbType.Int ,4,Int32.Parse (li.Value) )
};
mySQL.RunProc("sp_Flow_DeleteBangdingTeamLeader",parameters);
}
}
mySQL.Close();
mySQL = null;
//Response.Write("<script language='javascript'>alert('取消绑定成功!');</script>");
Bangding();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -