void About_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
 {
     DXMessageBox.Show(@"This example demonstrates how to customize the WPF Scheduler's integrated ribbon UI. Use the Scheduler's RibbonActions collection to create, remove or modify ribbon elements.",
                       "Scheduler Ribbon Example", MessageBoxButton.OK, MessageBoxImage.Information);
 }
        public ChatOptionsDialog()
        {
            TitleLabel.Text = "聊天设置";
            HasFooter       = true;

            SetClientSize(new Size(350, 200));

            ListBox = new DXListBox
            {
                Location = ClientArea.Location,
                Size     = new Size(120, ClientArea.Height - SmallButtonHeight - 5),
                Parent   = this,
            };


            DXButton button = new DXButton
            {
                ButtonType = ButtonType.SmallButton,
                Label      = { Text = "添加" },
                Parent     = this,
                Size       = new Size(50, SmallButtonHeight),
            };

            button.Location = new Point((ListBox.DisplayArea.Right - button.Size.Width), ListBox.DisplayArea.Bottom + 5);

            button.MouseClick += (o, e) => AddNewTab();

            button = new DXButton
            {
                ButtonType = ButtonType.Default,
                Label      = { Text = "重置所有" },
                Parent     = this,
                Size       = new Size(80, DefaultHeight),
                Location   = new Point(ClientArea.Right - 80 - 10, Size.Height - 43),
            };
            button.MouseClick += (o, e) =>
            {
                DXMessageBox box = new DXMessageBox("确定重置所有聊天窗口吗", "确认重置", DXMessageBoxButtons.YesNo);

                box.YesButton.MouseClick += (o1, e1) =>
                {
                    for (int i = ChatTab.Tabs.Count - 1; i >= 0; i--)
                    {
                        ChatTab.Tabs[i].Panel.RemoveButton.InvokeMouseClick();
                    }

                    CreateDefaultWindows();
                };
            };


            button = new DXButton
            {
                ButtonType = ButtonType.Default,
                Label      = { Text = "保存所有" },
                Parent     = this,
                Size       = new Size(80, DefaultHeight),
                Location   = new Point(ClientArea.X, Size.Height - 43),
            };
            button.MouseClick += (o, e) =>
            {
                // DXMessageBox box = new DXMessageBox("Are you sure you want to reset ALL chat windows", "Chat Reset", DXMessageBoxButtons.YesNo);

                GameScene.Game.SaveChatTabs();
                GameScene.Game.ReceiveChat("保存布局", MessageType.Announcement);
            };

            button = new DXButton
            {
                ButtonType = ButtonType.Default,
                Label      = { Text = "重新加载所有" },
                Parent     = this,
                Size       = new Size(80, DefaultHeight),
                Location   = new Point(ClientArea.X + 85, Size.Height - 43),
            };
            button.MouseClick += (o, e) =>
            {
                DXMessageBox box = new DXMessageBox("你确认重新加载所有窗口吗", "确认重新加载", DXMessageBoxButtons.YesNo);

                box.YesButton.MouseClick += (o1, e1) =>
                {
                    GameScene.Game.LoadChatTabs();
                };
            };
        }
 public void ShowError(string text)
 {
     DXMessageBox.Show(text, "Lỗi", MessageBoxButton.OK, MessageBoxImage.Error);
 }
 public MessageBoxResult Show(string text, string caption, MessageBoxButton buttons, MessageBoxImage image)
 {
     return(DXMessageBox.Show(text, caption, buttons, image));
 }
 public void ShowInfo(string text, string caption = "Lưu ý")
 {
     DXMessageBox.Show(text, caption, MessageBoxButton.OK, MessageBoxImage.Information);
 }
 public MessageBoxResult AskYesNo(string text, string caption = "Chú ý")
 {
     return(DXMessageBox.Show(text, caption, MessageBoxButton.YesNo, MessageBoxImage.Question));
 }
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (!dxvalidation.Validate() || string.IsNullOrWhiteSpace(txtUid.Text))
            {
                DXMessageBox.ShowInfo("用户名和密码不能为空!", this);
            }
            else
            {
                this.loginPress.Show();
                btnLogin.Enabled = btnCancel.Enabled = chkRember.Enabled = btnSet.Enabled = false;
                this.CrossThreadCallsSync(x =>
                {
                    this.loginPress.Hide();
                    btnLogin.Enabled = btnCancel.Enabled = chkRember.Enabled = btnSet.Enabled = true;
                    DocInfo docInfo  = x as DocInfo;
                    if (docInfo == null)
                    {
                        DXMessageBox.ShowError("获取登录信息失败!\r\n请检查网络连接", this);
                    }
                    else
                    {
                        switch (docInfo.err_Code)
                        {
                        case -2:
                            DXMessageBox.ShowError("无法连接到服务器,请检查网络连接或重试!", this);
                            break;

                        case -1:
                            DXMessageBox.ShowError("参数错误!请重试", this);
                            break;

                        case 1:
                            DXMessageBox.ShowWarning("用户名不存在!", this);
                            txtUid.Focus();
                            break;

                        case 2:
                            DXMessageBox.ShowWarning("密码错误!", this);
                            txtPwd.Focus();
                            break;

                        case 3:
                            DXMessageBox.ShowWarning("该用户已经在其它地方登录!", this);
                            break;

                        case 4:
                            DXMessageBox.ShowError("客户端版本低,请升级客户端!", this);
                            break;

                        case 0:         //登陆成功
                            #region 本地记住用户名和密码
                            if (chkRember.Checked)
                            {
                                string uidmd5 = DESEncrypt.Encrypt(txtUid.Text);
                                string pwdmd5 = DESEncrypt.Encrypt(txtPwd.Text);
                                ConfigHelper.UpdateConfig("u", uidmd5, true);
                                ConfigHelper.UpdateConfig("p", pwdmd5, true);
                            }
                            #endregion

                            #region 返回值解析
                            TmoComm.login_docInfo = docInfo;
                            if (frmMain != null)
                            {
                                frmMain.Initfunction();
                            }
                            #endregion

                            #region 设置主窗体显示
                            this.Hide();
                            string skin_name = ConfigHelper.GetConfigString("skin_name", TSCommon.Default_skin_name, true);
                            TSCommon.SetSkin(skin_name);
                            frmMain.Show();
                            #endregion

                            TCPClient.Instance.SendHeartBeat();         //登录成功后 主动发送心跳包
                            break;

                        default:
                            LogHelper.Log.Error("未知错误->错误码:" + docInfo.err_Code);
                            DXMessageBox.ShowError("未知错误!错误码:" + docInfo.err_Code, this);
                            break;
                        }
                    }
                }, () =>
                {
                    return(Tmo_CommonClient.Instance.GetDocInfo(txtUid.Text, txtPwd.Text));
                });
            }
        }
        /// <summary>
        /// 加载数据
        /// </summary>
        public void GetData()
        {
            this.ShowWaitingPanel(() =>
            {
                try
                {
                    _dsQueryXml = TmoShare.getDataSetFromXML(SubmitXml, true);
                    if (_dsQueryXml.Tables[0].Rows.Count == 0)
                    {
                        _dsQueryXml.Tables[0].Rows.Add(_dsQueryXml.Tables[0].NewRow());
                    }
                    _dsQueryXml.Tables[0].Rows[0]["doc_code"]  = TmoComm.login_docInfo.children_docid;
                    _dsQueryXml.Tables[0].Rows[0]["page_size"] = _pageSize.ToString();
                    _dsQueryXml.Tables[0].Rows[0]["now_page"]  = _currentPage.ToString();
                    if (!string.IsNullOrEmpty(this.user_codetxt.Text))
                    {
                        _dsQueryXml.Tables[0].Rows[0]["user_id"] = this.user_codetxt.Text;
                    }
                    if (!string.IsNullOrEmpty(this.user_nametxt.Text))
                    {
                        _dsQueryXml.Tables[0].Rows[0]["name"] = this.user_nametxt.Text;
                    }
                    string adviseState = advise_state.EditValue.ToString();
                    if (adviseState == "已回复")
                    {
                        _dsQueryXml.Tables[0].Rows[0]["gender"] = "1";
                    }
                    if (adviseState == "未回复")
                    {
                        _dsQueryXml.Tables[0].Rows[0]["gender"] = "2";
                    }

                    if (checkask.Checked)
                    {
                        _dsQueryXml.Tables[0].Rows[0]["ask_datestart"] = ask_datestart.EditValue.ToString();
                        _dsQueryXml.Tables[0].Rows[0]["ask_dateend"]   = ask_dateend.EditValue.ToString();
                    }
                    if (checkanswer.Checked)
                    {
                        _dsQueryXml.Tables[0].Rows[0]["answer_timestart"] = answer_timestart.EditValue.ToString();
                        _dsQueryXml.Tables[0].Rows[0]["answer_timeend"]   = answer_timeend.EditValue.ToString();
                    }
                    string selexml = TmoShare.getXMLFromDataSet(_dsQueryXml);

                    string strmlx    = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetOpinionData, new object[] { selexml });
                    _dsGetDataResult = TmoShare.getDataSetFromXML(strmlx);
                    if (TmoShare.DataSetIsNotEmpty(_dsGetDataResult))
                    {
                        DataTable dtCount = _dsGetDataResult.Tables["Count"];
                        count             = dtCount.Rows[0]["totalRowCount"].ToString();
                        double countnum   = int.Parse(count) / _pageSize;
                        pageCount         = Math.Ceiling(countnum).ToString();
                        return(_dsGetDataResult.Tables[1]);
                    }
                    else
                    {
                        return(null);
                    }
                }
                catch
                { }
                return(null);
            }, x =>
            {
                try
                {
                    DataTable dt = x as DataTable;
                    if (dt != null)
                    {
                        foreach (DataRow row in dt.Rows)
                        {
                            row["answer"] = "健康师回复";
                        }
                    }
                    dgcTree.DataSource = dt;
                    if (gridView1.GroupCount > 0)
                    {
                        gridView1.ExpandAllGroups();
                    }
                    gridView1.MoveFirst();
                    if (dt == null)
                    {
                        return;
                    }

                    lblCount.Text     = string.Format("共[{0}]条", count);
                    lblPageIndex.Text = string.Format("第[{0}]页,共[{1}]页", _currentPage.ToString(), _pageSize.ToString());
                    txtPageIndex.Text = _currentPage.ToString();
                    txtPageSize.Text  = _pageSize.ToString();

                    llblUp.Enabled   = _currentPage > 1;
                    llblDown.Enabled = _currentPage < int.Parse(pageCount);
                }
                catch (Exception ex)
                {
                    LogHelper.Log.Error("实体加载数据出错", ex);
                    DXMessageBox.ShowWarning2("数据加载失败!请重试!");
                }
            });
        }
Exemple #9
0
 void About_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
 {
     DXMessageBox.Show("Click!", "Integrated Ribbon Customization", MessageBoxButton.OK, MessageBoxImage.Information);
 }