private void PWDEdit_Load(object sender, EventArgs e) { AbstractFactory fac = null; if (AbstractFactory.SkinStyle.Equals("Black")) { fac = new BlackSkin(); } else if (AbstractFactory.SkinStyle.Equals("Blue")) { fac = new BlueSkin(); } else if (AbstractFactory.SkinStyle.Equals("Yellow")) { fac = new YellowSkin(); } else { fac = new DefaultSkin(); } fac.CreateForm().Op(this); fac.CreateTextBox().Op(textPWD); fac.CreateTextBox().Op(textPWDNew); fac.CreateTextBox().Op(textPWDCheck); fac.CreateButton().Op(buttonEdit); fac.labelOP(label1); fac.labelOP(label2); fac.labelOP(label3); fac.labelOP(label5); fac.labelOP(labelID); fac.PicBoxOP(pictureBoxCheck); fac.PicBoxOP(pictureBoxTag); //修改皮肤 labelID.Text = UserManager.userID; }
private void StorageMessage_Load(object sender, EventArgs e) { AbstractFactory fac = null; if (AbstractFactory.SkinStyle.Equals("Black")) { fac = new BlackSkin(); } else if (AbstractFactory.SkinStyle.Equals("Blue")) { fac = new BlueSkin(); } else if (AbstractFactory.SkinStyle.Equals("Yellow")) { fac = new YellowSkin(); } else { fac = new DefaultSkin(); } fac.CreateForm().Op(this); fac.CreateButton().Op(buttonIncome); fac.CreateButton().Op(buttonTransfer); fac.labelOP(label1); fac.labelOP(label2); fac.labelOP(label3); fac.labelOP(label4); fac.labelOP(label5); fac.labelOP(labelName); fac.labelOP(labelPosition); fac.labelOP(labelSize); //修改皮肤 listFlash(); }
private void OrderMessage_Load(object sender, EventArgs e) { AbstractFactory fac = null; if (AbstractFactory.SkinStyle.Equals("Black")) { fac = new BlackSkin(); } else if (AbstractFactory.SkinStyle.Equals("Blue")) { fac = new BlueSkin(); } else if (AbstractFactory.SkinStyle.Equals("Yellow")) { fac = new YellowSkin(); } else { fac = new DefaultSkin(); } fac.CreateForm().Op(this); fac.CreateTextBox().Op(textSelect); fac.CreateButton().Op(buttonAdd); fac.CreateButton().Op(buttonStoIn); fac.CreateButton().Op(buttonDelete); fac.CreateButton().Op(buttonClear); fac.CreateButton().Op(buttonSelect); fac.CreateComboBox().Op(comboBoxSto); fac.CreateComboBox().Op(comboBoxSelect); fac.labelOP(label1); fac.labelOP(label2); fac.labelOP(label3); //修改皮肤 if (UserManager.userType.Equals("storage")) { buttonAdd.Enabled = false; buttonDelete.Enabled = false; } DataTable dt = new DataTable(); if (useMan.Select("OrderList", out dt).Equals("NotFind")) { MessageBox.Show("未找到该表,请确认表名是否错误!", "提示"); Close(); } else if (useMan.Select("OrderList", out dt).Equals("Success")) { dt.Columns.Remove("partsInfo"); dataGridView1.DataSource = dt.DefaultView; } for (int i = 0; i < dt.Columns.Count; i++) { comboBoxSelect.Items.Add(dt.Columns[i].ToString()); } comboBoxSelect.SelectedIndex = 0; if (useMan.Select("Warehouse", out dt).Equals("Success")) { stoID = dt.AsEnumerable().Select(d => d.Field <string>("houseID")).ToList(); stoName = dt.AsEnumerable().Select(d => d.Field <string>("name")).ToList(); } comboBoxSto.DataSource = stoName; }
private void Form1_Load(object sender, EventArgs e) { new Login().ShowDialog(); if (UserManager.userID.Equals("")) { Application.ExitThread(); return; } if (AbstractFactory.SkinStyle.Equals("Black")) { fac = new BlackSkin(); } else if (AbstractFactory.SkinStyle.Equals("Blue")) { fac = new BlueSkin(); } else if (AbstractFactory.SkinStyle.Equals("Yellow")) { fac = new YellowSkin(); } else { fac = new DefaultSkin(); } fac.CreateForm().Op(this); fac.CreateButton().Op(button1); fac.labelOP(label1); fac.labelOP(label2); fac.labelOP(label3); fac.labelOP(label4); fac.labelOP(label5); fac.labelOP(label6); fac.labelOP(label7); fac.labelOP(label8); fac.labelOP(labelID); fac.labelOP(labelName); fac.PicBoxOP(pictureEmp); fac.PicBoxOP(pictureOrder); fac.PicBoxOP(picturePart); fac.PicBoxOP(pictureRoom); fac.PicBoxOP(pictureSup); fac.PicBoxOP(pictureWarehouse); //修改皮肤 toolStripStatusLabel1.BackColor = Color.Transparent; toolStripStatusLabel2.BackColor = Color.Transparent; if (useMan.SelectDate(UserManager.userID, out user).Equals("Success")) { labelID.Text = user.UserID; if (UserManager.userType.Equals("admin")) { labelName.Text = "Admin"; } else { Employees emp = new Employees(); Label labelPost = new Label(); Label labelPostName = new Label(); if (useMan.SelectDate(user.UserID, out emp).Equals("Success")) { labelName.Text = emp.Name; } pictureEmp.Visible = false; label3.Visible = false; int X1 = pictureEmp.Location.X, X2 = picturePart.Location.X, X3 = pictureSup.Location.X; int Y = (int)((pictureEmp.Location.Y + pictureOrder.Location.Y) / 2); picturePart.Location = new System.Drawing.Point(X1, Y); label4.Location = new Point(X1 + 26, Y + 80); if (UserManager.userType.Equals("storage")) { label5.Visible = false; label6.Visible = false; pictureSup.Visible = false; pictureOrder.Visible = false; pictureWarehouse.Location = new System.Drawing.Point(X2, Y); pictureRoom.Location = new System.Drawing.Point(X3, Y); label7.Location = new Point(X2 + 26, Y + 80); label8.Location = new Point(X3 + 26, Y + 80); } else if (UserManager.userType.Equals("order")) { label7.Visible = false; label8.Visible = false; pictureRoom.Visible = false; pictureWarehouse.Visible = false; pictureSup.Location = new System.Drawing.Point(X2, Y); pictureOrder.Location = new System.Drawing.Point(X3, Y); label5.Location = new Point(X2 + 20, Y + 80); label6.Location = new Point(X3 + 26, Y + 80); } labelPost.AutoSize = true; labelPost.Location = new System.Drawing.Point(400, labelName.Location.Y); labelPost.Text = "职务:"; labelPostName.AutoSize = true; labelPostName.Location = new System.Drawing.Point(450, labelName.Location.Y); labelPostName.Text = emp.Post; fac.labelOP(labelPost); fac.labelOP(labelPostName); this.Controls.Add(labelPost); this.Controls.Add(labelPostName); //生成label } timeInfo = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); picInfo = user.LoginInfo.Split('|')[1]; pictureBox1.Image = Image.FromFile(Application.StartupPath + picInfo); toolStripStatusLabel2.Text = timeInfo; } }
private void OrderMessageDetail_Load(object sender, EventArgs e) { if (AbstractFactory.SkinStyle.Equals("Black")) { fac = new BlackSkin(); } else if (AbstractFactory.SkinStyle.Equals("Blue")) { fac = new BlueSkin(); } else if (AbstractFactory.SkinStyle.Equals("Yellow")) { fac = new YellowSkin(); } else { fac = new DefaultSkin(); } fac.CreateForm().Op(this); fac.CreateButton().Op(buttonClose); fac.labelOP(label1); fac.labelOP(label3); fac.labelOP(label5); fac.labelOP(label8); fac.labelOP(labelDate); fac.labelOP(labelID); fac.labelOP(labelSupplier); fac.labelOP(labelTotal); //修改皮肤 panel1.BackColor = Color.Transparent; int height = 30; partName = new List <string>(); DataTable dt = new DataTable(); if (useMan.Select("Parts", out dt).Equals("Success")) { for (int i = 0; i < dt.Rows.Count; i++) { partName.Add(dt.Rows[i][1].ToString()); } } if (useMan.SelectDate(orderID, out order).Equals("Success")) { string[] partMessage = order.PartsInfo.Split(','); string[] partInfo; for (int i = 0; i < partMessage.Length; i++) { partInfo = partMessage[i].Split('|'); Label labelNum = new Label(); Label labelPrice = new Label(); Label labelPart = new Label(); Label labelPartNum = new Label(); Label labelPartPrice = new Label(); Label labelPartName = new Label(); labelNum.AutoSize = true; labelNum.Location = new System.Drawing.Point(280, 110 + i * height); labelNum.Text = "数量:"; labelPrice.AutoSize = true; labelPrice.Location = new System.Drawing.Point(370, 110 + i * height); labelPrice.Text = "单价:"; labelPart.AutoSize = true; labelPart.Location = new System.Drawing.Point(70, 110 + i * height); labelPart.Text = "货物:"; //标识label labelPartNum.AutoSize = true; labelPartNum.Location = new System.Drawing.Point(330, 110 + i * height); labelPartNum.Text = partInfo[1]; labelPartPrice.AutoSize = true; labelPartPrice.Location = new System.Drawing.Point(420, 110 + i * height); labelPartPrice.Text = partInfo[2]; labelPartName.AutoSize = true; labelPartName.Location = new System.Drawing.Point(120, 110 + i * height); labelPartName.Text = partName[Convert.ToInt32(partInfo[0]) - 1]; fac.labelOP(labelNum); fac.labelOP(labelPart); fac.labelOP(labelPartName); fac.labelOP(labelPartNum); fac.labelOP(labelPartPrice); fac.labelOP(labelPrice); this.ClientSize = new System.Drawing.Size(this.Size.Width, this.Size.Height); this.panel1.Location = new Point(panel1.Location.X, panel1.Location.Y + height); //具体信息 this.Controls.Add(labelNum); this.Controls.Add(labelPart); this.Controls.Add(labelPrice); this.Controls.Add(labelPartPrice); this.Controls.Add(labelPartName); this.Controls.Add(labelPartNum); } } labelID.Text = orderID; labelDate.Text = order.Date.ToString(); labelTotal.Text = order.Total; }
private void EmployeesEdit_Load(object sender, EventArgs e) { AbstractFactory fac = null; if (AbstractFactory.SkinStyle.Equals("Black")) { fac = new BlackSkin(); } else if (AbstractFactory.SkinStyle.Equals("Blue")) { fac = new BlueSkin(); } else if (AbstractFactory.SkinStyle.Equals("Yellow")) { fac = new YellowSkin(); } else { fac = new DefaultSkin(); } fac.CreateForm().Op(this); fac.CreateTextBox().Op(textName); fac.CreateTextBox().Op(textSalary); fac.CreateTextBox().Op(textTel); fac.labelOP(label1); fac.labelOP(label2); fac.labelOP(label3); fac.labelOP(label4); fac.labelOP(label5); fac.labelOP(label6); fac.labelOP(labelID); //修改皮肤 panel1.BackColor = Color.Transparent; List <string> posts; if (useMan.SelectPost(out posts).Equals("Success")) { comboBoxPost.DataSource = posts; } string flag = useMan.SelectDate(emp.EmpID, out emp); if (flag == "Success") { labelID.Text = emp.EmpID; textName.Text = emp.Name; comboBoxPost.Text = emp.Post; textSalary.Text = emp.Salary; textTel.Text = emp.Telephone; if (emp.Sex.Equals("男")) { radioButton1.Checked = true; } else { radioButton2.Checked = true; } } else if (flag.Equals("Fail")) { MessageBox.Show("数据查询失败!", "提示"); } }