Example #1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (dgvInfo.SelectedRows.Count <= 0)
            {
                return;
            }

            OVRDesInfoEditForm frmDesInfoEdit = new OVRDesInfoEditForm(this.Name, m_strDesTableName, m_strDesName);

            frmDesInfoEdit.DatabaseConnection = DatabaseConnection;
            frmDesInfoEdit.m_nOperateType     = 2;
            frmDesInfoEdit.m_strLanguageCode  = m_strLanguageCode;

            int nRowIdx = dgvInfo.SelectedRows[0].Index;

            frmDesInfoEdit.m_iInfoID = Convert.ToInt32(dgvInfo.Rows[nRowIdx].Cells["ID"].Value);

            frmDesInfoEdit.m_strLongName  = dgvInfo.Rows[nRowIdx].Cells["Long Name"].Value.ToString();
            frmDesInfoEdit.m_strShortName = dgvInfo.Rows[nRowIdx].Cells["Short Name"].Value.ToString();
            frmDesInfoEdit.m_strComment   = dgvInfo.Rows[nRowIdx].Cells["Comment"].Value.ToString();

            frmDesInfoEdit.ShowDialog();

            if (frmDesInfoEdit.DialogResult == DialogResult.OK)
            {
                m_bModified  = true;
                m_iSelRowIdx = nRowIdx;
                FillInfoGrid();
            }
        }
Example #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            OVRDesInfoEditForm frmDesInfoEdit = new OVRDesInfoEditForm(this.Name, m_strDesTableName, m_strDesName);

            frmDesInfoEdit.DatabaseConnection = DatabaseConnection;
            frmDesInfoEdit.m_nOperateType     = 1;
            frmDesInfoEdit.m_strLanguageCode  = m_strLanguageCode;
            frmDesInfoEdit.ShowDialog();

            if (frmDesInfoEdit.DialogResult == DialogResult.OK)
            {
                m_bModified = true;

                m_iSelRowIdx = dgvInfo.Rows.Count;
                FillInfoGrid();
            }
        }