Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string                saleId               = textBox1_XSDID.Text;
            string                commodityName        = comboBox1_SPMC.Text;
            string                saleDate             = dateTimePicker1.Text;
            string                str                  = textBox4_XSSL.Text;
            int                   saleNumber           = int.Parse(str);
            string                payMethod            = comboBox2_ZFFS.Text;
            string                workerName           = comboBox1.Text;
            string                Gonghao              = textBox7_GH.Text;
            SaleEntity            entity               = new SaleEntity(saleId, commodityName, saleDate, saleNumber, payMethod, workerName, Gonghao);
            ISaleManageController saleManageController = new SaleManageControllerImpl();

            bool term = saleManageController.InsertSaleInfo(entity);

            if (term == true)
            {
                SalerManage form = new SalerManage();
                MessageBox.Show("添加库存信息成功");
                this.DialogResult = DialogResult.OK;
                this.Hide();
            }
            else
            {
                MessageBox.Show("添加库存信息失败!");
            }
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            login = new LoginControllerImpl();
            string jobnumber = textBox1.Text;
            string password  = textBox2.Text;
            string workunit  = comboBox1.Text;

            WorkerEntity obj   = new WorkerEntity(jobnumber, password, workunit);
            SalerManage  saler = new SalerManage(obj);

            login.JudgeNull(obj);

            bool term = login.VisitDatabase(obj);

            if (term == true)
            {
                login.JumpShow(obj);
                this.Hide();
                MessageBox.Show("登录成功");
            }
            else
            {
                MessageBox.Show("没有此用户!请重新输入!");
            }
        }