#region
|
|
using System;
|
using CSFrameworkV5.Business.BLL_Permission;
|
using CSFrameworkV5.Common;
|
using CSFrameworkV5.Library.CommonClass;
|
|
#endregion
|
|
namespace CSFrameworkV5.Library.PermissionForms
|
{
|
public partial class frmCopyPermission : frmBase
|
{
|
public frmCopyPermission()
|
{
|
InitializeComponent();
|
}
|
|
private void btnCancel_Click(object sender, EventArgs e)
|
{
|
Close();
|
}
|
|
private void btnCopy_Click(object sender, EventArgs e)
|
{
|
if (txtSource.Text == "" || txtTarget.Text == "")
|
{
|
Msg.Warning("用户不能为空!");
|
return;
|
}
|
|
if (txtTarget.Text == txtSource.Text)
|
{
|
Msg.Warning("目标用户不能相同!");
|
return;
|
}
|
|
try
|
{
|
frmWaitingEx.ShowMe(this);
|
|
var ok = new bllUser().CopyPermission(
|
ConvertEx.ToString(txtSource.EditValue),
|
ConvertEx.ToString(txtTarget.EditValue));
|
|
if (ok)
|
{
|
Msg.ShowInformation("复制权限成功!");
|
Close();
|
}
|
else
|
{
|
Msg.ShowInformation("复制权限失败!");
|
}
|
}
|
catch (Exception ex)
|
{
|
Msg.ShowException(ex);
|
}
|
finally
|
{
|
frmWaitingEx.HideMe(this);
|
}
|
}
|
|
public static void Execute(string accountSource, string accountTarget)
|
{
|
var form = new frmCopyPermission();
|
form.txtSource.EditValue = accountSource;
|
form.txtTarget.EditValue = accountTarget;
|
form.ShowDialog();
|
}
|
|
private void frmCopyPermission_Load(object sender, EventArgs e)
|
{
|
PermissionBinder.BoundUser(txtSource);
|
PermissionBinder.BoundUser(txtTarget);
|
}
|
}
|
}
|