Esempio n. 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            OVRDesInfoEditForm frmDesInfoEdit = new OVRDesInfoEditForm(this.Name);

            frmDesInfoEdit.MatchConfigID = MatchConfigID;
            frmDesInfoEdit.DBConnect     = DBConnect;
            frmDesInfoEdit.OperateType   = 1;
            frmDesInfoEdit.m_emInfoType  = m_emInfoType;
            frmDesInfoEdit.LanguageCode  = m_strLanguageCode;
            frmDesInfoEdit.ShowDialog();

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

                m_iSelRowIdx = dgvInfo.Rows.Count;
                switch (Convert.ToInt32(m_emInfoType))
                {
                case 6:
                    FillInfoGridOfMF();
                    return;

                default:
                    break;
                }
            }
        }
Esempio n. 2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (dgvInfo.SelectedRows.Count <= 0)
            {
                return;
            }

            OVRDesInfoEditForm frmDesInfoEdit = new OVRDesInfoEditForm(this.Name);

            frmDesInfoEdit.DBConnect    = DBConnect;
            frmDesInfoEdit.OperateType  = 2;
            frmDesInfoEdit.m_emInfoType = m_emInfoType;
            frmDesInfoEdit.LanguageCode = m_strLanguageCode;

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

            if (m_emInfoType == EMInfoType.emMF)
            {
                frmDesInfoEdit.InfoID = Convert.ToInt32(dgvInfo.Rows[nRowIdx].Cells["ID"].Value);

                frmDesInfoEdit.LongName  = dgvInfo.Rows[nRowIdx].Cells["Long Name"].Value.ToString();
                frmDesInfoEdit.ShortName = dgvInfo.Rows[nRowIdx].Cells["Short Name"].Value.ToString();
                frmDesInfoEdit.Comment   = dgvInfo.Rows[nRowIdx].Cells["Comment"].Value.ToString();
            }
            frmDesInfoEdit.ShowDialog();

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

                m_iSelRowIdx = nRowIdx;
                switch (Convert.ToInt32(m_emInfoType))
                {
                case 6:
                    FillInfoGridOfMF();
                    return;
                }
            }
        }