public static bool HasLogin_GM = false; //该次是否已有管理员登录 public GoodsManager() { InitializeComponent(); change.Hide(); GM_DM = new DataManager(); GM_AL = new AdminLogin(); GM_AOA = new AllOfAll(); UpdateDataView_GM("SELECT * FROM Goods"); }
public MaintainManager() { InitializeComponent(); change.Hide(); MM_DM = new DataManager(); MM_AL = new AdminLogin(); MM_AOA = new AllOfAll(); UpdateDataView_MM("SELECT * FROM Maintain"); }
public static bool HasLogin_IM = false; //该次是否已有管理员登录 public InstallManager() { InitializeComponent(); change.Hide(); IM_DM = new DataManager(); IM_AL = new AdminLogin(); IM_AOA = new AllOfAll(); UpdateDataView_IM("SELECT * FROM Install"); }
public static bool HasLogin_CM = false; //该次是否已有管理员登录 public CustomerManager() { InitializeComponent(); add.Hide(); change.Hide(); delete.Hide(); CM_DM = new DataManager(); CM_AL = new AdminLogin(); CM_IM = new InstallManager(); CM_MM = new MaintainManager(); CM_GM = new GoodsManager(); CM_AOA = new AllOfAll(); UpdateDataView_CM("SELECT * FROM Customer"); //进行显示界面的初始化 }
private bool IsHave = false; //判断是否查询到数据 //↓构造函数,进行相关数据初始化 public ProductManager() { InitializeComponent(); this.add.Hide(); //只显示信息界面 this.change.Hide(); PM_DM = new DataManager(); //实例化PM_DM PM_AL = new AdminLogin(); PM_AOA = new AllOfAll(); UpdateDataView("SELECT * FROM Product"); //进行显示界面的初始化 GetProductsNumber(); //得到产品总数 string sql = "SELECT function FROM Product"; //查询所有功能 List <string> Function = PM_DM.GetNoRepeatList(sql); //得到产品功能分类 //↓遍历所有功能分类,若不在默认列表内则添加至列表 foreach (string i in Function) { if (i != "制冷电器" && i != "空调器" && i != "清洁电器" && i != "厨房电器" && i != "电暖器具" && i != "整容保健电器" && i != "声像电器" && i != "报警电器") { comboBox1.Items.Add(i); comboBox6.Items.Add(i); } } }
//↓点击登录,进行用户名和密码的判断 private void button1_Click(object sender, EventArgs e) { if (WhichScript == "ChooseSever") { string sql = "SELECT * FROM ExAdmin WHERE name = " + "'" + textBox1.Text + "'"; bool flag = AD_DM.RunSql(sql); if (flag) { string sql_01 = "SELECT * FROM ExAdmin WHERE name = " + "'" + textBox1.Text + "'AND key LIKE " + "'" + textBox2.Text + "'"; bool flag_01 = AD_DM.RunSql(sql_01); if (flag_01) { MessageBox.Show("登录成功!"); MainSystem.thisAdmin = textBox1.Text; this.Visible = false; ChooseSever.GetResult(AD_CS, WhichScreen); } else { MessageBox.Show("密码错误!"); } } else { MessageBox.Show("用户名错误!"); } } else { string sql = "SELECT * FROM Admin WHERE name = " + "'" + textBox1.Text + "'"; bool flag = AD_DM.RunSql(sql); if (flag) { string sql_01 = "SELECT * FROM Admin WHERE name = " + "'" + textBox1.Text + "'AND key LIKE " + "'" + textBox2.Text + "'"; bool flag_01 = AD_DM.RunSql(sql_01); if (flag_01) { MessageBox.Show("登录成功!"); MainSystem.thisAdmin = textBox1.Text; AD_AOA = new AllOfAll(); int num = AD_AOA.GetProductsNumber(); AD_DM.GetData_Operation(num, textBox1.Text, "管理员:" + textBox1.Text + "登录", DateTime.Now.ToString()); if (WhichScript == "ProductManager") { ProductManager.GetResult(AD_PM, WhichScreen); this.Visible = false; } if (WhichScript == "CustomerManager") { CustomerManager.GetResult_CM(AD_CM, WhichScreen); this.Visible = false; } if (WhichScript == "GoodsManager") { GoodsManager.GetResult_GM(AD_GM, WhichScreen); this.Visible = false; } if (WhichScript == "InstallManager") { InstallManager.GetResult_IM(AD_IM, WhichScreen); this.Visible = false; } if (WhichScript == "MaintainManager") { MaintainManager.GetResult_MM(AD_MM, WhichScreen); this.Visible = false; } } else { MessageBox.Show("密码错误!"); } } else { MessageBox.Show("用户名错误!"); } } }