213 lines
8.3 KiB
C#
213 lines
8.3 KiB
C#
using AllBase;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using TemuKJD.KJDForms.AdminForms;
|
|
using TemuKJD.BaseForms;
|
|
using TemuKJD.KJDForms.ProductSelectForms;
|
|
using TemuKJD.KJDForms.ProductThirdSelectForms;
|
|
using TemuKJD.KJDForms.ProductForms;
|
|
using TemuKJD.KJDForms.JITForms;
|
|
using TemuKJD.BLL;
|
|
|
|
namespace TemuKJD.KJDForms.AdminForms
|
|
{
|
|
public partial class AdminForm : BaseForm
|
|
{
|
|
public Lazy<AdminAccountForm> adminAccountForm = new Lazy<AdminAccountForm>();
|
|
public Lazy<AdminShopListForm> adminShopForm = new Lazy<AdminShopListForm>();
|
|
public Lazy<DbProductListForm> dbProductListForm = new Lazy<DbProductListForm>();
|
|
public Lazy<DbPriceMarkUpForm> dbPriceMarkUpForm = new Lazy<DbPriceMarkUpForm>();
|
|
public Lazy<DbProductSelectListManageForm> dbProductSelectListManageForm = new Lazy<DbProductSelectListManageForm>();
|
|
public Lazy<ProductThirdSelectListManageForm> productThirdSelectListManageForm = new Lazy<ProductThirdSelectListManageForm>();
|
|
public Lazy<AdminProductPriceCheckForm> adminProductPriceCheckForm = new Lazy<AdminProductPriceCheckForm>();
|
|
public Lazy<JoinDeliveryForm> joinDeliveryFrom = new Lazy<JoinDeliveryForm>();
|
|
public Lazy<TemuJitForm> jitForm = new Lazy<TemuJitForm>();
|
|
public Lazy<AdminCardCodeForm> adminCardCodeFrom = new Lazy<AdminCardCodeForm>();
|
|
public Lazy<JitPushOrder> jitPushOrder = new Lazy<JitPushOrder>();
|
|
|
|
public AdminForm()
|
|
{
|
|
InitializeComponent();
|
|
|
|
try
|
|
{
|
|
tv.SelectedNode = tv.Nodes[0].Nodes[0];
|
|
tv.ExpandGroup(tv.Nodes[0].Name);
|
|
|
|
List<string> hideName = new List<string>() { "超级用户管理", "超级店铺管理", "选品数据库", "选品加价管理", "认领待上传", "库存上传", "商品核价",
|
|
"加入发货台", "开通JIT", "JIT卡密管理", "JIT订单扣费" };
|
|
|
|
if (BaseClass.GroupId == 3)
|
|
{
|
|
/*BaseClass.UserName == "18888888888" || BaseClass.UserName == "15333333333"*/
|
|
if (BaseClass.SaLevel==1)
|
|
{
|
|
hideName.Remove("超级用户管理");
|
|
hideName.Remove("超级店铺管理");
|
|
hideName.Remove("选品数据库");
|
|
hideName.Remove("选品加价管理");
|
|
hideName.Remove("认领待上传");
|
|
hideName.Remove("库存上传");
|
|
hideName.Remove("商品核价");
|
|
hideName.Remove("加入发货台");
|
|
if (MainForm.instance.pnlJit.Visible == true)
|
|
hideName.Remove("JIT卡密管理");
|
|
hideName.Remove("JIT订单扣费");
|
|
hideName.Remove("开通JIT");
|
|
}
|
|
if (BaseClass.SaLevel==2)
|
|
{
|
|
hideName.Remove("超级店铺管理");
|
|
hideName.Remove("认领待上传");
|
|
hideName.Remove("库存上传");
|
|
hideName.Remove("商品核价");
|
|
hideName.Remove("加入发货台");
|
|
hideName.Remove("开通JIT");
|
|
}
|
|
}
|
|
|
|
foreach (var item in hideName)
|
|
{
|
|
var n = tv.Nodes[0].Nodes.Find(item, true);
|
|
if (n.Count() > 0)
|
|
n[0].Remove();
|
|
}
|
|
}
|
|
catch { }
|
|
}
|
|
|
|
private void tv_AfterSelect(object sender, TreeViewEventArgs e)
|
|
{
|
|
MainForm.sCurrentModule = e.Node.Name;
|
|
this.lblName.Text = e.Node.Text;
|
|
// 如果是一级菜单,不做任何动作
|
|
if (e.Node.Parent == null) return;
|
|
new Thread(() =>
|
|
{
|
|
Thread.Sleep(200);
|
|
Invoke(new Action(() =>
|
|
{
|
|
switch (e.Node.Name)
|
|
{
|
|
case "超级用户管理":
|
|
SetForm(adminAccountForm.Value);
|
|
break;
|
|
case "超级店铺管理":
|
|
SetForm(adminShopForm.Value);
|
|
break;
|
|
case "选品数据库":
|
|
SetForm(dbProductListForm.Value);
|
|
break;
|
|
case "选品加价管理":
|
|
SetForm(dbPriceMarkUpForm.Value);
|
|
break;
|
|
case "认领待上传":
|
|
dbProductSelectListManageForm.Value.ClientMode = EnumClientMode.Admin;
|
|
SetForm(dbProductSelectListManageForm.Value);
|
|
break;
|
|
case "库存上传":
|
|
SetForm(productThirdSelectListManageForm.Value);
|
|
break;
|
|
case "商品核价":
|
|
adminProductPriceCheckForm.Value.ClientMode = EnumClientMode.Admin;
|
|
SetForm(adminProductPriceCheckForm.Value);
|
|
break;
|
|
case "加入发货台":
|
|
joinDeliveryFrom.Value.IsAdmin = true;
|
|
SetForm(joinDeliveryFrom.Value);
|
|
break;
|
|
case "开通JIT":
|
|
jitForm.Value.IsClientJit = false;
|
|
SetForm(jitForm.Value);
|
|
break;
|
|
case "JIT卡密管理":
|
|
SetForm(adminCardCodeFrom.Value);
|
|
break;
|
|
case "JIT订单扣费":
|
|
jitPushOrder.Value.IsClientJit = false;
|
|
SetForm(jitPushOrder.Value);
|
|
break;
|
|
}
|
|
}));
|
|
}).Start();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 显示隐藏层
|
|
/// </summary>
|
|
/// <param name="f"></param>
|
|
private void SetForm(Form f)
|
|
{
|
|
if (f == null)
|
|
{
|
|
foreach (Control form in panel3.Controls)
|
|
{
|
|
form.Visible = false;
|
|
if (form is Form)
|
|
{
|
|
panel3.Controls.Remove(form as Form);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
bool had = false;
|
|
string sCurrentFormName = f.Name;
|
|
for (int i = 0; i < panel3.Controls.Count; i++)
|
|
{
|
|
if (sCurrentFormName == panel3.Controls[i].Name)
|
|
{
|
|
had = true;
|
|
panel3.Controls[i].Visible = true;
|
|
}
|
|
else
|
|
{
|
|
panel3.Controls[i].Visible = false;
|
|
}
|
|
}
|
|
if (had)
|
|
{
|
|
f = null;
|
|
return;
|
|
}
|
|
f.TopLevel = false;
|
|
f.Left = 0;
|
|
f.Top = 0;
|
|
f.FormBorderStyle = FormBorderStyle.None;
|
|
panel3.Controls.Add(f);
|
|
f.AutoSize = true;
|
|
f.Dock = DockStyle.Fill;
|
|
f.Show();
|
|
}
|
|
|
|
private void ShopForm_Load(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
var ns = tv.Nodes.Find("运费模板", true);
|
|
if (ns.Count() > 0)
|
|
{
|
|
//foreach (var n in ns)
|
|
//{
|
|
// tv.Nodes.Remove(n);
|
|
//}
|
|
|
|
if (AllBase.BaseClass.IsCloudBuyOrder)
|
|
this.tv.Nodes[0].Nodes.Insert(ns[0].Index + 1, new TreeNode() { Text = "高级运费模板", Name = "高级运费模板" });
|
|
}
|
|
tv.SelectedNode = tv.Nodes[0].Nodes[0];
|
|
tv.ExpandGroup(tv.Nodes[0].Name);
|
|
}
|
|
catch { }
|
|
}
|
|
}
|
|
}
|