Пример #1
0
        private bool InsertMessage()
        {
            string quote   = GetSelectedQuote();
            string message = quote.Substring(1, quote.Length - 2);

            if (message == "")
            {
                return(false);
            }

            int count = 1;

            foreach (DataGridViewRow row in messageGrid.Rows)
            {
                object value = row.Cells[0].Value;
                if (value == null)
                {
                    continue;
                }
                else if (value.ToString().StartsWith("T"))
                {
                    count++;
                }
            }
            currentMSGID = count;

            string msgID = "T" + currentMSGID;

            SystemMessage.InsertRecord(FileName, msgID, message);
            InitMessageGrid();
            return(true);
        }
Пример #2
0
        private void messageGridOld_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            int count = messageGridOld.SelectedCells.Count;
            DataGridViewCell selectedCell = messageGridOld.SelectedCells[count - 1];
            int    row     = selectedCell.RowIndex;
            string msgID   = "T" + (messageGrid.Rows.Count),
                   oldID   = messageGridOld.Rows[row].Cells[0].Value.ToString(),
                   msgDesc = messageGridOld.Rows[row].Cells[1].Value.ToString();

            Replace(msgID, msgDesc, oldID);
            SystemMessage.InsertRecord(FileName, msgID, msgDesc);
            InitMessageGrid();
        }