Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (dgvEquipment.CurrentRow != null)
            {
                FrmEquipmentInfo frmequipment = new FrmEquipmentInfo();
                long             eiId         = Convert.ToInt64(dgvEquipment.CurrentRow.Cells["id"].Value.ToString());
                if (eLogic.ExistLiquidMatter(eiId))
                {
                    // 为修改液态罐信息;
                    frmequipment.Text = "更新沥青罐参数";
                }
                else
                {
                    // 为新建液态罐信息;
                    frmequipment.Text = "新建沥青罐参数";
                }

                frmequipment.Id    = eiId;
                frmequipment.No    = dgvEquipment.CurrentRow.Cells["设备编号"].Value.ToString();
                frmequipment.EName = dgvEquipment.CurrentRow.Cells["设备名称"].Value.ToString() + dgvEquipment.CurrentRow.Cells["设备规格"].Value.ToString();
                frmequipment.ShowDialog();
            }
            else
            {
                MessageBox.Show("增加液态罐信息失败,请从新选择记录操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }