Пример #1
0
        /// <summary>
        /// trans|sender†content†time†seqnum|...
        /// </summary>
        /// <param name="count"></param>
        /// <param name="msg"></param>
        public void SetTransferValues(int count, string[] msg)
        {
            panel_trans.Enabled  = true;
            dgv_transfer.Visible = true;
            label_trans.Text     = "부재중 이관 (" + count + ")";
            this.transCnt        = count;

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

                UncheckedTransferObj obj = new UncheckedTransferObj(item);

                bool isExist = false;
                foreach (DataGridViewRow itemObj in dgv_transfer.Rows)
                {
                    if ((UncheckedTransferObj)itemObj.Tag != null && ((UncheckedTransferObj)itemObj.Tag).SeqNum == obj.SeqNum)
                    {
                        isExist = true;
                        break;
                    }
                }
                if (!isExist)
                {
                    int rownum = 0;
                    if (obj.ContentObj == null)
                    {
                        rownum = dgv_transfer.Rows.Add(new object[] { obj.Time, obj.Content, Members.GetByUserId(obj.SenderId).Name + "(" + obj.SenderId + ")" });
                    }
                    else
                    {
                        string content = (obj.ContentObj.CustomerName == null || obj.ContentObj.CustomerName.Equals(""))
                                                                      ? obj.ContentObj.Ani : string.Format("{0}({1})", obj.ContentObj.CustomerName, obj.ContentObj.Ani);
                        rownum = dgv_transfer.Rows.Add(new object[] { obj.Time,
                                                                      content,
                                                                      Members.GetByUserId(obj.SenderId).Name + "(" + obj.SenderId + ")" });
                    }
                    dgv_transfer.Rows[rownum].Tag = obj;
                }
            }
        }
Пример #2
0
        /// <summary>
        /// ___________1:1창__________다자창_______
        ///
        /// on   | key(out->in)      key변경없음
        ///        노드상태변경      노드상태변경
        ///
        /// out  | key(in->out)      quit처리(**비정상종료로 quit없이 아웃됨)
        ///        노드상태변경
        ///        메시지display
        ///
        /// busy | key변경없음       key변경없음
        ///        노드상태변경      노드상태변경
        ///
        /// away |     동일
        ///
        /// dnd  |     동일
        ///
        /// </summary>
        /// <param name="id"></param>
        public void ChangeStatusOnChatterStatusReceived(object sender, CustomEventArgs e)
        {
            try {
                MemberObj memberObj = (MemberObj)e.GetItem;
                if (this.formKey.Contains(ConfigHelper.Id))
                {
                    switch (memberObj.Status)
                    {
                    case MsgrUserStatus.ONLINE:
                        //1:1채팅인 경우만
                        if (HasSingleChatter())
                        {
                            //1.키변경
                            string newFormKey = ChatUtils.GetFormKeyWithUserAdded(formKey, ConfigHelper.Id, memberObj.Id);
                            ChatForms.UpdateFormKey(newFormKey, formKey);
                            //2.노드상태변경
                            //3.메시지디스플레이
                            SetChatterLogIn(memberObj.Id, Members.GetByUserId(memberObj.Id).Name);
                        }
                        else
                        {    //다자창
                            //1.키변경없음
                            //2.노드상태변경
                            SetChatterLogIn(memberObj.Id, Members.GetByUserId(memberObj.Id).Name);
                        }
                        break;

                    case MsgrUserStatus.LOGOUT:
                        //1:1채팅인 경우만
                        if (HasSingleChatter())
                        {
                            //1.키변경
                            string newFormKey = ChatUtils.GetFormKeyWithUserLogOut(formKey, ConfigHelper.Id, memberObj.Id);
                            ChatForms.UpdateFormKey(newFormKey, formKey);
                            //2.노드상태변경
                            //3.메시지디스플레이
                            SetChatterLogOut(memberObj.Id, Members.GetByUserId(memberObj.Id).Name);
                        }
                        else
                        {    //다자창
                            //quit처리
                            //  1.키변경
                            string newFormKey = ChatUtils.GetFormKeyWithUserQuit(formKey, ConfigHelper.Id, memberObj.Id);
                            ChatForms.UpdateFormKey(newFormKey, formKey);
                            //  2. 노드삭제
                            DeleteChatter(memberObj.Id, Members.GetByUserId(memberObj.Id).Name);
                        }
                        break;

                    case MsgrUserStatus.BUSY:
                    case MsgrUserStatus.AWAY:
                    case MsgrUserStatus.DND:
                        //노드상태변경
                        SetChatterStatus(memberObj.Id, Members.GetByUserId(memberObj.Id).Name, memberObj.Status);
                        break;
                    }
                }
            } catch (Exception exception) {
                Logger.error(exception.ToString());
            }
        }
Пример #3
0
 private void ParseChatterQuitMsg(string[] _msg)
 {
     chatKey = ChatUtils.GetFormKey(_msg[1], ConfigHelper.Id);
     quitter = Members.GetByUserId(_msg[2]);
 }
Пример #4
0
 /// <summary>
 /// 30초 시간경과후 아무런 리턴메시지를 못받았을때 실패처리함.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void CheckSendFileTimeOutOnTick(object sender, EventArgs e)
 {
     sendFileTimer.Stop();
     if (MessageBox.Show(this, string.Format("{0}님에게 파일보내기가 시간초과로 실패하였습니다.(30초초과)", Members.GetByUserId(sendObj.ReceiverId).Name)
                         + Environment.NewLine
                         + string.Format("전송 파일명:{0}", sendObj.FileName), "알림", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK)
     {
         try
         {
             connection.CancelFTPSending(sendObj);
         }
         catch (Exception exception)
         {
             Logger.error(exception.ToString());
         }
         Close();
     }
 }