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.BaseForms; using AllBase; using TemuKJD.PDDForms.ProductSelectForms; namespace TemuKJD.PDDForms.ProductForms { public partial class PDDProductForm : BaseForm { public static PDDProductForm instance; //public Lazy saleStockUpForm = new Lazy(); //public Lazy priceManageForm = new Lazy(); public Lazy userSelectDbProductForm = new Lazy(); //public Lazy userSelectThirdProductForm = new Lazy(); //public Lazy marketingActivityForm = new Lazy(); //public Lazy purchasePriceForm = new Lazy(); public PDDProductForm() { InitializeComponent(); try { tv.SelectedNode = tv.Nodes[0].Nodes[0]; tv.ExpandGroup(tv.Nodes[0].Name); List hideName = new List() { "备货管理", "调价管理", "活动报名", "库存上传", "设置进货价" }; if (BaseClass.GroupId == 3) { //hideName.Remove("设置进货价"); if (BaseClass.SaLevel == 1) { } if (BaseClass.SaLevel == 2) { } } 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) { instance = this; 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(saleStockUpForm.Value); // break; //case "调价管理": // SetForm(priceManageForm.Value); // break; //case "活动报名": // SetForm(marketingActivityForm.Value); // break; //case "设置进货价": // SetForm(purchasePriceForm.Value); // break; case "商品认领": SetForm(userSelectDbProductForm.Value); break; //case "库存上传": // SetForm(userSelectThirdProductForm.Value); // break; } })); }).Start(); } public void SetTvSelect(string name) { var n = tv.Nodes[0].Nodes.Find(name, true); if (n.Count() > 0) tv.SelectedNode = n[0]; } /// /// 显示隐藏层 /// /// 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); } } 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 { tv.SelectedNode = tv.Nodes[0].Nodes[0]; tv.ExpandGroup(tv.Nodes[0].Name); //List hideName = new List() { "特殊延迟发货", /*"清理无流量"*/ }; //if (AllBase.BaseClass.UserName != "18888888888") // hideName.Add("上传错误列表"); List hideName = new List() { "佣金设置", "商品发布", "净化数据","产品数据库","商品上下架","清理无流量","库存管理","特殊延迟发货","云违规排查","上传错误列表","跳转上家" }; //if (AllBase.BaseClass.UserName != "15266666666" && AllBase.BaseClass.UserName != "15266666660") //{ // hideName.Add("商品认领"); //} foreach (var item in hideName) { var n = tv.Nodes[0].Nodes.Find(item, true); if (n.Count() > 0) n[0].Remove(); } } catch { } } } }