/// <summary>
        /// 科室选择事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeDept_EditValueChanged(object sender, EventArgs e)
        {
            Object deptId = treeDept.EditValue;

            if (deptId.Equals("`"))
            {
                deptId = "";
            }
            String param = "hospital.id=" + AppContext.Session.hospitalId + "&dept.id=" + deptId;
            //String param = "pageNo=1&pageSize=10000&hospital.id=" + AppContext.Session.hospitalId + "&dept.id=" + deptId;
            String  url  = AppContext.AppConfig.serverUrl + "cms/doctor/findAll?" + param;
            String  data = HttpClass.httpPost(url);
            JObject objT = JObject.Parse(data);

            if (string.Compare(objT["state"].ToString(), "true", true) == 0)
            {
                List <DoctorInfoEntity> doctorList = objT["result"].ToObject <List <DoctorInfoEntity> >();
                DoctorInfoEntity        doctor     = new DoctorInfoEntity();
                doctor.id   = "";
                doctor.name = "全部医生";
                doctorList.Insert(0, doctor);
                lueDoctor.Properties.DataSource    = doctorList;
                lueDoctor.Properties.DisplayMember = "name";
                lueDoctor.Properties.ValueMember   = "id";
                lueDoctor.ItemIndex = 0;
            }
            else
            {
                MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
                return;
            }
        }
Ejemplo n.º 2
0
        private void repositoryItemButtonEdit2_Click(object sender, EventArgs e)
        {
            var selectedRow = gvRole.GetFocusedRow() as RoleEntity;

            if (selectedRow == null)
            {
                return;
            }

            if (MessageBoxUtils.Show("确定要删除吗?", MessageBoxButtons.OKCancel,
                                     MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MainForm) == DialogResult.OK)
            {
                cmd.ShowOpaqueLayer();
                String url = AppContext.AppConfig.serverUrl + "sys/sysRole/delete?id=" + selectedRow.id;
                this.DoWorkAsync(500, (o) => //耗时逻辑处理(此处不能操作UI控件,因为是在异步中)
                {
                    String data = HttpClass.httpPost(url);
                    return(data);
                }, null, (data) => //显示结果(此处用于对上面结果的处理,比如显示到界面上)
                {
                    JObject objT = JObject.Parse(data.ToString());
                    if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                    {
                        SearchData();
                        MessageBoxUtils.Hint("删除成功!", MainForm);
                    }
                    else
                    {
                        cmd.HideOpaqueLayer();
                        MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                             MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
                    }
                });
            }
        }
Ejemplo n.º 3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!dcMenu.Validate())
            {
                return;
            }
            dcMenu.GetValue(menu);
            var index = treeParent.Properties.GetIndexByKeyValue(menu.parentId);
            List <MenuEntity> entityList = treeParent.Properties.TreeList.DataSource as List <MenuEntity>;

            menu.parentIds = entityList[index].parentIds + menu.parentId + ",";
            String param = PackReflectionEntity <MenuEntity> .GetEntityToRequestParameters(menu, true);

            cmd.ShowOpaqueLayer();
            this.DoWorkAsync(500, (o) => //耗时逻辑处理(此处不能操作UI控件,因为是在异步中)
            {
                String data = HttpClass.httpPost(AppContext.AppConfig.serverUrl + "sys/sysMenu/save?" + param);
                return(data);
            }, null, (data) => //显示结果(此处用于对上面结果的处理,比如显示到界面上)
            {
                JObject objT = JObject.Parse(data.ToString());
                cmd.HideOpaqueLayer();
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                         MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this);
                }
            });
        }
Ejemplo n.º 4
0
 private void bw_RunWorkerGetNCDDocListCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     try
     {
         String  data = e.Result as String;
         JObject objT = JObject.Parse(data);
         if (string.Compare(objT["state"].ToString(), "true", true) == 0)
         {
             List <DocInfoEntity> list = objT["result"].ToObject <List <DocInfoEntity> >();
             this.gc_docInfoNCD.DataSource = list;
         }
         else
         {
             MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
         }
     }
     catch (Exception ex)
     {
         MessageBoxUtils.Show(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
     }
     finally
     {
         try
         {
             // 关闭加载提示框
             //DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm();
             cmd.HideOpaqueLayer();
         }
         catch
         { }
     }
 }
Ejemplo n.º 5
0
        public void SearchData(int pageNo, int pageSize)
        {
            String param = "?name=" + tbName.Text
                           + "&&description=" + tbDescription.Text + "&&pageNo=" + pageNo
                           + "&&pageSize=" + pageSize;
            String url = AppContext.AppConfig.serverUrl + "sys/function/findAll" + param;

            this.DoWorkAsync(500, (o) => //耗时逻辑处理(此处不能操作UI控件,因为是在异步中)
            {
                String data = HttpClass.httpPost(url);
                return(data);
            }, null, (r) => //显示结果(此处用于对上面结果的处理,比如显示到界面上)
            {
                cmd.HideOpaqueLayer();
                JObject objT = JObject.Parse(r.ToString());
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    gcDict.DataSource = objT["result"]["list"].ToObject <List <FunctionEntity> >();
                    pageControl1.setData(int.Parse(objT["result"]["count"].ToString()),
                                         int.Parse(objT["result"]["pageSize"].ToString()),
                                         int.Parse(objT["result"]["pageNo"].ToString()));
                }
                else
                {
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                         MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
                }
            });
        }
Ejemplo n.º 6
0
        public bool OnAddCustomField(object argument)
        {
            CheckDisposed();

            // Only allow adding custom fields when a single client is connected.
            if (Cache.NumberOfRemoteClients > 1 || (Cache.ProjectId.IsLocal && Cache.NumberOfRemoteClients > 0))
            {
                MessageBoxUtils.Show(ParentForm, xWorksStrings.ksCustomFieldsCanNotBeAddedDueToRemoteClientsText,
                                     xWorksStrings.ksCustomFieldsCanNotBeAddedDueToRemoteClientsCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(true);
            }

            AddCustomFieldDlg.LocationType locationType = AddCustomFieldDlg.LocationType.Lexicon;
            string areaChoice = m_mediator.PropertyTable.GetStringProperty("areaChoice", string.Empty);

            switch (areaChoice)
            {
            case "lexicon":
                locationType = AddCustomFieldDlg.LocationType.Lexicon;
                break;

            case "notebook":
                locationType = AddCustomFieldDlg.LocationType.Notebook;
                break;
            }
            using (var dlg = new AddCustomFieldDlg(m_mediator, locationType))
                dlg.ShowDialog(this);

            return(true);               // handled
        }
Ejemplo n.º 7
0
        public void SearchData(bool flag, int pageNo, int pageSize)
        {
            var param = "?title=" + tbTitle.Text
                        + "&&version=" + tbVersion.Text + "&&pageNo=" + pageNo
                        + "&&pageSize=" + pageSize;
            var url = AppContext.AppConfig.serverUrl + "sys/clientVersion/list" + param;

            DoWorkAsync(0, (o) =>
            {
                var data = HttpClass.httpPost(url);
                return(data);
            }, null, (r) =>
            {
                cmd.HideOpaqueLayer();
                var objT = JObject.Parse(r.ToString());
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    gcDict.DataSource = objT["result"][0]["list"].ToObject <List <ClientVersionEntity> >();
                    pageControl1.setData(int.Parse(objT["result"][0]["count"].ToString()),
                                         int.Parse(objT["result"][0]["pageSize"].ToString()),
                                         int.Parse(objT["result"][0]["pageNo"].ToString()));
                }
                else
                {
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                         MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
                }
            });
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 保存按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void butContronl_Click(object sender, EventArgs e)
        {
            try
            {
                if (!dcHodily.Validate())
                {
                    return;
                }
                dcHodily.GetValue(holidayInfoEntity);
                String param = "?" + PackReflectionEntity <HolidayInfoEntity> .GetEntityToRequestParameters(holidayInfoEntity, true);

                String  url  = AppContext.AppConfig.serverUrl + "cms/holiday/save" + param;
                String  data = HttpClass.httpPost(url);
                JObject objT = JObject.Parse(data);
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    MessageBoxUtils.Hint("保存成功!", MainForm);
                    dcHodily.ClearValue();
                    groupBox1.Enabled = false;
                    HolidaySettingList(1, pageControl1.PageSize);
                }
                else
                {
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
                }
            }
            catch (Exception ex)
            {
                MessageBoxUtils.Show(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
                Log4net.LogHelper.Error("节假日保存错误信息:" + ex.Message);
            }
        }
Ejemplo n.º 9
0
 /// <summary>
 /// 节假日列表
 /// </summary>
 /// <param name="pageNo">页码</param>
 /// <param name="pageSize">页数</param>
 public void HolidaySettingList(int pageNo, int pageSize)
 {
     try
     {
         String  url  = AppContext.AppConfig.serverUrl + "cms/holiday/list?pageNo=" + pageNo + "&pageSize=" + pageSize + "&hospital.id=" + AppContext.Session.hospitalId;
         String  data = HttpClass.httpPost(url);
         JObject objT = JObject.Parse(data);
         if (string.Compare(objT["state"].ToString(), "true", true) == 0)
         {
             this.gc_Holiday.DataSource = objT["result"]["list"].ToObject <List <HolidayInfoEntity> >();
             pageControl1.setData(int.Parse(objT["result"]["count"].ToString()),
                                  int.Parse(objT["result"]["pageSize"].ToString()),
                                  int.Parse(objT["result"]["pageNo"].ToString()));
             cmd.HideOpaqueLayer();
         }
         else
         {
             MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
             cmd.HideOpaqueLayer();
         }
     }
     catch (Exception ex)
     {
         cmd.HideOpaqueLayer();
         MessageBoxUtils.Show(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
         Log4net.LogHelper.Error("获取节假日列表错误信息:" + ex.Message);
     }
 }
Ejemplo n.º 10
0
        /// <summary>
        /// 重写按键监视方法,用于操作窗体
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="keyData"></param>
        /// <returns></returns>
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            int WM_KEYDOWN    = 256;
            int WM_SYSKEYDOWN = 260;

            if (msg.Msg == WM_KEYDOWN | msg.Msg == WM_SYSKEYDOWN)
            {
                switch (keyData)
                {
                case Keys.Escape:
                    if (this.Size.Height == 28)
                    {
                        if (MessageBoxUtils.Show("您确定要退出程序吗?", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1, null) == DialogResult.OK)
                        {
                            Log4net.LogHelper.Info("退出系统成功");
                            StopDoctor("1");
                            System.Environment.Exit(0);
                        }
                    }
                    else
                    {
                        if (MessageBoxUtils.Show("您确定要退出程序吗?", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1, Form1.pCurrentWin) == DialogResult.OK)
                        {
                            Log4net.LogHelper.Info("退出系统成功");
                            StopDoctor("1");
                            System.Environment.Exit(0);
                        }
                    }
                    break;
                }
            }
            return(false);
        }
Ejemplo n.º 11
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnDel_Click(object sender, EventArgs e)
 {
     try
     {
         var selectedRow = gv_Holiday.GetFocusedRow() as HolidayInfoEntity;
         if (selectedRow == null)
         {
             return;
         }
         //MessageBoxButtons messButton = MessageBoxButtons.OKCancel;
         DialogResult dr = MessageBoxUtils.Show("确定要删除吗?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MainForm);
         if (dr == DialogResult.OK)
         {
             String  param = "?id=" + selectedRow.id;
             String  url   = AppContext.AppConfig.serverUrl + "cms/holiday/delete" + param;
             String  data  = HttpClass.httpPost(url);
             JObject objT  = JObject.Parse(data);
             if (string.Compare(objT["state"].ToString(), "true", true) == 0)
             {
                 Xr.Common.MessageBoxUtils.Hint("删除成功", MainForm);
                 HolidaySettingList(1, pageControl1.PageSize);
                 this.dcHodily.ClearValue();
             }
             else
             {
                 MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBoxUtils.Show(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
         Log4net.LogHelper.Error("节假日修改错误信息:" + ex.Message);
     }
 }
 public void GetClinc(string hospitalId, string deptId)
 {
     try
     {
         if (treePeriod.EditValue != null && treePeriod.EditValue.ToString().Length > 0)
         {
             List <ClinicInfoEntity> clinicInfo = new List <ClinicInfoEntity>();
             String url = AppContext.AppConfig.serverUrl + "cms/clinic/findClinicList?hospitalId=" + hospitalId
                          + "&deptId=" + deptId + "&workDate=" + DateTime.Now.ToString("yyyy-MM-dd")
                          + "&period=" + treePeriod.EditValue;
             String  data = HttpClass.httpPost(url);
             JObject objT = JObject.Parse(data);
             if (string.Compare(objT["state"].ToString(), "true", true) == 0)
             {
                 clinicInfo = new List <ClinicInfoEntity>();
                 clinicInfo = objT["result"].ToObject <List <ClinicInfoEntity> >();
                 ClinicInfoEntity dept = new ClinicInfoEntity();
                 dept.id   = "";
                 dept.name = "选择诊室";
                 clinicInfo.Insert(0, dept);
                 treeClinc.Properties.DataSource    = clinicInfo;
                 treeClinc.Properties.DisplayMember = "name";
                 treeClinc.Properties.ValueMember   = "id";
             }
             else
             {
                 MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this);
             }
         }
     }
     catch (Exception ex)
     {
         Log4net.LogHelper.Error("临时停诊获取诊室错误信息:" + ex.Message);
     }
 }
        public bool CheckIsTrue(string hospitalId, string doctorID, string deptId, string clinicId, string workDate, string period)
        {
            bool Check = false;

            try
            {
                if (clinicId != "")
                {
                    String  url  = AppContext.AppConfig.serverUrl + "sch/doctorSitting/checkIsExist?hospitalId=" + hospitalId + "&doctorId=" + doctorID + "&deptId=" + deptId + "&clinicId=" + clinicId + "&workDate=" + workDate + "&period=" + period;
                    String  data = HttpClass.httpPost(url);
                    JObject objT = JObject.Parse(data);
                    if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                    {
                        Check = true;
                    }
                    else
                    {
                        MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this);
                        Check = false;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBoxUtils.Show(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this);
                Log4net.LogHelper.Error("检查当前科室+日期+诊室是否已经存在错误信息:" + ex.Message);
            }
            return(Check);
        }
Ejemplo n.º 14
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            String ids = "";

            foreach (UserEntity user in userList)
            {
                ids = ids + user.id + ",";
            }
            ids.Substring(0, ids.Length - 1);
            String url = AppContext.AppConfig.serverUrl + "sys/sysRole/assignrole?roleId=" + roleId + "&&ids=" + ids;

            cmd.ShowOpaqueLayer();
            this.DoWorkAsync(500, (o) => //耗时逻辑处理(此处不能操作UI控件,因为是在异步中)
            {
                String data = HttpClass.httpPost(url);
                return(data);
            }, null, (data) => //显示结果(此处用于对上面结果的处理,比如显示到界面上)
            {
                JObject objT = JObject.Parse(data.ToString());
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    msg          = objT["message"].ToString();
                    DialogResult = DialogResult.OK;
                    cmd.HideOpaqueLayer();
                }
                else
                {
                    cmd.HideOpaqueLayer();
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                         MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this);
                }
            });
        }
Ejemplo n.º 15
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            List <SourceDataEntity> sourceDataList = gcSourceData.DataSource as List <SourceDataEntity>;
            String scheduSets = Newtonsoft.Json.JsonConvert.SerializeObject(sourceDataList);
            String param      = "scheduSets=" + scheduSets;
            String url        = AppContext.AppConfig.serverUrl + "sch/doctorScheduPlan/updateScheduList?" + param;

            cmd.ShowOpaqueLayer();
            this.DoWorkAsync(0, (o) => //耗时逻辑处理(此处不能操作UI控件,因为是在异步中)
            {
                String data = HttpClass.httpPost(url);
                return(data);
            }, null, (data) => //显示结果(此处用于对上面结果的处理,比如显示到界面上)
            {
                JObject objT = JObject.Parse(data.ToString());
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    cmd.HideOpaqueLayer();
                    DialogResult = DialogResult.OK;
                }
                else
                {
                    cmd.HideOpaqueLayer();
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this);
                    return;
                }
            });
        }
 /// <summary>
 /// 获取当前科室医生
 /// </summary>
 /// <param name="dept"></param>
 public void GetDoctorLue()
 {
     try
     {
         List <HospitalInfoEntity> doctorInfoEntity = new List <HospitalInfoEntity>();
         // 查询医生下拉框数据
         string  url  = AppContext.AppConfig.serverUrl + "cms/doctor/findAll?hospital.id=" + AppContext.Session.hospitalId + "&dept.id=" + treeDeptId.EditValue;
         String  data = HttpClass.httpPost(url);
         JObject objT = JObject.Parse(data);
         if (string.Compare(objT["state"].ToString(), "true", true) == 0)
         {
             doctorInfoEntity = objT["result"].ToObject <List <HospitalInfoEntity> >();
             doctorInfoEntity.Insert(0, new HospitalInfoEntity {
                 id = "", name = "全部"
             });
             lueDoctor.Properties.DataSource    = doctorInfoEntity;
             lueDoctor.Properties.DisplayMember = "name";
             lueDoctor.Properties.ValueMember   = "id";
             lueDoctor.ItemIndex = 0;
         }
         else
         {
             MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
             return;
         }
     }
     catch (Exception ex)
     {
         MessageBoxUtils.Show(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
         Log4net.LogHelper.Error("获取医生错误信息:" + ex.Message);
     }
 }
        private void lueHospital_EditValueChanged(object sender, EventArgs e)
        {
            if (lueHospital.EditValue == null || lueHospital.EditValue.ToString().Length == 0)
            {
                treeParentId.Properties.DataSource = null;
                return;
            }
            HospitalInfoEntity hospitalInfo = lueHospital.GetSelectedDataRow() as HospitalInfoEntity;
            //查询上级科室下拉框数据
            String  url  = AppContext.AppConfig.serverUrl + "cms/dept/findAll?hospital.code=" + hospitalInfo.code;// +"&deptIds=" + AppContext.Session.deptIds;
            String  data = HttpClass.httpPost(url);
            JObject objT = JObject.Parse(data);

            if (string.Compare(objT["state"].ToString(), "true", true) == 0)
            {
                List <DeptEntity> deptLsit = objT["result"].ToObject <List <DeptEntity> >();
                DeptEntity        dept     = new DeptEntity();
                dept.id   = "0";
                dept.name = "无";
                deptLsit.Insert(0, dept);

                treeParentId.Properties.DataSource               = deptLsit;
                treeParentId.Properties.TreeList.KeyFieldName    = "id";
                treeParentId.Properties.TreeList.ParentFieldName = "parentId";
                treeParentId.Properties.DisplayMember            = "name";
                treeParentId.Properties.ValueMember              = "id";
            }
            else
            {
                MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                     MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
                return;
            }
        }
 private void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     try
     {
         this.gvFinshPatient.ClearSorting();//清空排序
         List <String> datas = e.Result as List <String>;
         if (datas.Count == 0)
         {
             return;
         }
         JObject objT = new JObject();
         objT = JObject.Parse(datas[0]);
         if (string.Compare(objT["state"].ToString(), "true", true) == 0)
         {
             List <FinshPatientEntity> list = objT["result"].ToObject <List <FinshPatientEntity> >();
             this.gcFinshPatient.DataSource = list;
             this.lab_count.Text            = list.Count.ToString();
         }
         else
         {
             MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
             return;
         }
     }
     catch (Exception ex)
     {
         MessageBoxUtils.Show(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
     }
     finally
     {
         // 关闭加载提示框
         //DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm();
         cmd.HideOpaqueLayer();
     }
 }
Ejemplo n.º 19
0
 private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     if (e.Column.Caption == "操作")
     {
         var selectedRow = gridView1.GetFocusedRow() as ClientVersionEntity;
         if (selectedRow == null)
         {
             return;
         }
         if (MessageBoxUtils.Show("确定要删除吗?", MessageBoxButtons.OKCancel,
                                  MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MainForm) == DialogResult.OK)
         {
             cmd.ShowOpaqueLayer(225, true);
             var param = "?id=" + selectedRow.id;
             var url   = AppContext.AppConfig.serverUrl + "sys/clientVersion/delete" + param;
             DoWorkAsync(500, (o) =>
             {
                 var data = HttpClass.httpPost(url);
                 return(data);
             }, null, (r) =>
             {
                 var objT = JObject.Parse(r.ToString());
                 if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                 {
                     SearchData(false, pageControl1.CurrentPage, pageControl1.PageSize);
                     MessageBoxUtils.Hint("删除成功!", MainForm);
                 }
                 else
                 {
                     MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                          MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
                 }
             });
         }
     }
     else
     {
         var selectedRow = gridView1.GetFocusedRow() as ClientVersionEntity;
         if (selectedRow == null)
         {
             return;
         }
         var edit = new ClientVersionEdit();
         edit.clientVersion = selectedRow;
         edit.Text          = "版本修改";
         if (edit.ShowDialog() == DialogResult.OK)
         {
             MessageBoxUtils.Hint("修改成功!", MainForm);
             DoWorkAsync(500, (o) =>
             {
                 Thread.Sleep(2700);
                 return(null);
             }, null, (r) =>
             {
                 cmd.ShowOpaqueLayer(255, true);
                 SearchData(true, pageControl1.CurrentPage, pageControl1.PageSize);
             });
         }
     }
 }
Ejemplo n.º 20
0
        private void SearchData()
        {
            String url = AppContext.AppConfig.serverUrl + "sys/sysOffice/findAll";

            this.DoWorkAsync(500, (o) => //耗时逻辑处理(此处不能操作UI控件,因为是在异步中)
            {
                String data = HttpClass.httpPost(url);
                return(data);
            }, null, (data) => //显示结果(此处用于对上面结果的处理,比如显示到界面上)
            {
                JObject objT = JObject.Parse(data.ToString());
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    treeList1.DataSource      = objT["result"].ToObject <List <OfficeEntity> >();
                    treeList1.KeyFieldName    = "id";       //设置ID  
                    treeList1.ParentFieldName = "parentId"; //设置PreID
                    treeList1.ExpandAll();
                    cmd.HideOpaqueLayer();
                }
                else
                {
                    cmd.HideOpaqueLayer();
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                         MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
                }
            });
        }
Ejemplo n.º 21
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            var selectedRow = gridView1.GetFocusedRow() as ClientVersionEntity;

            if (selectedRow == null)
            {
                return;
            }
            if (MessageBoxUtils.Show("确定要删除吗?", MessageBoxButtons.OKCancel,
                                     MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MainForm) == DialogResult.OK)
            {
                cmd.ShowOpaqueLayer(225, true);
                var param = "?id=" + selectedRow.id;
                var url   = AppContext.AppConfig.serverUrl + "sys/clientVersion/delete" + param;
                DoWorkAsync(500, (o) =>
                {
                    var data = HttpClass.httpPost(url);
                    return(data);
                }, null, (r) =>
                {
                    var objT = JObject.Parse(r.ToString());
                    if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                    {
                        SearchData(false, pageControl1.CurrentPage, pageControl1.PageSize);
                        MessageBoxUtils.Hint("删除成功!", MainForm);
                    }
                    else
                    {
                        MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                             MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
                    }
                });
            }
        }
Ejemplo n.º 22
0
 private void grid_bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     try
     {
         String  data = e.Result as String;
         JObject objT = JObject.Parse(data);
         if (string.Compare(objT["state"].ToString(), "true", true) == 0)
         {
             gcUser.DataSource = objT["result"]["list"].ToObject <List <UserEntity> >();
             pageControl1.setData(int.Parse(objT["result"]["count"].ToString()),
                                  int.Parse(objT["result"]["pageSize"].ToString()),
                                  int.Parse(objT["result"]["pageNo"].ToString()));
         }
         else
         {
             MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                  MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.InnerException.Message);
     }
     finally
     {
         // 关闭加载提示框
         //DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm();
         cmd.HideOpaqueLayer();
     }
 }
        public bool StopDoctor(string hospitalId, string deptId, string clinicId, string doctorId, string isStop, string period)
        {
            bool IsStop = false;

            try
            {
                String  url  = AppContext.AppConfig.serverUrl + "sch/doctorSitting/openStop?hospitalId=" + hospitalId + "&deptId=" + deptId + "&clinicId=" + clinicId + "&doctorId=" + doctorId + "&isStop=" + isStop + "&period=" + period;
                String  data = HttpClass.httpPost(url);
                JObject objT = JObject.Parse(data);
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    IsStop = true;
                }
                else
                {
                    IsStop = false;
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1, null);
                }
            }
            catch (Exception ex)
            {
                Log4net.LogHelper.Info("叫号退出时设置当前医生停诊状态错误信息:" + ex.Message);
            }
            return(IsStop);
        }
Ejemplo n.º 24
0
        private void repositoryItemButtonEdit2_Click(object sender, EventArgs e)
        {
            var selectedRow = gridView1.GetFocusedRow() as UserEntity;

            if (selectedRow == null)
            {
                return;
            }

            if (MessageBoxUtils.Show("确定要删除吗?", MessageBoxButtons.OKCancel,
                                     MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MainForm) == DialogResult.OK)
            {
                String  url  = AppContext.AppConfig.serverUrl + "sys/sysUser/delete?id=" + selectedRow.id;
                String  data = HttpClass.httpPost(url);
                JObject objT = JObject.Parse(data);
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    SearchData(1, pageControl1.PageSize);
                    MessageBoxUtils.Hint("删除用户成功!", MainForm);
                }
                else
                {
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                         MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
                }
            }
        }
Ejemplo n.º 25
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Perform a restore of the project specified in the settings.
        /// </summary>
        /// <param name="progressDlg">The progress dialog.</param>
        /// <exception cref="IOException">File does not exist, or some such problem</exception>
        /// <exception cref="InvalidBackupFileException">XML deserialization problem or required
        /// files not found in zip file</exception>
        /// ------------------------------------------------------------------------------------
        public void RestoreProject(IThreadedProgress progressDlg)
        {
            BackupFileSettings fileSettings = m_restoreSettings.Backup;

            fileSettings.Validate();             // Normally, this will already have been done, so this will do nothing.

            bool suppressConversion = false;

            //First of all, if the project exists and we are overwriting it, then make a copy of the project.  That way
            //if the restoration fails part way through, we can put it back the way it was.
            if (Directory.Exists(m_restoreSettings.ProjectPath))
            {
                // If the project already exists using the fwdata extension, either we're not sharing,
                // or it is a project for which sharing is suppressed. In any case we don't want to
                // convert the new project.
                suppressConversion = File.Exists(m_restoreSettings.FullProjectPath);
                CreateACopyOfTheProject();
            }

            //When restoring a project, ensure all the normal folders are there even if some
            //of those folders had nothing from them in the backup.
            Directory.CreateDirectory(m_restoreSettings.ProjectPath);
            FdoCache.CreateProjectSubfolders(m_restoreSettings.ProjectPath);

            try
            {
                //Import from FW version 6.0 based on the file extension.
                string extension = Path.GetExtension(fileSettings.File).ToLowerInvariant();
                if (extension == FwFileExtensions.ksFw60BackupFileExtension || extension == ".xml")
                {
                    ImportFrom6_0Backup(fileSettings, progressDlg);
                }
                else                     //Restore from FW version 7.0 and newer backup.
                {
                    RestoreFrom7_0AndNewerBackup(fileSettings);
                }
            }
            catch (Exception error)
            {
                if (error is IOException || error is InvalidBackupFileException ||
                    error is UnauthorizedAccessException)
                {
                    CleanupAfterRestore(false);
                    // ENHANCE: If/when we have the restore process using a progress dialog so that this code
                    // runs in the progress dialog thread instead of the main thread, all message boxes should
                    // be replaced with the ThreadHelper.ShowMessageBox() method so that they will be thread-safe.
                    MessageBoxUtils.Show(null, error.Message, AppStrings.ksRestoreDidNotSucceed,
                                         MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                throw;
            }

            // switch to the desired backend (if it's in the projects directory...anything else stays XML for now).
            if (DirectoryFinder.IsSubFolderOfProjectsDirectory(m_restoreSettings.ProjectPath) && !suppressConversion)
            {
                ClientServerServices.Current.Local.ConvertToDb4oBackendIfNeeded(progressDlg, m_restoreSettings.FullProjectPath);
            }

            CleanupAfterRestore(true);
        }
Ejemplo n.º 26
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (teUserName.Text.Length == 0)
            {
                MessageBoxUtils.Show("工号不能为空!", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this);
                return;
            }
            if (tePassWord.Text.Length == 0)
            {
                MessageBoxUtils.Show("密码不能为空!", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this);
                return;
            }
            param += "&userName="******"&passWord="******"sch/doctorScheduPlan/saveToMany?";

            cmd.ShowOpaqueLayer(0.56f, "正在提交数据中");
            this.DoWorkAsync(500, (o) => //耗时逻辑处理(此处不能操作UI控件,因为是在异步中)
            {
                String data = HttpClass.httpPost(url, param, 10);
                return(data);
            }, null, (r) => //显示结果(此处用于对上面结果的处理,比如显示到界面上)
            {
                JObject objT = JObject.Parse(r.ToString());
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    cmd.HideOpaqueLayer();
                    DialogResult = DialogResult.OK;
                }
                else
                {
                    cmd.HideOpaqueLayer();
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this);
                }
            });
        }
Ejemplo n.º 27
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!dcClientVersion.Validate())
            {
                return;
            }
            dcClientVersion.GetValue(clientVersion);
            if (serviceFilePath == null || serviceFilePath.Length == 0)
            {
                dcClientVersion.ShowError(teFileName, "请先上传文件");
                return;
            }
            clientVersion.updateFilePath = serviceFilePath;
            String param = "?" + PackReflectionEntity <ClientVersionEntity> .GetEntityToRequestParameters(clientVersion);

            String url = AppContext.AppConfig.serverUrl + "sys/clientVersion/save" + param;

            this.DoWorkAsync(500, (o) => //耗时逻辑处理(此处不能操作UI控件,因为是在异步中)
            {
                String data = HttpClass.httpPost(url);
                return(data);
            }, null, (data) => //显示结果(此处用于对上面结果的处理,比如显示到界面上)
            {
                JObject objT = JObject.Parse(data.ToString());
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                         MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this);
                }
            });
        }
Ejemplo n.º 28
0
        public void SearchData(bool flag, int pageNo, int pageSize)
        {
            String type = "";

            if (!lueType.EditValue.ToString().Equals("`"))
            {
                type = lueType.EditValue.ToString();
            }
            String param = "?title=" + tbTitle.Text
                           + "&&version=" + tbVersion.Text + "&&pageNo=" + pageNo
                           + "&&pageSize=" + pageSize + "&&type=" + type;
            String url = AppContext.AppConfig.serverUrl + "sys/clientVersion/listTwo" + param;

            this.DoWorkAsync(0, (o) => //耗时逻辑处理(此处不能操作UI控件,因为是在异步中)
            {
                String data = HttpClass.httpPost(url);
                return(data);
            }, null, (r) => //显示结果(此处用于对上面结果的处理,比如显示到界面上)
            {
                cmd.HideOpaqueLayer();
                JObject objT = JObject.Parse(r.ToString());
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    gcDict.DataSource = objT["result"][0]["list"].ToObject <List <ClientVersionEntity> >();
                    pageControl1.setData(int.Parse(objT["result"][0]["count"].ToString()),
                                         int.Parse(objT["result"][0]["pageSize"].ToString()),
                                         int.Parse(objT["result"][0]["pageNo"].ToString()));
                }
                else
                {
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                         MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
                }
            });
        }
Ejemplo n.º 29
0
        /// <summary>
        /// 检查会话 12个小时一次(43200000秒)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tmHeartbeat_Tick(object sender, EventArgs e)
        {
            tmHeartbeat.Enabled = false;
            var url = AppContext.AppConfig.serverUrl + "sys/sysUser/getCurrentDate";

            DoWorkAsync(0, (o) =>
            {
                var data = HttpClass.httpPost(url);
                return(data);
            }, null, (data) =>
            {
                var objT = JObject.Parse(data.ToString());
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    tmHeartbeat.Enabled = true;
                }
                else
                {
                    if (MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OKCancel, new [] { "重新登录", "退出系统" }, this) == DialogResult.OK)
                    {
                        Application.Restart();
                    }
                    else
                    {
                        Close();
                    }
                }
            });
        }
Ejemplo n.º 30
0
        private void SetUpForm_Load(object sender, EventArgs e)
        {
            dcConfig.DataType = typeof(AppConfigEntity);
            cmd = new Xr.Common.Controls.OpaqueCommand(this);
            cmd.ShowOpaqueLayer(0f);
            //查询医院下拉框数据
            String url = AppContext.AppConfig.serverUrl + "itf/intro/hospital/findAll";

            this.DoWorkAsync(500, (o) =>
            {
                String data = HttpClass.httpPost(url);
                return(data);
            }, null, (data) =>
            {
                JObject objT = JObject.Parse(data.ToString());
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    lueHospital.Properties.DataSource    = objT["result"].ToObject <List <HospitalInfoEntity> >();
                    lueHospital.Properties.DisplayMember = "name";
                    lueHospital.Properties.ValueMember   = "code";
                    config = AppContext.AppConfig;
                    dcConfig.SetValue(config);
                    cmd.HideOpaqueLayer();
                }
                else
                {
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this);
                    return;
                }
            });
        }