Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="count"></param>
        /// <param name="msg">Q|sender†content†time†seqnum|...|</param>
        public void SetMemoValues(int count, string[] msg)
        {
            panel_memo.Enabled = true;
            dgv_memo.Visible   = true;
            label_memo.Text    = "부재중 쪽지 (" + count + ")";
            this.memoCnt       = count;

            foreach (string item in msg)
            {
                if (item.Equals("Q"))
                {
                    continue;
                }

                NumberedMemoObj obj = new NumberedMemoObj(item);

                bool isExist = false;
                foreach (DataGridViewRow itemObj in dgv_memo.Rows)
                {
                    if (((NumberedMemoObj)itemObj.Tag != null) && ((NumberedMemoObj)itemObj.Tag).SeqNum == obj.SeqNum)
                    {
                        isExist = true;
                        break;
                    }
                }
                if (!isExist)
                {
                    int rownum = dgv_memo.Rows.Add(new object[] { Members.GetByUserId(obj.SenderId).Name + "(" + obj.SenderId + ")", obj.Time, obj.Content });
                    dgv_memo.Rows[rownum].Tag = obj;
                }
            }
        }
Ejemplo n.º 2
0
        private void delNRmemo(int rowIndex)
        {
            try
            {
                NumberedMemoObj obj = (NumberedMemoObj)dgv_memo.Rows[rowIndex].Tag;
                //쪽지 보여줌
                MemoForm memoForm = new MemoForm(connection, obj.ToMemoObj());
                memoForm.Show();
                memoForm.Activate();

                //확인한 쪽지를 미확인목록에서 삭제
                MemoUtils.MemoFileWrite(ConfigHelper.Id, obj.ToMemoObj());
                dgv_memo.Rows.RemoveAt(rowIndex);
                connection.SendMsgDeleteUnReadOnChecked(obj.SeqNum);

                memoCnt = memoCnt - 1;
                if (memoCnt >= 0)
                {
                    if (memoCnt == 0)
                    {
                        panel_memo.Enabled = false;
                    }
                    label_memo.Text = "부재중 메모(" + memoCnt + ")";
                    connection.UpdateUnCheckedData(memoCnt, -1, -1, -1);
                }
            }
            catch (Exception ex)
            {
                Logger.error(ex.ToString());
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="count"></param>
        /// <param name="msg">Q|sender†content†time†seqnum|...|</param>
        public void SetMemoValues(int count, string[] msg)
        {
            panel_memo.Enabled = true;
            dgv_memo.Visible = true;
            label_memo.Text = "부재중 쪽지 (" + count + ")";
            this.memoCnt = count;

            foreach (string item in msg)
            {
                if (item.Equals("Q")) continue;

                NumberedMemoObj obj = new NumberedMemoObj(item);

                bool isExist = false;
                foreach (DataGridViewRow itemObj in dgv_memo.Rows)
                {
                    if (((NumberedMemoObj)itemObj.Tag != null) && ((NumberedMemoObj)itemObj.Tag).SeqNum == obj.SeqNum)
                    {
                        isExist = true;
                        break;
                    }
                }
                if (!isExist)
                {
                    int rownum = dgv_memo.Rows.Add(new object[] { Members.GetByUserId(obj.SenderId).Name + "(" + obj.SenderId + ")", obj.Time, obj.Content });
                    dgv_memo.Rows[rownum].Tag = obj;
                }
            }
        }