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); }
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); } }); }
/// <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(); } } }); }
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); }
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); } }); } }
/// <summary> /// 根据诊室ID查询诊室是否被占用 /// </summary> /// <param name="id"></param> public void SelectClincIsQuery(string id) { try { String url = AppContext.AppConfig.serverUrl + "itf/triage/getClinic?id=" + id; String data = HttpClass.httpPost(url); JObject objT = JObject.Parse(data); if (string.Compare(objT["state"].ToString(), "true", true) == 0) { String isQccery = objT["result"]["isOccupy"].ToString(); if (isQccery != "0") { // Xr.Common.MessageBoxUtils.Show("当前诊室可用,请确认信息无误后保存", MessageBoxButtons.OK, // MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1, this); //} //else //{ if (Xr.Common.MessageBoxUtils.Show("当前诊室不可用,是否继续启动", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1, this) == DialogResult.OK) { UpdateClincQuery(id, "0"); } } } else { Xr.Common.MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this); } } catch (Exception ex) { Log4net.LogHelper.Error("查询诊室占用错误信息:" + ex.Message); } }
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); } }); }
public void GetHostile() { try { var urls = AppContext.AppConfig.serverUrl + InterfaceAddress.hostalInfo; var datas = HttpClass.httpPost(urls); var objTs = JObject.Parse(datas); if (string.Compare(objTs["state"].ToString(), "true", true) == 0) { var list = objTs["result"].ToObject <List <dynamic> >(); HostalList = new List <dynamic>(); HostalList = list; treeHostile.Properties.DataSource = list; treeHostile.Properties.DisplayMember = "name"; treeHostile.Properties.ValueMember = "code"; treeHostile.EditValue = string.Empty; } else { Xr.Common.MessageBoxUtils.Show(objTs["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1, null); Log4net.LogHelper.Error("修改配置文件时错误信息:" + objTs["message"].ToString()); System.Environment.Exit(0); } } catch (Exception ex) { Log4net.LogHelper.Error("获取医院信息错误:" + ex.Message); } }
/// <summary> /// 获取科室列表 /// </summary> public void GetInforSetting(string hostalcode) { try { var urls = AppContext.AppConfig.serverUrl + InterfaceAddress.dept + "?hospital.code=" + hostalcode; var datas = HttpClass.httpPost(urls); var objTs = JObject.Parse(datas); if (string.Compare(objTs["state"].ToString(), "true", true) == 0) { var list = objTs["result"].ToObject <List <DeptListDic> >(); DeptList = new List <DeptListDic>(); DeptList = list; treeKeshi.Properties.DataSource = list; treeKeshi.Properties.TreeList.KeyFieldName = "id"; treeKeshi.Properties.TreeList.ParentFieldName = "parentId"; treeKeshi.Properties.DisplayMember = "name"; treeKeshi.Properties.ValueMember = "code"; treeKeshi.EditValue = string.Empty; treeKeshi.Properties.TreeList.AfterCheckNode += (s, a) => { a.Node.Selected = true; GetSelectedRoleIDandName(); }; } } catch (Exception ex) { Log4net.LogHelper.Error("第一次启动查询科室和诊室错误信息:" + ex.Message); } }
/// <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); } }
/// <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); } }
/// <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 void GetDoctor(string dept) { try { List <HospitalInfoEntity> doctorInfoEntity = new List <HospitalInfoEntity>(); // 查询医生下拉框数据 String url = AppContext.AppConfig.serverUrl + "cms/doctor/findAll?hospital.id=" + AppContext.Session.hospitalId + "&dept.id=" + dept; 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 = "请选择" }); treeDoctor.Properties.DataSource = doctorInfoEntity; treeDoctor.Properties.DisplayMember = "name"; treeDoctor.Properties.ValueMember = "id"; } } catch (Exception ex) { Log4net.LogHelper.Error("临时停诊获取医生错误信息:" + ex.Message); } }
public void GetHostile() { try { String urls = AppContext.AppConfig.serverUrl + InterfaceAddress.HostalInfo; String datas = HttpClass.httpPost(urls); JObject objTs = JObject.Parse(datas); if (string.Compare(objTs["state"].ToString(), "true", true) == 0) { List <dynamic> list = objTs["result"].ToObject <List <dynamic> >(); HostalList = new List <dynamic>(); HostalList = list; string code = string.Join(",", from a in list where a.name == "中山市博爱医院" select a.code); this.treeHostile.Properties.DataSource = list; //treeKeshi.Properties.TreeList.KeyFieldName = "id"; //treeKeshi.Properties.TreeList.ParentFieldName = "parentId"; treeHostile.Properties.DisplayMember = "name"; treeHostile.Properties.ValueMember = "code"; treeHostile.EditValue = ""; } else { Xr.Common.MessageBoxUtils.Show(objTs["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1, null); Log4net.LogHelper.Error("修改配置文件时错误信息:" + objTs["message"].ToString()); System.Environment.Exit(0); } } catch (Exception ex) { Log4net.LogHelper.Error("获取医院信息错误:" + ex.Message); } }
/// <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); } }
/// <summary> /// 获取科室列表 /// </summary> public void GetInforSetting(string hospitalcode) { try { // 查询科室数据 String urls = AppContext.AppConfig.serverUrl + InterfaceAddress.dept + "?hospital.code=" + hospitalcode; String datas = HttpClass.httpPost(urls); JObject objTs = JObject.Parse(datas); if (string.Compare(objTs["state"].ToString(), "true", true) == 0) { List <dynamic> list = objTs["result"].ToObject <List <dynamic> >(); DeptList = new List <dynamic>(); DeptList = list; treeKeshi.Properties.DataSource = list; treeKeshi.Properties.TreeList.KeyFieldName = "id"; treeKeshi.Properties.TreeList.ParentFieldName = "parentId"; treeKeshi.Properties.DisplayMember = "name"; treeKeshi.Properties.ValueMember = "code"; treeKeshi.EditValue = ""; } } catch (Exception ex) { Log4net.LogHelper.Error("第一次启动查询科室和诊室错误信息:" + ex.Message); } }
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); } }); }
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); }); } } }
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); } } }
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); } }); } }
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); } }); }
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); } }); }
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); } }); }
private void bw_DoWork(object sender, DoWorkEventArgs e) { try { List <String> Results = new List <String>();//lueDept.EditValue //String param = "hospitalId=12&deptId=2&reportType=month&startDate=2019-01&endDate=2019-01"; String param = @"isUse=1&pageNo={0}&pageSize={1}"; param = String.Format( param, currPageNo, pageSize); String url = String.Empty; //获取黑名单 url = AppContext.AppConfig.serverUrl + "sch/blackList/list?" + param; Results.Add(HttpClass.httpPost(url)); //Results.Add(@"{""code"":200,""message"":""操作成功"",""result"":[{""deptName"":""急诊科"",""yyNum"":2,""openNum"":96,""yyFzNum"":1,""xcCzNum"":0,""yyCzNum"":1,""xcFzNum"":1,""xcNum"":1,""deptId"":2},{""deptName"":""急诊科"",""yyNum"":2,""openNum"":96,""yyFzNum"":1,""xcCzNum"":0,""yyCzNum"":1,""xcFzNum"":1,""xcNum"":1,""deptId"":2},{""deptName"":""急诊科"",""yyNum"":2,""openNum"":96,""yyFzNum"":1,""xcCzNum"":0,""yyCzNum"":1,""xcFzNum"":1,""xcNum"":1,""deptId"":2},{""deptName"":""急诊科"",""yyNum"":2,""openNum"":96,""yyFzNum"":1,""xcCzNum"":0,""yyCzNum"":1,""xcFzNum"":1,""xcNum"":1,""deptId"":2},{""deptName"":""急诊科"",""yyNum"":2,""openNum"":96,""yyFzNum"":1,""xcCzNum"":0,""yyCzNum"":1,""xcFzNum"":1,""xcNum"":1,""deptId"":2}],""state"":true}"); e.Result = Results; } catch (Exception ex) { e.Result = ex.Message; } }
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; } }); }
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); } }); }
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 butAdd_Click(object sender, EventArgs e) { try { if (!dcHolday.Validate()) { return; } dcHolday.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) { DialogResult = DialogResult.OK; } else { MessageBox.Show(objT["message"].ToString()); } } catch (Exception ex) { } }
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); } }); }