73 lines
2.0 KiB
C#
73 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using AllBase.Model.Result;
|
|
|
|
namespace TemuKJD.PDDForms.ShopForms
|
|
{
|
|
public partial class UcSubAccount : UserControl
|
|
{
|
|
public ShopSubAccountInfo subAccount = null;
|
|
|
|
public delegate void SubAcountDelegate(object obj);
|
|
|
|
public event SubAcountDelegate AddSubAcountEvent;
|
|
public event SubAcountDelegate RemoveSubAcountEvent;
|
|
|
|
public UcSubAccount(ShopSubAccountInfo _subAccount, bool isNotShopSubAccount = true)
|
|
{
|
|
InitializeComponent();
|
|
subAccount = _subAccount;
|
|
if (isNotShopSubAccount)
|
|
lblRight.Visible = false;
|
|
else
|
|
lblLeft.Visible = false;
|
|
|
|
this.Load += UcSubAccount_Load;
|
|
}
|
|
|
|
public void AddAccount()
|
|
{
|
|
this.lblLeft_Click(null, null);
|
|
}
|
|
|
|
public void DeleteAccount()
|
|
{
|
|
this.lblRight_Click(null, null);
|
|
}
|
|
|
|
private void UcSubAccount_Load(object sender, EventArgs e)
|
|
{
|
|
this.lblSubAccountName.Text = subAccount.user_name;
|
|
this.lblSubAccountGroupName.Text = subAccount.group_name;
|
|
this.lblSubAccountName.Resize += Lbl_Resize;
|
|
this.lblSubAccountGroupName.Resize += Lbl_Resize;
|
|
}
|
|
|
|
|
|
private void Lbl_Resize(object sender, EventArgs e)
|
|
{
|
|
}
|
|
|
|
public void lblLeft_Click(object sender, EventArgs e)
|
|
{
|
|
this.lblRight.Visible = true;
|
|
this.lblLeft.Visible = false;
|
|
AddSubAcountEvent?.Invoke(this);
|
|
}
|
|
|
|
public void lblRight_Click(object sender, EventArgs e)
|
|
{
|
|
this.lblRight.Visible = false;
|
|
this.lblLeft.Visible = true;
|
|
RemoveSubAcountEvent?.Invoke(this);
|
|
}
|
|
}
|
|
}
|