コード例 #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            AddMedInfo();
            FrmAddMedStock frmAddMed = new FrmAddMedStock(@"添加", null, null);

            frmAddMed.ShowDialog();
        }
コード例 #2
0
        private void 修改库存信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dgvMedicine.CurrentRow == null)
            {
                MessageBox.Show(@"请选择需要修改的行!");
                return;
            }
            AddMedicine addMedicine = new AddMedicine();

            addMedicine.MedID        = dgvMedicine.CurrentRow.Cells["MedID"].Value.ToString();
            addMedicine.MedName      = dgvMedicine.CurrentRow.Cells["MedName"].Value.ToString();
            addMedicine.MedBarCode   = dgvMedicine.CurrentRow.Cells["MedBarCode"].Value.ToString();
            addMedicine.Production   = dgvMedicine.CurrentRow.Cells["Production"].Value.ToString();
            addMedicine.ProduteDate  = dgvMedicine.CurrentRow.Cells["ProduteDate"].Value.SafeDbDateTime();
            addMedicine.ReleaseDay   = dgvMedicine.CurrentRow.Cells["ReleaseDay"].Value.SafeDbInt32();
            addMedicine.Quantity     = dgvMedicine.CurrentRow.Cells["Quantity"].Value.SafeDbInt32();
            addMedicine.MedBid       = dgvMedicine.CurrentRow.Cells["MedBid"].Value.SafeDbDecimal();
            addMedicine.MedUnitPrice = dgvMedicine.CurrentRow.Cells["MedUnitPrice"].Value.SafeDbDecimal();
            addMedicine.Memary       = dgvMedicine.CurrentRow.Cells["Memary"].Value.ToString();
            addMedicine.DueDate      = dgvMedicine.CurrentRow.Cells["DueDate"].Value.SafeDbDateTime();

            Medicine medicine = new Medicine();

            medicine.MedUnit     = dgvMedicine.CurrentRow.Cells["MedUnit"].Value.ToString();
            medicine.MedStandard = dgvMedicine.CurrentRow.Cells["MedStandard"].Value.ToString();
            medicine.MedTypeId   = dgvMedicine.CurrentRow.Cells["StyleName"].Value.ToString();
            medicine.MedApproval = dgvMedicine.CurrentRow.Cells["MedApproval"].Value.ToString();
            FrmAddMedStock frmAddMed = new FrmAddMedStock(@"修改", addMedicine, medicine);

            frmAddMed.ShowDialog();
            btnSearch_Click(null, null);
        }