Esempio n. 1
0
 private void PopUpListOnUnCheckedTransferReceived(object sender, CustomEventArgs e)
 {
     try
     {
         string[] tempMsg = (string[])e.GetItem;
         if (noreceiveboardform == null || noreceiveboardform.IsDisposed)
         {
             noreceiveboardform = new NoReceiveBoardForm(connection);
         }
         noreceiveboardform.SetTransferValues(Convert.ToInt16(this.NRtrans.Text), tempMsg);
         noreceiveboardform.WindowState = FormWindowState.Normal;
         noreceiveboardform.Show();
     }
     catch (Exception exception)
     {
         Logger.error(exception.ToString());
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 읽지 않은 공지사항을 보여줌
 /// </summary>
 /// <param name="tempMsg"></param>
 private void PopUpListOnUnCheckedNoticeReceived(object sender, CustomEventArgs e)  //(T|sender†content†time†mode†seqnum†title|sender†content†time†mode†seqnum|...
 {
     try
     {
         string[] tempMsg = (string[])e.GetItem;
         if (noreceiveboardform == null || noreceiveboardform.IsDisposed)
         {
             noreceiveboardform = new NoReceiveBoardForm(connection);
         }
         noreceiveboardform.SetNoticeValues(Convert.ToInt16(this.NRnotice.Text), tempMsg);
         noreceiveboardform.WindowState = FormWindowState.Normal;
         noreceiveboardform.Show();
     }
     catch (Exception exception)
     {
         Logger.error(exception.ToString());
     }
 }
Esempio n. 3
0
        public void LogoutFormClose() { //로그아웃 전에 열린 폼 닫기 및 정보테이블 삭제
        
            //자원해제 대상
        //private Hashtable ChatFormList = new Hashtable();  //채팅창  key=id, value=chatform
        //private Hashtable MemoFormList = new Hashtable(); //key=time, value=SendMemoForm
        //private Hashtable TeamInfoList = new Hashtable(); //key=id, value=team
        //private Hashtable InList = new Hashtable();       //key=id, value=IPEndPoint
        //private Hashtable MemberInfoList = new Hashtable();
        //private Hashtable FileSendDetailList = new Hashtable();
        //private Hashtable FileSendFormList = new Hashtable();
        //private Hashtable FileSendThreadList = new Hashtable();
        //private Hashtable FileReceiverThreadList = new Hashtable();
        //private Hashtable NoticeDetailForm = new Hashtable();
        //private Hashtable treesource = new Hashtable();
        //private ArrayList MemoTable = new ArrayList();
        //private ArrayList omitteamlist = new ArrayList();
        
            try {
                if (noticelistform != null) {
                    noticelistform.Close();
                    noticelistform = null;
                }

                if (noticeresultform != null) {
                    noticeresultform.Close();
                    noticeresultform = null;
                }

                if (noreceiveboardform != null) {
                    noreceiveboardform.Close();
                    noreceiveboardform = null;
                }

                if (ChatFormList.Count != 0) {

                    foreach (DictionaryEntry de in ChatFormList) {
                        if (de.Value != null) {
                            try
                            {
                                ChatForm form = (ChatForm)de.Value;
                                form.Dispose();
                            }
                            catch (Exception e)
                            {
                                logWrite("form.Dispose() 에러 : " + e.ToString());
                            }
                        }
                    }
                    ChatFormList.Clear();
                    logWrite("ChatFormList Clear!");
                }

                if (MemoFormList.Count != 0)
                {
                    foreach (DictionaryEntry de in MemoFormList)
                    {
                        if (de.Value != null)
                        {
                            try
                            {
                                SendMemoForm form = (SendMemoForm)de.Value;
                                form.Dispose();
                            }
                            catch (Exception e)
                            {
                                logWrite("form.Dispose() 에러 : " + e.ToString());
                            }
                        }
                    }
                    MemoFormList.Clear();
                    logWrite("MemoFormList Clear!");
                }

                TeamInfoList.Clear();
                InList.Clear();
                MemberInfoList.Clear();
                FileSendDetailList.Clear();

                if (FileSendFormList.Count != 0)
                {
                    foreach (DictionaryEntry de in FileSendFormList)
                    {
                        if (de.Value != null)
                        {
                            try
                            {
                                SendFileForm form = (SendFileForm)de.Value;
                                form.Dispose();
                            }
                            catch (Exception e)
                            {
                                logWrite("form.Dispose() 에러 : " + e.ToString());
                            }
                        }
                    }
                    FileSendFormList.Clear();
                    logWrite("FileSendFormList Clear!");
                }

                FileSendThreadList.Clear();
                FileReceiverThreadList.Clear();
                FtpClientThreadList.Clear();

                if (NoticeDetailForm.Count != 0)
                {
                    foreach (DictionaryEntry de in NoticeDetailForm)
                    {
                        if (de.Value != null)
                        {
                            try
                            {
                                NoticeDetailResultForm form = (NoticeDetailResultForm)de.Value;
                                form.Dispose();
                            }
                            catch (Exception e)
                            {
                                logWrite("form.Dispose() 에러 : " + e.ToString());
                            }
                        }
                    }
                    NoticeDetailForm.Clear();
                    logWrite("NoticeDetailForm Clear!");
                }

                treesource.Clear();

                if (MemoTable.Count != 0)
                {
                    foreach (MemoForm memoform in MemoTable)
                    {
                        memoform.Dispose();
                    }
                    MemoTable.Clear();
                    logWrite("MemoTable Clear!");
                }

                omitteamlist.Clear();
            }
            catch (Exception e)
            {
                logWrite(e.ToString());
            }
        }
Esempio n. 4
0
        private void showNoreadTransfer(string[] tempMsg)
        {
            try
            {
                if (noreceiveboardform == null)
                {
                    noreceiveboardform = new NoReceiveBoardForm();
                    noreceiveboardform.panel_trans.Enabled = true;
                    noreceiveboardform.dgv_transfer.Visible = true;
                    noreceiveboardform.label_trans.Text = "부재중 이관 (" + this.NRtrans.Text + ")";
                    noreceiveboardform.dgv_transfer.CellMouseClick += new DataGridViewCellMouseEventHandler(dgv_transfer_CellMouseClick);
                    noreceiveboardform.FormClosing += new FormClosingEventHandler(noreceiveboardform_FormClosing);

                    for (int i = 1; i < tempMsg.Length; i++)
                    {
                        string[] array = tempMsg[i].Split('†');
                        string sender = array[0];
                        string content = array[1]; // array[1] => 22&ani&senderID&receiverID&일자&시간&CustomerName
                        string time = array[2];
                        string seqnum = array[3];
                        string name = GetUserName(sender);
                        
                        string[] temp = content.Split('&');
                        int rownum = 0;
                        if (temp.Length > 2)
                        {
                            rownum = noreceiveboardform.dgv_transfer.Rows.Add(new object[] { time, temp[1], name + "(" + sender + ")" });
                            DataGridViewRow row = noreceiveboardform.dgv_transfer.Rows[rownum];
                            row.Tag = seqnum + "|" + content;
                        }
                        else
                        {
                            rownum = noreceiveboardform.dgv_transfer.Rows.Add(new object[] { time, content, name + "(" + sender + ")" });
                            DataGridViewRow row = noreceiveboardform.dgv_transfer.Rows[rownum];
                            row.Tag = seqnum;
                        }
                        
                    }
                }
                else
                {
                    noreceiveboardform.panel_trans.Enabled = true;
                    noreceiveboardform.dgv_transfer.Visible = true;
                    noreceiveboardform.label_trans.Text = "부재중 이관 (" + this.NRtrans.Text + ")";
                    noreceiveboardform.dgv_transfer.CellMouseClick+=new DataGridViewCellMouseEventHandler(dgv_transfer_CellMouseClick);

                    for (int i = 1; i < tempMsg.Length; i++)
                    {
                        string[] array = tempMsg[i].Split('†');
                        string sender = array[0];
                        string content = array[1]; // array[1] => 22&ani&senderID&receiverID&일자&시간&CustomerName
                        string time = array[2];
                        string seqnum = array[3];

                        string name = GetUserName(sender);
                        bool isExist = false;
                        string[] temp = content.Split('&');

                        DataGridViewRowCollection collection = noreceiveboardform.dgv_transfer.Rows;


                        foreach (DataGridViewRow item in collection)
                        {
                            if (item != null)
                            {
                                if (item.Tag != null)
                                {
                                    if (item.Tag.ToString().Equals(seqnum))
                                    {
                                        isExist = true;
                                        break;
                                    }
                                }
                            }
                        }

                        if (isExist == false)
                        {
                            int rownum = 0;
                            if (temp.Length > 2)
                            {
                                rownum = noreceiveboardform.dgv_transfer.Rows.Add(new object[] { time, temp[1], name + "(" + sender + ")" });
                                DataGridViewRow row = noreceiveboardform.dgv_transfer.Rows[rownum];
                                row.Tag = seqnum + "|" + content;
                            }
                            else
                            {
                                rownum = noreceiveboardform.dgv_transfer.Rows.Add(new object[] { time, content, name + "(" + sender + ")" });
                                DataGridViewRow row = noreceiveboardform.dgv_transfer.Rows[rownum];
                                row.Tag = seqnum;
                            }
                        }
                    }
                }
                noreceiveboardform.WindowState = FormWindowState.Normal;
                noreceiveboardform.Show();
            }
            catch (Exception exception)
            {
                logWrite(exception.ToString());
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 부재중 전송파일 리스트 폼 생성
        /// </summary>
        /// <param name="tempMsg"></param>
        private void ShowFileList(string[] tempMsg) //R|sender†filenum†filename†time†size†seqnum|sender†filenum†filename†time†size†seqnum|...
        {
            //try
            //{
            //    notreceivefileform = new NotReceiveFileForm();
            //    notreceivefileform.listView1.Click += new EventHandler(File_ItemSelectionChanged);
            //    notreceivefileform.FormClosing += new FormClosingEventHandler(notreceivefileform_FormClosing);
            //    for (int i = 1; i < tempMsg.Length; i++)
            //    {
            //        string[] array = tempMsg[i].Split('†');
            //        string sender = array[0];
            //        string filename = array[2];
            //        string time = array[3];
            //        string filesize = array[4];
            //        ListViewItem item = notreceivefileform.listView1.Items.Add(time, "보기", null);
            //        string name = getName(sender);
            //        item.SubItems.Add(filename);
            //        item.SubItems.Add(name + "(" + sender + ")");
            //        item.SubItems.Add(time);
            //        item.SubItems.Add(filesize);
            //        item.Tag = array[1];
            //        item.ToolTipText = array[5];
            //    }
            //    notreceivefileform.Show();
            //    notreceivefileform.Activate();
            //    isFile = true;
            //}
            //catch (Exception exception)
            //{
            //    logWrite(exception.ToString());
            //}

            try
            {
                if (noreceiveboardform != null)
                {
                    noreceiveboardform.dgv_file.Visible = true;
                    noreceiveboardform.panel_file.Enabled = true;
                    for (int i = 1; i < tempMsg.Length; i++)
                    {
                        string[] array = tempMsg[i].Split('†');
                        string sender = array[0];
                        string filename = array[2];
                        string time = array[3];
                        string filesize = array[4];
                        
                        string name = GetUserName(sender);
                        int rownum = noreceiveboardform.dgv_file.Rows.Add(new object[] { filename, filesize, name + "(" + sender + ")", time });
                        DataGridViewRow row = noreceiveboardform.dgv_file.Rows[rownum];
                        row.Tag = array[1];
                        row.ErrorText = array[5];
                    }

                    noreceiveboardform.label_file.Text = "부재중 파일(" + NRfile.Text + ")";
                }
                else
                {
                    noreceiveboardform = new NoReceiveBoardForm();
                    noreceiveboardform.panel_file.Enabled = true;
                    noreceiveboardform.dgv_file.Visible = true;
                    noreceiveboardform.dgv_file.CellClick += new DataGridViewCellEventHandler(dgv_file_CellClick);
                    noreceiveboardform.FormClosing += new FormClosingEventHandler(noreceiveboardform_FormClosing);

                    for (int i = 1; i < tempMsg.Length; i++)
                    {
                        string[] array = tempMsg[i].Split('†');
                        string sender = array[0];
                        string filename = array[2];
                        string time = array[3];
                        string filesize = array[4];

                        string name = GetUserName(sender);
                        bool isExist = false;
                        DataGridViewRowCollection collection = noreceiveboardform.dgv_file.Rows;

                        foreach (DataGridViewRow item in collection)
                        {
                            if (item.ErrorText.Equals(array[5]))
                            {
                                isExist = true;
                                break;
                            }
                        }

                        if (isExist == false)
                        {
                            int rownum = noreceiveboardform.dgv_file.Rows.Add(new object[] { filename, filesize, name + "(" + sender + ")", time });
                            DataGridViewRow row = noreceiveboardform.dgv_file.Rows[rownum];
                            row.Tag = array[1];
                            row.ErrorText = array[5];
                        }
                    }

                    noreceiveboardform.label_file.Text = "부재중 파일(" + NRfile.Text + ")";
                }
                noreceiveboardform.WindowState = FormWindowState.Normal;
                noreceiveboardform.Show();
            }
            catch (Exception exception)
            {
                logWrite(exception.ToString());
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 읽지 않은 공지사항을 보여줌
        /// </summary>
        /// <param name="tempMsg"></param>
        private void ShowNotReadNoticeList(string[] tempMsg)  //(T|sender†content†time†mode†seqnum†title|sender†content†time†mode†seqnum|...
        {
            try
            {
                if (noreceiveboardform == null)
                {
                    noreceiveboardform = new NoReceiveBoardForm();
                    noreceiveboardform.dgv_notice.Visible = true;
                    noreceiveboardform.panel_notice.Enabled = true;
                    noreceiveboardform.label_notice.Text = "부재중 공지 (" + this.NRnotice.Text + ")";
                    noreceiveboardform.dgv_notice.CellMouseClick += new DataGridViewCellMouseEventHandler(dgv_notice_CellMouseClick);
                    noreceiveboardform.FormClosing += new FormClosingEventHandler(noreceiveboardform_FormClosing);

                    for (int i = 1; i < tempMsg.Length; i++)
                    {

                        string[] array = null;
                        if (tempMsg[i].Split('†').Length > 5)
                        {
                            array = tempMsg[i].Split('†');
                        }

                        if (array != null && array.Length > 5)
                        {
                            logWrite("notreadnotice_tag = " + array[2]);
                            string sender = "없음";
                            if (array[0] != null && array[0].Length != 0)
                            {
                                sender = array[0];
                            }

                            string content = "내용없음";

                            if (array.Length > 5)
                            {
                                content = array[1];
                            }

                            string time = "없음";
                            if (array[(array.Length - 3)] != null && array[(array.Length - 3)].Length != 0)
                            {
                                time = array[2];
                            }

                            string mode = "";
                            if (array[(array.Length - 2)] != null && array[(array.Length - 2)].Length != 0)
                            {
                                mode = array[3];
                            }

                            string seqnum = null;
                            if (array[(array.Length - 1)] != null && array[(array.Length - 1)].Length != 0)
                            {
                                seqnum = array[4];
                            }

                            string name = GetUserName(sender);

                            string title = "공지사항";
                            if (array[5].Length > 1)
                            {
                                title = array[5];
                            }

                            if (seqnum != null && seqnum.Length != 0)
                            {
                                if (mode.Equals("e"))
                                {
                                    int rownum = noreceiveboardform.dgv_notice.Rows.Add(new object[] { "긴급", title, content, name + "(" + sender + ")", time });
                                    noreceiveboardform.dgv_notice.Rows[rownum].DefaultCellStyle.ForeColor = Color.Red;
                                    noreceiveboardform.dgv_notice.Rows[rownum].Tag = seqnum;
                                }
                                else
                                {
                                    int rownum = noreceiveboardform.dgv_notice.Rows.Add(new object[] { "일반", title, content, name + "(" + sender + ")", time });
                                    noreceiveboardform.dgv_notice.Rows[rownum].Tag = seqnum;
                                }
                            }
                        }
                    }
                }
                else
                {
                    noreceiveboardform.dgv_notice.Visible = true;
                    noreceiveboardform.panel_notice.Enabled = true;
                    noreceiveboardform.label_notice.Text = "부재중 공지 (" + this.NRnotice.Text + ")";

                    for (int i = 1; i < tempMsg.Length; i++)
                    {

                        string[] array = null;
                        if (tempMsg[i].Split('†').Length > 5)
                        {
                            array = tempMsg[i].Split('†');
                        }

                        if (array != null && array.Length > 5)
                        {
                            logWrite("notreadnotice_tag = " + array[2]);
                            string sender = "없음";
                            if (array[0] != null && array[0].Length != 0)
                            {
                                sender = array[0];
                            }

                            string content = "내용없음";

                            if (array.Length > 5)
                            {
                                content = array[1];
                            }

                            string time = "없음";
                            if (array[(array.Length - 3)] != null && array[(array.Length - 3)].Length != 0)
                            {
                                time = array[2];
                            }

                            string mode = "";
                            if (array[(array.Length - 2)] != null && array[(array.Length - 2)].Length != 0)
                            {
                                mode = array[3];
                            }

                            string seqnum = null;
                            if (array[(array.Length - 1)] != null && array[(array.Length - 1)].Length != 0)
                            {
                                seqnum = array[4];
                            }

                            string name = GetUserName(sender);

                            string title = "공지사항";
                            if (array[5].Length > 1)
                            {
                                title = array[5];
                            }

                            if (seqnum != null && seqnum.Length != 0)
                            {
                                bool isExist = false;
                                DataGridViewRowCollection collection = noreceiveboardform.dgv_notice.Rows;

                                foreach (DataGridViewRow item in collection)
                                {
                                    if (item.Tag.ToString().Equals(seqnum))
                                    {
                                        isExist = true;
                                        break;
                                    }
                                }

                                if (isExist == false)
                                {
                                    if (mode.Equals("e"))
                                    {
                                        int rownum = noreceiveboardform.dgv_notice.Rows.Add(new object[] { "긴급", title, content, name + "(" + sender + ")", time });
                                        noreceiveboardform.dgv_notice.Rows[rownum].DefaultCellStyle.ForeColor = Color.Red;
                                        noreceiveboardform.dgv_notice.Rows[rownum].Tag = seqnum;
                                    }
                                    else
                                    {
                                        int rownum = noreceiveboardform.dgv_notice.Rows.Add(new object[] { "일반", title, content, name + "(" + sender + ")", time });
                                        noreceiveboardform.dgv_notice.Rows[rownum].Tag = seqnum;
                                    }
                                }
                            }
                        }

                    }
                }
                noreceiveboardform.WindowState = FormWindowState.Normal;
                noreceiveboardform.Show();
            }
            catch (Exception exception)
            {
                logWrite(exception.ToString());
            }
        }
Esempio n. 7
0
        /// <summary>
        /// MemoListForm 생성
        /// </summary>
        /// <param name="tempMsg"></param>
        private void ShowMemoList(string[] tempMsg)  //(Q|sender†content†time†seqnum|...|
        {
            try
            {
                //notreadmemoform = new NotReadMemoForm();
                //notreadmemoform.listView.Click += new EventHandler(listView_ItemSelectionChanged);
                //notreadmemoform.FormClosing += new FormClosingEventHandler(notreadmemoform_FormClosing);
                //for (int i = 1; i < tempMsg.Length; i++)
                //{
                //    string[] array = tempMsg[i].Split('†');
                //    string sender = array[0];
                //    string content = array[1];
                //    string time = array[2];
                //    string seqnum = array[3];
                //    ListViewItem item = notreadmemoform.listView.Items.Add(time, "보기", null);
                //    string name = getName(sender);
                //    item.SubItems.Add(name + "(" + sender + ")");
                //    item.SubItems.Add(time);
                //    item.SubItems.Add(content);
                //    item.Tag = seqnum;
                //}
                //notreadmemoform.Show();
                //notreadmemoform.Activate();
                //isMemo = true;

                if (noreceiveboardform == null)
                {
                    noreceiveboardform = new NoReceiveBoardForm();
                    noreceiveboardform.panel_memo.Enabled = true;
                    noreceiveboardform.dgv_memo.Visible = true;
                    noreceiveboardform.label_memo.Text = "부재중 쪽지 (" + this.NRmemo.Text + ")";
                    noreceiveboardform.dgv_memo.CellMouseClick += new DataGridViewCellMouseEventHandler(dgv_memo_CellMouseClick);
                    noreceiveboardform.FormClosing += new FormClosingEventHandler(noreceiveboardform_FormClosing);

                    for (int i = 1; i < tempMsg.Length; i++)
                    {
                        string[] array = tempMsg[i].Split('†');
                        string sender = array[0];
                        string content = array[1];
                        string time = array[2];
                        string seqnum = array[3];

                        string name = GetUserName(sender);
                        int rownum = noreceiveboardform.dgv_memo.Rows.Add(new object[] { name + "(" + sender + ")", time, content });
                        DataGridViewRow row = noreceiveboardform.dgv_memo.Rows[rownum];
                        row.Tag = seqnum;
                    }
                }
                else
                {
                    noreceiveboardform.panel_memo.Enabled = true;
                    noreceiveboardform.dgv_memo.Visible = true;
                    noreceiveboardform.label_memo.Text = "부재중 쪽지 (" + this.NRmemo.Text + ")";
                    noreceiveboardform.dgv_memo.CellMouseClick += new DataGridViewCellMouseEventHandler(dgv_memo_CellMouseClick);

                    for (int i = 1; i < tempMsg.Length; i++)
                    {
                        string[] array = tempMsg[i].Split('†');
                        string sender = array[0];
                        string content = array[1];
                        string time = array[2];
                        string seqnum = array[3];

                        string name = GetUserName(sender);
                        bool isExist = false;
                        DataGridViewRowCollection collection = noreceiveboardform.dgv_memo.Rows;

                        foreach (DataGridViewRow item in collection)
                        {
                            if (item.Tag.ToString().Equals(seqnum))
                            {
                                isExist = true;
                                break;
                            }
                        }
                        if (isExist == false)
                        {
                            int rownum = noreceiveboardform.dgv_memo.Rows.Add(new object[] { name + "(" + sender + ")", time, content });
                            DataGridViewRow row = noreceiveboardform.dgv_memo.Rows[rownum];
                            row.Tag = seqnum;
                        }
                    }
                }
                noreceiveboardform.WindowState = FormWindowState.Normal;
                noreceiveboardform.Show();
            }
            catch (Exception exception)
            {
                logWrite(exception.ToString());
            }
        }
Esempio n. 8
0
        //(T|sender��content��time��mode��seqnum��title|sender��content��time��mode��seqnum|...
        /// <summary>
        /// ���� ���� ���������� ������
        /// </summary>
        /// <param name="tempMsg"></param>
        private void ShowNotReadNoticeList(string[] tempMsg)
        {
            try
            {
                if (noreceiveboardform == null)
                {
                    noreceiveboardform = new NoReceiveBoardForm();
                    noreceiveboardform.dgv_notice.Visible = true;
                    noreceiveboardform.panel_notice.Enabled = true;
                    noreceiveboardform.label_notice.Text = "������ ���� (" + this.NRnotice.Text + ")";
                    noreceiveboardform.dgv_notice.CellMouseClick += new DataGridViewCellMouseEventHandler(dgv_notice_CellMouseClick);
                    noreceiveboardform.FormClosing += new FormClosingEventHandler(noreceiveboardform_FormClosing);

                    for (int i = 1; i < tempMsg.Length; i++)
                    {

                        string[] array = null;
                        if (tempMsg[i].Split('��').Length > 5)
                        {
                            array = tempMsg[i].Split('��');
                        }

                        if (array != null && array.Length > 5)
                        {
                            logWrite("notreadnotice_tag = " + array[2]);
                            string sender = "����";
                            if (array[0] != null && array[0].Length != 0)
                            {
                                sender = array[0];
                            }

                            string content = "�������";

                            if (array.Length > 5)
                            {
                                content = array[1];
                            }

                            string time = "����";
                            if (array[(array.Length - 3)] != null && array[(array.Length - 3)].Length != 0)
                            {
                                time = array[2];
                            }

                            string mode = "";
                            if (array[(array.Length - 2)] != null && array[(array.Length - 2)].Length != 0)
                            {
                                mode = array[3];
                            }

                            string seqnum = null;
                            if (array[(array.Length - 1)] != null && array[(array.Length - 1)].Length != 0)
                            {
                                seqnum = array[4];
                            }

                            string name = getName(sender);

                            string title = "��������";
                            if (array[5].Length > 1)
                            {
                                title = array[5];
                            }

                            if (seqnum != null && seqnum.Length != 0)
                            {
                                if (mode.Equals("e"))
                                {
                                    int rownum = noreceiveboardform.dgv_notice.Rows.Add(new object[] { "���", title, content, name + "(" + sender + ")", time });
                                    noreceiveboardform.dgv_notice.Rows[rownum].DefaultCellStyle.ForeColor = Color.Red;
                                    noreceiveboardform.dgv_notice.Rows[rownum].Tag = seqnum;
                                }
                                else
                                {
                                    int rownum = noreceiveboardform.dgv_notice.Rows.Add(new object[] { "�Ϲ�", title, content, name + "(" + sender + ")", time });
                                    noreceiveboardform.dgv_notice.Rows[rownum].Tag = seqnum;
                                }
                            }
                        }
                    }
                }
                else
                {
                    noreceiveboardform.dgv_notice.Visible = true;
                    noreceiveboardform.panel_notice.Enabled = true;
                    noreceiveboardform.label_notice.Text = "������ ���� (" + this.NRnotice.Text + ")";

                    for (int i = 1; i < tempMsg.Length; i++)
                    {

                        string[] array = null;
                        if (tempMsg[i].Split('��').Length > 5)
                        {
                            array = tempMsg[i].Split('��');
                        }

                        if (array != null && array.Length > 5)
                        {
                            logWrite("notreadnotice_tag = " + array[2]);
                            string sender = "����";
                            if (array[0] != null && array[0].Length != 0)
                            {
                                sender = array[0];
                            }

                            string content = "�������";

                            if (array.Length > 5)
                            {
                                content = array[1];
                            }

                            string time = "����";
                            if (array[(array.Length - 3)] != null && array[(array.Length - 3)].Length != 0)
                            {
                                time = array[2];
                            }

                            string mode = "";
                            if (array[(array.Length - 2)] != null && array[(array.Length - 2)].Length != 0)
                            {
                                mode = array[3];
                            }

                            string seqnum = null;
                            if (array[(array.Length - 1)] != null && array[(array.Length - 1)].Length != 0)
                            {
                                seqnum = array[4];
                            }

                            string name = getName(sender);

                            string title = "��������";
                            if (array[5].Length > 1)
                            {
                                title = array[5];
                            }

                            if (seqnum != null && seqnum.Length != 0)
                            {
                                bool isExist = false;
                                DataGridViewRowCollection collection = noreceiveboardform.dgv_notice.Rows;

                                foreach (DataGridViewRow item in collection)
                                {
                                    if (item.Tag.ToString().Equals(seqnum))
                                    {
                                        isExist = true;
                                        break;
                                    }
                                }

                                if (isExist == false)
                                {
                                    if (mode.Equals("e"))
                                    {
                                        int rownum = noreceiveboardform.dgv_notice.Rows.Add(new object[] { "���", title, content, name + "(" + sender + ")", time });
                                        noreceiveboardform.dgv_notice.Rows[rownum].DefaultCellStyle.ForeColor = Color.Red;
                                        noreceiveboardform.dgv_notice.Rows[rownum].Tag = seqnum;
                                    }
                                    else
                                    {
                                        int rownum = noreceiveboardform.dgv_notice.Rows.Add(new object[] { "�Ϲ�", title, content, name + "(" + sender + ")", time });
                                        noreceiveboardform.dgv_notice.Rows[rownum].Tag = seqnum;
                                    }
                                }
                            }
                        }

                        //notreadnoticeform = new NotReadNoticeForm();
                        //notreadnoticeform.listView.Click += new EventHandler(Notice_ItemSelectionChanged);
                        //notreadnoticeform.FormClosing += new FormClosingEventHandler(notreadnoticeform_FormClosing);
                        //for (int i = 1; i < tempMsg.Length; i++)
                        //{

                        //    string[] array = null;
                        //    if (tempMsg[i].Split('��').Length > 5)
                        //    {
                        //        array = tempMsg[i].Split('��');
                        //    }

                        //    if (array != null && array.Length > 5)
                        //    {
                        //        logWrite("notreadnotice_tag = " + array[2]);
                        //        string sender = "����";
                        //        if (array[0] != null && array[0].Length != 0)
                        //        {
                        //            sender = array[0];
                        //        }

                        //        string content = "�������";

                        //        if (array.Length > 5)
                        //        {
                        //            content = array[1];
                        //        }

                        //        string time = "����";
                        //        if (array[(array.Length - 3)] != null && array[(array.Length - 3)].Length != 0)
                        //        {
                        //            time = array[2];
                        //        }

                        //        string mode = "";
                        //        if (array[(array.Length - 2)] != null && array[(array.Length - 2)].Length != 0)
                        //        {
                        //            mode = array[3];
                        //        }

                        //        string seqnum = null;
                        //        if (array[(array.Length - 1)] != null && array[(array.Length - 1)].Length != 0)
                        //        {
                        //            seqnum = array[4];
                        //        }

                        //        ListViewItem item = null;
                        //        if (mode.Equals("n"))
                        //        {
                        //            item = notreadnoticeform.listView.Items.Add(time, "�Ϲ�", null);
                        //        }
                        //        else if (mode.Equals("e"))
                        //        {
                        //            item = notreadnoticeform.listView.Items.Add(time, "���", null);
                        //            item.ForeColor = Color.Red;
                        //        }

                        //        string name = getName(sender);
                        //        if (content.Contains("\r\n"))
                        //        {
                        //            content.Replace("\r\n", "  ");
                        //        }

                        //        string title = "��������";
                        //        if (array[5].Length > 1)
                        //        {
                        //            title = array[5];
                        //        }

                        //        if (seqnum != null && seqnum.Length != 0)
                        //        {
                        //            item.SubItems.Add(title);
                        //            item.SubItems.Add(content);
                        //            item.SubItems.Add(name + "(" + sender + ")");
                        //            item.SubItems.Add(time);

                        //            item.Tag = seqnum;
                        //            logWrite("seqnum : " + item.Tag.ToString());
                        //        }
                        //    }
                        //}
                        //notreadnoticeform.Show();
                        //notreadnoticeform.Activate();
                        //isNotice = true;
                    }
                }
                noreceiveboardform.WindowState = FormWindowState.Normal;
                noreceiveboardform.Show();
            }
            catch (Exception exception)
            {
                logWrite(exception.ToString());
            }
        }
Esempio n. 9
0
 private void PopUpListOnUnCheckedTransferReceived(object sender, CustomEventArgs e)
 {
     try
     {
         string[] tempMsg = (string[])e.GetItem;
         if (noreceiveboardform == null || noreceiveboardform.IsDisposed)
             noreceiveboardform = new NoReceiveBoardForm(connection);
         noreceiveboardform.SetTransferValues(Convert.ToInt16(this.NRtrans.Text), tempMsg);
         noreceiveboardform.WindowState = FormWindowState.Normal;
         noreceiveboardform.Show();
     }
     catch (Exception exception)
     {
         Logger.error(exception.ToString());
     }
 }
Esempio n. 10
0
 /// <summary>
 /// 읽지 않은 공지사항을 보여줌
 /// </summary>
 /// <param name="tempMsg"></param>
 private void PopUpListOnUnCheckedNoticeReceived(object sender, CustomEventArgs e)  //(T|sender†content†time†mode†seqnum†title|sender†content†time†mode†seqnum|...
 {
     try
     {
         string[] tempMsg = (string[])e.GetItem;
         if (noreceiveboardform == null || noreceiveboardform.IsDisposed)
             noreceiveboardform = new NoReceiveBoardForm(connection);
         noreceiveboardform.SetNoticeValues(Convert.ToInt16(this.NRnotice.Text), tempMsg);
         noreceiveboardform.WindowState = FormWindowState.Normal;
         noreceiveboardform.Show();
     }
     catch (Exception exception)
     {
         Logger.error(exception.ToString());
     }
 }