예제 #1
0
        protected override void OnDelClick(DataRow selectedRow)
        {
            int inte_status = selectedRow.GetDataRowIntValue("inte_status");

            if (inte_status != 1)
            {
                DXMessageBox.ShowInfo("只能删除未执行的干预!");
                GetData();
                return;
            }

            string pkVal = selectedRow[PrimaryKey].ToString();

            DXMessageBox.btnOKClick += (object sender, EventArgs e) =>
            {
                bool suc = Tmo_FakeEntityClient.Instance.DeleteData(TableName, PrimaryKey, pkVal);
                if (suc)
                {
                    GetData();
                    DXMessageBox.Show(string.Format("干预删除成功!", name), true);
                }
                else
                {
                    DXMessageBox.ShowWarning("删除失败!");
                }
            };
            DXMessageBox.ShowQuestion("确定要删除该干预吗?");
        }
        void btnOK_Click(object sender, EventArgs e)
        {
            var list = GetSelectedCategories();

            if (list.Any())
            {
                var tmp   = list.Except(_list);
                var names = tmp.Select(x => x.qc_name).ToList();

                if (names.Any())
                {
                    string name = StringPlus.GetArrayStr(names, "、");
                    DXMessageBox.btnOKClick += (x, y) =>
                    {
                        CloseForm(true);
                    };
                    DXMessageBox.ShowQuestion(string.Format("确认要放弃 {0} 吗?", name), this);
                }
                else
                {
                    CloseForm(true);
                }
            }
            else
            {
                DXMessageBox.ShowError("至少要选择一种风险评估", this);
            }
        }
예제 #3
0
        private void LinkDel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            ImageComboBoxItem selItem = lbType.SelectedItem as ImageComboBoxItem;

            if (selItem != null)
            {
                var    drs    = _intelibType.Select("type_id=" + selItem.Value);
                string doc_id = drs[0]["doc_id"].ToString();
                if (doc_id == TmoComm.login_docInfo.doc_id.ToString())
                {
                    DXMessageBox.btnOKClick += (_sender, _e) =>
                    {
                        bool del = Tmo_FakeEntityClient.Instance.DeleteData("tmo_intervenelibtype", "type_id", selItem.Value.ToString());
                        if (del)
                        {
                            DXMessageBox.Show("干预库类型删除成功!", true);
                            _intelibType = Tmo_FakeEntityClient.Instance.GetData("tmo_intervenelibtype");
                            TSCommon.BindImageComboBox(lbType, _intelibType, null, "type_name", "type_id");
                        }
                    };
                    DXMessageBox.ShowQuestion(string.Format("确定要删除干预库类型【{0}】吗?", selItem.Description));
                }
                else
                {
                    DXMessageBox.ShowWarning("没有权限(非创建者)!\n创建者ID[" + doc_id + "]");
                }
            }
        }
예제 #4
0
        void btnSave_Click(object sender, EventArgs e)
        {
            if (_user == null)
            {
                return;
            }
            if (dateEditStart.EditValue == null || dateEditEnd.EditValue == null)
            {
                DXMessageBox.ShowWarning2("管理时间未填写完整!");
                xtraTabControlMain.SelectedTabPageIndex = 0;
            }

            if (DXMessageBox.ShowQuestion("确定要保存吗?\r\n保存后将无法修改", this) == DialogResult.OK)
            {
                string jsonData = GetDataJsonString();

                UCActionPlan uap = new UCActionPlan(_user, jsonData, true);
                uap.ShowDialog(this);
                if (uap.SaveSucess)
                {
                    CloseForm();
                }
                uap.Dispose();
            }
        }
예제 #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            object obj = TmoServiceClient.InvokeServerMethodT <bool>(txtServerIP.Text, Convert.ToInt32(txtServerPort.Text), funCode.CheckLink);

            if (obj is bool && ((bool)obj))
            {
                ConfigHelper.UpdateConfig("ServerIP", txtServerIP.Text, true);
                ConfigHelper.UpdateConfig("ServerPort", txtServerPort.Text, true);
                TmoServiceClient.RefreshIpPort();
                TCPClient.Instance.ClostSocket();
                TCPClient._ip   = TmoServiceClient.Ip;
                TCPClient._port = TmoServiceClient.Port + 1;
                btnCloseSet_Click(null, null);
            }
            else
            {
                DXMessageBox.btnOKClick += (object sender0, EventArgs e0) =>
                {
                    ConfigHelper.UpdateConfig("ServerIP", txtServerIP.Text, true);
                    ConfigHelper.UpdateConfig("ServerPort", txtServerPort.Text, true);
                    TmoServiceClient.RefreshIpPort();
                    TCPClient.Instance.ClostSocket();
                    TCPClient._ip   = TmoServiceClient.Ip;
                    TCPClient._port = TmoServiceClient.Port + 1;
                    btnCloseSet_Click(null, null);
                };
                DXMessageBox.ShowQuestion("测试连接失败!\r\n是否继续保存该配置?", this);
            }
        }
예제 #6
0
        void delLinkEdit_Click(object sender, EventArgs e)
        {
            DataRowView drNow = prodiclist.GetDataRecordByNode(prodiclist.FocusedNode) as DataRowView;

            project_idva             = drNow["project_id"].ToString();
            DXMessageBox.btnOKClick += DXMessageBox_btnOKClick;
            DXMessageBox.ShowQuestion("您确定要删除吗?");
        }
예제 #7
0
 void repositoryItemHyperLinkEdit1_Click(object sender, EventArgs e)
 {
     //dgcTree.
     //Delrow = dr;
     Delrow = gridView2.GetDataRow(gridView2.GetSelectedRows()[0]);
     DXMessageBox.btnOKClick += DXMessageBox_btnOKClick;
     DXMessageBox.ShowQuestion("确定要删除吗");
 }
예제 #8
0
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            if (e.CloseReason == CloseReason.UserClosing && !exitApp)
            {
                e.Cancel = true;
                DXMessageBox.btnOKClick += DXMessageBox_btnOKClick;
                DXMessageBox.ShowQuestion("确定要退出程序吗?", this);
            }

            base.OnFormClosing(e);
        }
예제 #9
0
        void ucActionPlanLibInfo1_UseLibData(int id, string title, string content)
        {
            DialogResult dg = DXMessageBox.ShowQuestion(string.Format("确定要用模板库【{0}】内容替换当前内容?", title), this);

            if (dg == DialogResult.OK)
            {
                _aclb_id  = id;
                _jsonData = content;
                SetDataFromJsonString();
            }
        }
예제 #10
0
        void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow dr = gridView1.GetDataRow(e.RowHandle);

            drDel = dr;
            //EventArgs
            //DXMessageBox.btnCancelClick = (object sender,EventArgs e) => { };
            if (e.Column.Name == "del")
            {
                if (dr["del"].ToString() == "---")
                {
                    return;
                }
                DXMessageBox.btnOKClick += DXMessageBox_btnOKClick;
                DXMessageBox.ShowQuestion("确定要删除吗?");
            }
            else if (e.Column.Name == "look_report")
            {
                FrmNewRepor frmReport = new FrmNewRepor();
                frmReport.inidata();

                frmReport.initPersonData(dr);

                frmReport.ShowDialog();
                frmReport.Dispose();
            }
            else if (e.Column.Name == "user_times")
            {
                GetItemData(dr);
            }
            else if (e.Column.Name == "lookImg")
            {
                //if(filename)
                FrmUp frmUpImg = new FrmUp(dr);
                frmUpImg.Enabled = true;
                frmUpImg.ShowDialog();
                frmUpImg.Dispose();
            }
            else if (e.Column.Name == "lookold")
            {
                FrmUpImg frmUpImg = new FrmUpImg(dr, true);
                frmUpImg.Enabled = true;
                frmUpImg.ShowDialog();
                frmUpImg.Dispose();

                //if(filename)
            }
        }
예제 #11
0
        void sbselect_Click(object sender, EventArgs e)
        {
            if (isupdate)
            {
                DialogResult dgResult = DXMessageBox.ShowQuestion("之前已上传检验报告单,确定要修改吗?");
                if (dgResult != DialogResult.OK)
                {
                    return;
                }
            }

            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter      = "Word文件|*.doc;*.docx";
            ofd.Multiselect = false;
            if (ofd.ShowDialog(this) == DialogResult.OK)
            {
                string filename = ofd.FileName;
                ofd.Dispose();

                FileInfo fi = new FileInfo(filename);
                ExName = fi.Extension.ToLower();
                if (ExName != ".docx" && ExName != ".doc")
                {
                    ExName = "";
                    DXMessageBox.ShowWarning("请选择word上传!");
                    return;
                }

                string watingstr = "文档读取中";

                this.ShowWaitingPanel(() =>
                {
                    by = File.ReadAllBytes(filename);
                    Thread.Sleep(1000);
                    return(null);
                },
                                      o =>
                {
                    ricEc.CancelUpdate();
                    ricEc.LoadDocument(filename);
                    ricEc.Visible = true;
                }
                                      , watingstr);
            }
        }
예제 #12
0
        protected override bool OnFormClosing()
        {
            if (ReadOnly)
            {
                return(true);
            }
            DialogResult dr = DXMessageBox.ShowQuestion("是否放弃问卷采集?\n所有数据将不会保存", this);

            if (dr == DialogResult.OK)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #13
0
        /// <summary>
        /// 删除按钮点击
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void linkDel_Click(object sender, EventArgs e)
        {
            DataRowView drv = treeList1.GetDataRecordByNode(treeList1.FocusedNode) as DataRowView;

            if (drv != null)
            {
                object dpt_id   = drv["dpt_id"];
                object dpt_name = drv["dpt_name"];
                if (dpt_id != null && !string.IsNullOrWhiteSpace(dpt_id.ToString()))
                {
                    if (dpt_id.ToString() == TmoComm.login_docInfo.doc_department.ToString())
                    {
                        DXMessageBox.ShowInfo("没有权限!");
                        return;
                    }
                    string    dptds = Tmo_CommonClient.Instance.GetChildrenNodeFromTable(TableName, PrimaryKey, "dpt_parent", dpt_id.ToString());
                    DataTable dt    = Tmo_FakeEntityClient.Instance.GetData("tmo_docinfo", new string[] { "count(*) c" }, "doc_department in (" + dptds + ")");
                    if (TmoShare.DataTableIsEmpty(dt))
                    {
                        DXMessageBox.ShowError("删除失败,请重试!"); return;
                    }
                    if (dt.Rows[0].GetDataRowIntValue("c") > 0)
                    {
                        DXMessageBox.ShowWarning2("该部门下分配有健康师,删除被阻止!");
                        return;
                    }
                    DXMessageBox.btnOKClick += (object sender1, EventArgs e1) =>
                    {
                        //删除部门操作
                        bool suc = Tmo_FakeEntityClient.Instance.DeleteData(TableName, PrimaryKey, dpt_id.ToString());
                        if (!suc)
                        {
                            DXMessageBox.ShowError("删除失败,请重试!");
                            return;
                        }
                        //Dictionary<string, object> dic = new Dictionary<string, object>();
                        //dic.Add("doc_department", -1);
                        //suc = Tmo_FakeEntityClient.Instance.SubmitData(DBOperateType.Update, "tmo_docinfo", "doc_department", dpt_id.ToString(), dic);
                        Tmo_CommonClient.Instance.RefreshDocChildrenDpt();
                        GetData();
                        DXMessageBox.Show("部门 [" + dpt_name + "] 删除成功!", true);
                    };
                    DXMessageBox.ShowQuestion("你确定要删除部门 [" + dpt_name + "] 吗?");
                }
            }
        }
예제 #14
0
        void gridView2_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow dr = gridView2.GetDataRow(e.RowHandle);

            if (e.Column.Name == "modify")
            {
                frmdddd frmadd = new frmdddd(dr);
                frmadd.ShowDialog();
                frmadd.Dispose();
                Getdata();
            }
            else if (e.Column.Name == "del")
            {
                delrow = dr;
                DXMessageBox.btnOKClick += DXMessageBox_btnOKClick;
                DXMessageBox.ShowQuestion("确定要删除吗");
            }
        }
예제 #15
0
        protected override void OnDelClick(DataRow selectedRow)
        {
            string pkVal = selectedRow[PrimaryKey].ToString();

            DXMessageBox.btnOKClick += (object sender, EventArgs e) =>
            {
                bool suc = Tmo_FakeEntityClient.Instance.DeleteData(TableName, PrimaryKey, pkVal);
                if (suc)
                {
                    GetData();
                    DXMessageBox.Show("设备解除绑定成功!", true);
                }
                else
                {
                    DXMessageBox.ShowWarning("设备解除绑定失败!");
                }
            };
            DXMessageBox.ShowQuestion("确定要解除与该设备的绑定吗?");
        }
예제 #16
0
        protected override void OnDelClick(DataRow selectedRow)
        {
            if (Is_public && !TmoComm.login_docInfo.doc_function_list.Contains("funSaveInterveneLib"))
            {
                DXMessageBox.ShowError("无法操作,您没有相关权限!", this);
                return;
            }

            DXMessageBox.btnOKClick += (_sender, _e) =>
            {
                bool del = Tmo_FakeEntityClient.Instance.DeleteData(TableName, PrimaryKey, selectedRow[PrimaryKey].ToString());
                if (del)
                {
                    DXMessageBox.Show("健康干预库删除成功!", true);
                    GetData();
                }
            };
            DXMessageBox.ShowQuestion("确定要删除该健康干预库吗?");
        }
예제 #17
0
        protected override void OnDelClick(DataRow selectedRow)
        {
            string name  = selectedRow["name"].ToString();
            string pkVal = selectedRow[PrimaryKey].ToString();

            DXMessageBox.btnOKClick += (object sender, EventArgs e) =>
            {
                bool suc = Tmo_FakeEntityClient.Instance.DeleteData(TableName, PrimaryKey, pkVal);
                if (suc)
                {
                    GetData();
                    DXMessageBox.Show(string.Format("用户【{0}】删除成功!", name), true);
                }
                else
                {
                    DXMessageBox.ShowWarning("删除失败!");
                }
            };
            DXMessageBox.ShowQuestion("确定要删除用户【" + name + "】吗?");
        }
예제 #18
0
        protected override void OnDelClick(DataRow selectedRow)
        {
            string group_id   = selectedRow[PrimaryKey].ToString();
            string group_name = selectedRow["group_name"].ToString();

            DXMessageBox.btnOKClick += (object sender, EventArgs e) =>
            {
                bool suc = Tmo_FakeEntityClient.Instance.DeleteData(TableName, PrimaryKey, group_id);
                if (!suc)
                {
                    DXMessageBox.ShowError("删除失败,请重试!");
                    return;
                }
                Dictionary <string, object> dic = new Dictionary <string, object>();
                dic.Add("doc_group", -1);
                suc = Tmo_FakeEntityClient.Instance.SubmitData(TmoCommon.DBOperateType.Update, "tmo_docinfo", "doc_group", group_id, dic);
                GetData();
            };
            DXMessageBox.ShowQuestion(string.Format("确定要删除群组【{0}】吗?", group_name));
        }
예제 #19
0
        private void dgvMain_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow dr = gridView1.GetDataRow(e.RowHandle);

            drdel = dr;
            if (e.Column.Name == "del")
            {
                DXMessageBox.btnOKClick += DXMessageBox_btnOKClick;
                DXMessageBox.ShowQuestion("确定删除吗?");
            }
            else if (e.Column.Name == "look_report")
            {
                frmtenances.showData(dr);

                frmtenances.ShowDialog();
            }
            else if (e.Column.Name == "luru")
            {
            }
        }
예제 #20
0
        void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow dr = gridView1.GetDataRow(e.RowHandle);

            drDel = dr;
            //EventArgs
            //DXMessageBox.btnCancelClick = (object sender,EventArgs e) => { };
            if (e.Column.Name == "del")
            {
                DXMessageBox.btnOKClick += DXMessageBox_btnOKClick;
                DXMessageBox.ShowQuestion("确定要删除吗?");
            }
            else if (e.Column.Name == "look_report")
            {
                FrmEvalReport frmEvalReport = new FrmEvalReport();
                frmEvalReport.inidata();
                frmEvalReport.initPersonData(dr);
                frmEvalReport.ShowDialog();
                frmEvalReport.Dispose();
            }
        }
예제 #21
0
        private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow dr = gridView2.GetDataRow(e.RowHandle);

            if (e.Column.Name == "del")
            {
                Delrow = dr;

                DXMessageBox.btnOKClick += DXMessageBox_btnOKClick;
                DXMessageBox.ShowQuestion("确定要删除吗");
            }
            else if (e.Column.Name == "modify")
            {
                string       id      = dr["id"].ToString();
                frmAddVideos frmvide = new frmAddVideos(); //
                frmvide.Indata(id);
                frmvide.ShowDialog();
                frmvide.Dispose();
                GetData();
            }
        }
예제 #22
0
        protected override void OnDelClick(DataRow selectedRow)
        {
            string pkval  = selectedRow[PrimaryKey].ToString();
            string pkname = selectedRow["mt_name"].ToString();

            DXMessageBox.btnOKClick += (object sender, EventArgs e) =>
            {
                bool suc = Tmo_FakeEntityClient.Instance.DeleteData(TableName, PrimaryKey, pkval);
                if (suc)
                {
                    DXMessageBox.Show("删除监测项目成功!", true);
                    GetData();
                }
                else
                {
                    DXMessageBox.ShowError("删除监测项目失败,请重试!");
                }
            };
            DXMessageBox.ShowQuestion(string.Format("确定要删除监测项目【{0}】吗?", pkname));

            base.OnDelClick(selectedRow);
        }
예제 #23
0
 private void btnDel_Click(object sender, EventArgs e)
 {
     if (this.gridView1.GetSelectedRows().Length < 1)
     {
         DXMessageBox.ShowWarning("未选中任何用户!");
     }
     else
     {
         int         selectedHandle = this.gridView1.GetSelectedRows()[0];
         DataRowView rowv           = this.gridView1.GetRow(selectedHandle) as DataRowView;
         if (rowv == null)
         {
             return;
         }
         DataRow      row      = rowv.Row;
         string       userId   = row["user_id"].ToString();
         string       userTmes = row["user_times"].ToString();
         DialogResult dgResult = DXMessageBox.ShowQuestion("确定要删除吗?");
         if (dgResult == DialogResult.OK)
         {
             try
             {
                 bool isscul = TmoServiceClient.InvokeServerMethodT <bool>(funCode.DelAttach, new object[] { userId, userTmes });
                 if (isscul)
                 {
                     DXMessageBox.Show("删除成功", true);
                 }
                 else
                 {
                     DXMessageBox.ShowWarning2("删除失败!");
                 }
             }
             catch (Exception)
             {
                 DXMessageBox.ShowWarning2("删除失败!有可能是网络原因请重试!");
             }
         }
     }
 }
예제 #24
0
        void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow dr = gridView2.GetDataRow(e.RowHandle);

            user_idd    = dr["user_id"].ToString();
            user_timesd = dr["user_times"].ToString();

            if (e.Column.Name == "modify")
            {
                frmPersonPro frmper = new frmPersonPro();
                frmper.Indata(dr);
                frmper.ShowDialog();
                frmper.Dispose();
                Getdata(user_idd, user_timesd);
            }
            else if (e.Column.Name == "del")
            {
                project_idva             = dr["project_id"].ToString();
                DXMessageBox.btnOKClick += DXMessageBox_btnOKClick;
                DXMessageBox.ShowQuestion("您确定要删除吗?");
            }
        }
예제 #25
0
        protected override void OnDelClick(DataRow selectedRow)
        {
            string doc_name = selectedRow["doc_name"].ToString();
            string pkVal    = selectedRow[PrimaryKey].ToString();

            if (TmoComm.login_docInfo.doc_id.ToString() == pkVal)
            {
                DXMessageBox.ShowInfo("不能删除自身!");
                return;
            }
            DXMessageBox.btnOKClick += (object sender, EventArgs e) =>
            {
                DataTable dtcount = Tmo_FakeEntityClient.Instance.GetData("tmo_userinfo", new[] { "count(*) as count" }, "doc_id='" + pkVal + "'");
                if (TmoShare.DataTableIsNotEmpty(dtcount))
                {
                    int count = dtcount.Rows[0].GetDataRowIntValue("count");
                    if (count > 0)
                    {
                        DXMessageBox.ShowWarning("该健康师下分配有用户不能删除!");
                        return;
                    }
                }
                bool suc = Tmo_FakeEntityClient.Instance.DeleteData(TableName, PrimaryKey, pkVal);
                if (suc)
                {
                    DXMessageBox.Show("健康师删除成功!", true);
                    Tmo_CommonClient.Instance.RefreshDocChildrenID();
                    GetData();
                }
                else
                {
                    DXMessageBox.ShowWarning("删除失败!");
                }
            };
            DXMessageBox.ShowQuestion("确定要删除健康师【" + doc_name + "】吗?");
            base.OnDelClick(selectedRow);
        }
예제 #26
0
        void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow dr = gridView1.GetDataRow(e.RowHandle);

            drDel = dr;
            if (e.Column.Name == "del")
            {
                string isRisk = dr["isrisk"].ToString();
                if (isRisk == "已评估")
                {
                    DXMessageBox.Show("已评估问卷不能删除!", MessageIcon.Info, MessageButton.OK);
                }
                else
                {
                    DXMessageBox.btnOKClick += DXMessageBox_btnOKClick;
                    DXMessageBox.ShowQuestion("确定要删除吗?");
                }
            }
            else if (e.Column.Name == "look_report")
            {
                string userID = dr["user_id"].ToString();
                string isRisk = dr["isrisk"].ToString();
                if (isRisk != "已评估")
                {
                    frmquertions frmda = new frmquertions();
                    frmda.indata(userID, 1);
                    frmda.ShowDialog();
                }
                else
                {
                    frmquertions frmda = new frmquertions();
                    frmda.indata(userID, -1);
                    frmda.ShowDialog();
                    //DXMessageBox.Show("已评估问卷不能修改!", MessageIcon.Info, MessageButton.OK);
                }
            }
        }
예제 #27
0
        protected override void OnDelClick(DataRow selectedRow)
        {
            if (Is_public == 1 && !TmoComm.login_docInfo.doc_function_list.Contains("funSaveActionPlanLib"))
            {
                DXMessageBox.ShowError("无法操作,您没有相关权限!", this);
                return;
            }
            if (Is_public == 2 && !TmoComm.login_docInfo.doc_function_list.Contains("funSaveSystemActionPlanLib"))
            {
                DXMessageBox.ShowError("无法操作,您没有相关权限!", this);
                return;
            }

            DXMessageBox.btnOKClick += (_sender, _e) =>
            {
                bool del = Tmo_FakeEntityClient.Instance.DeleteData(TableName, PrimaryKey, selectedRow[PrimaryKey].ToString());
                if (del)
                {
                    DXMessageBox.Show("健康计划库删除成功!", true);
                    GetData();
                }
            };
            DXMessageBox.ShowQuestion(string.Format("确定要删除该【{0}】健康计划库吗?", selectedRow.GetDataRowStringValue("aclb_title")));
        }
예제 #28
0
        /// <summary>
        /// 添加用户事件
        /// </summary>
        /// <param name="e"></param>
        protected override void OnAddClick(EventArgs e)
        {
            UCUserEditor useredit = new UCUserEditor {
                DbOperaType = DBOperateType.Add, Title = "新建个人用户"
            };
            DialogResult dr = useredit.ShowDialog();

            if (dr == DialogResult.OK)
            {
                GetData();
                DXMessageBox.Show("新建个人用户成功!", true);
                DXMessageBox.btnOKClick += (sender, _e) =>
                {
                    Userinfo user = useredit.userinfo;
                    user.user_id    = user.identity;
                    user.user_times = -1;
                    UCQuestionnaire questionnaire = new UCQuestionnaire(user);
                    questionnaire.ShowDialog(this);
                    questionnaire.Dispose();
                };
                DXMessageBox.ShowQuestion("是否开始填写问卷?");
            }
            useredit.Dispose();
        }
예제 #29
0
        void btnNext_Click(object sender, EventArgs e)
        {
            bool pass = ValidateCurrentTabPage();

            if (!pass)
            {
                return;
            }

            var tabPage = btnNext.Tag as XtraTabPage;

            if (tabPage != null)
            {   //下一页
                xtraTabControlMain.SelectedTabPage = tabPage;
            }
            else
            {   //提交
                DialogResult dr = DXMessageBox.ShowQuestion("确定要提交问卷吗?", this);
                if (dr != DialogResult.OK)
                {
                    return;
                }
                this.ShowWaitingPanel(() => controlData.SubmitResult(), x =>
                {
                    List <tmo_questionnaire_category> suc = x as List <tmo_questionnaire_category>;
                    if (suc != null)
                    {
                        if (suc.Any())  //加载剩下的问卷
                        {
                            var qc = new UCQuestionnaireChoice(suc);
                            qc.ShowDialog(this);

                            var ids = qc.GetSelectedCategories().Select(y => y.qc_id).ToArray();
                            LoadQuestionnaire(ids);
                            qc.Dispose();
                        }
                        else
                        {
                            DXMessageBox.Show("问卷提交成功!", true);
                            DialogResult result = DXMessageBox.ShowQuestion("问卷已经填写完毕,是否进行评估?", this);
                            if (result == DialogResult.OK)
                            {
                                bool r = TmoServiceClient.InvokeServerMethodT <bool>(funCode.RiskNewReport,
                                                                                     currentUser.user_id, controlData.Status.usertimes);
                                if (r)
                                {
                                    DXMessageBox.Show("问卷评估成功", true);
                                }
                                else
                                {
                                    DXMessageBox.ShowError("问卷评估失败!", this);
                                }
                            }
                            CloseForm(true);
                        }
                    }
                    else
                    {
                        DXMessageBox.ShowWarning2("问卷提交失败!", this);
                    }
                }, "正在提交问卷");
            }
        }
예제 #30
0
 private void del_Click(object sender, EventArgs e)
 {
     DXMessageBox.btnOKClick += DXMessageBox_btnOKClick;
     DXMessageBox.ShowQuestion("确定要删除吗");
 }