Esempio n. 1
0
        private void cbxWorkerIDS_SelectedIndexChanged(object sender, EventArgs e)
        {
            string         workerID = this.cbxWorkerIDS.Text;
            workerResModel m        = workerBll.GetModel(workerID);

            if (m != null)
            {
                this.label1.Text = "员工号:" + m.workerID;
                this.label2.Text = "姓名:" + m.name;
                this.label7.Text = "性别:" + m.sex;
                this.label6.Text = "班组:" + m.shiftNo;
            }
        }
Esempio n. 2
0
        private void OnAddWorker()
        {
            try
            {
                if (string.IsNullOrWhiteSpace(this.textBoxID.Text))
                {
                    MessageBox.Show("员工号为空,请重新输入");
                    return;
                }
                if (string.IsNullOrWhiteSpace(this.textBoxName.Text))
                {
                    MessageBox.Show("员工姓名为空,请重新输入");
                    return;
                }
                workerResModel worker = new workerResModel();
                worker.workerID = this.textBoxID.Text;
                worker.name     = this.textBoxName.Text;
                worker.sex      = this.comboBoxSex.Text;
                if (!string.IsNullOrWhiteSpace(this.textBoxAge.Text))
                {
                    worker.age = int.Parse(this.textBoxAge.Text);
                }

                worker.shiftNo = this.comboBoxShiftNo.Text;
                if (workerBll.Add(worker))
                {
                    OnRefreshWorkers();
                    RefreshWorkerCfgList();
                }
                else
                {
                    MessageBox.Show("增加员工信息失败");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }