private bool SubmitData() { string content = about_us.GetHtmlValue(); DataSet dsConfig = TmoShare.getDataSetFromXML(strConfigXML, true); DataRow drConfig = dsConfig.Tables[0].NewRow(); drConfig["c_id"] = about_us.Tag == null ? "" : about_us.Tag.ToString(); drConfig["field_name"] = about_us.Name; drConfig["field_value"] = DESEncrypt.Encrypt(content); drConfig["remark"] = aboutPage.Text; drConfig["c_type"] = "1";//1-关于我们 2-联系我们 dsConfig.Tables[0].Rows.Add(drConfig.ItemArray); string strAboutUs = dsConfig.GetXml(); bool flag = Convert.ToBoolean(TmoServiceClient.InvokeServerMethodT <bool>(funCode.AddOrUpdateAboutUs, TmoComm.login_docInfo.doc_name, "bnys", strAboutUs)); content = contact_us.GetHtmlValue(); dsConfig.Tables[0].Rows.Clear(); drConfig = dsConfig.Tables[0].NewRow(); drConfig["c_id"] = contact_us.Tag == null ? "" : contact_us.Tag.ToString(); drConfig["field_name"] = contact_us.Name; drConfig["field_value"] = DESEncrypt.Encrypt(content); drConfig["remark"] = contactPage.Text; drConfig["c_type"] = "2";//1-关于我们 2-联系我们 dsConfig.Tables[0].Rows.Add(drConfig.ItemArray); strAboutUs = dsConfig.GetXml(); flag &= Convert.ToBoolean(TmoServiceClient.InvokeServerMethodT <bool>(funCode.AddOrUpdateAboutUs, TmoComm.login_docInfo.doc_name, "bnys", strAboutUs)); return(flag); }
/// <summary> /// 加载数据 /// </summary> public void GetData(string user_times) { this.ShowWaitingPanel(() => { try { object objrisk = TmoServiceClient.InvokeServerMethodT <string>(funCode.SelectLookQuestionnaire, dr["user_id"].ToString(), user_times); DataSet dsrisk = TmoShare.getDataSetFromXML(objrisk.ToString()); string strmlx = TmoServiceClient.InvokeServerMethodT <string>(funCode.Getdis_dic, new object[] { "" }); DataSet ds = TmoShare.getDataSetFromXML(strmlx); SetData(dsrisk, ds); return(ds.Tables[0]); } catch { } return(null); }, x => { try { DataTable dt = x as DataTable; if (dt != null) { FillTree(treeList1, dt); treeList1.CollapseAll(); } } catch (Exception ex) { LogHelper.Log.Error("实体加载数据出错", ex); DXMessageBox.ShowWarning2("数据加载失败!请重试!"); } }); }
private void btnClear_Click(object sender, EventArgs e) { DataSet ds = TmoShare.getDataSetFromXML(xmlPharmacyDiary, true); foreach (DevExpress.XtraEditors.PanelControl temp in this.Controls) { foreach (Control det in temp.Controls) { foreach (DataColumn dc in ds.Tables[0].Columns) { if (det.Name == dc.ColumnName) { if (det.GetType().ToString() == "DevExpress.XtraEditors.CheckEdit") { ((DevExpress.XtraEditors.CheckEdit)det).Checked = false; } else { det.Text = ""; } } } } } }
public static bool UpdateQuestionnaire(string xml) { DataSet ds = TmoShare.getDataSetFromXML(xml); DataTable dt = ds.Tables[0]; return(tmo_questionnaireManager.Instance.UpdateQuestionnaire(ds)); }
private bool sendmessage(string openid, string userid) { DataSet dtWeiXinMsg = TmoShare.getDataSetFromXML(tmo_wechat_consulting); //dtWeiXinMsg.Tables[0].Clear(); DataRow newRow = dtWeiXinMsg.Tables[0].NewRow(); newRow["we_id"] = openid; newRow["con_content"] = "医生主动咨询"; newRow["reply_content"] = ask_content.Text; newRow["input_time"] = System.DateTime.Now; newRow["update_time"] = System.DateTime.Now; newRow["user_id"] = userid; newRow["doc_id"] = TmoComm.login_docInfo.doc_id.ToString(); newRow["con_id"] = Guid.NewGuid().ToString("N"); dtWeiXinMsg.Tables[0].Rows.InsertAt(newRow, 0); dtWeiXinMsg.AcceptChanges(); bool answer = (bool)(TmoServiceClient.InvokeServerMethodT <bool>(funCode.AddAsk, new object[] { TmoCommon.TmoShare.getXMLFromDataSet(dtWeiXinMsg) })); if (answer) { string data = @"<data> <first> <value></value> <color></color> </first> <keyword1> <value></value> <color></color> </keyword1> <keyword2> <value></value> <color></color> </keyword2> <remark> <value></value> <color></color> </remark> </data>"; DataSet ds = TmoShare.getDataSetFromXML(data); ds.Tables["first"].Rows[0]["value"] = "尊敬的用户,医生对您进行了提问:"; ds.Tables["first"].Rows[0]["color"] = TmoShare.RGBToWebColor(Color.Gray); ds.Tables["keyword1"].Rows[0]["value"] = "无"; ds.Tables["keyword1"].Rows[0]["color"] = TmoShare.RGBToWebColor(Color.Gray); ds.Tables["keyword2"].Rows[0]["value"] = ask_content.Text; ds.Tables["keyword2"].Rows[0]["color"] = TmoShare.RGBToWebColor(Color.Gray); ds.Tables["remark"].Rows[0]["value"] = "感谢您的使用!"; ds.Tables["remark"].Rows[0]["color"] = TmoShare.RGBToWebColor(Color.Gray); string content = TmoCommon.TmoShare.GetXml_NO_TITLE(ds); string templateID = ConfigHelper.GetConfigString("WX_TEMPLATE_RSID");//模板 string err_tip = WeChatHelper.WXTemplateMsgSend(new object[] { "admin", openid, templateID, "", TmoShare.RGBToWebColor(Color.Green), content }); return(true); } else { return(false); } }
private void btnClear_Click(object sender, EventArgs e) { DataSet ds = TmoShare.getDataSetFromXML(xmlSportDiary, true); foreach (DevExpress.XtraEditors.PanelControl temp in this.Controls) { foreach (Control det in temp.Controls) { foreach (DataColumn dc in ds.Tables[0].Columns) { if (det.Name == dc.ColumnName) { if (det.GetType().ToString() == "DevExpress.XtraEditors.RadioGroup") { ((DevExpress.XtraEditors.RadioGroup)det).SelectedIndex = -1; } else { det.Text = ""; } } } } } }
/// <summary> /// 加载数据 /// </summary> public void GetData(string parentid = "0", string hotid = "0") { this.ShowWaitingPanel(() => { try { string strmlx = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetNurData, new object[] { parentid, hotid }); DataSet ds = TmoShare.getDataSetFromXML(strmlx); if (TmoShare.DataSetIsNotEmpty(ds)) { return(ds.Tables[0]); } } catch { } return(null); }, x => { try { var dt = x as DataTable; FillTree(treeList1, dt); treeList1.CollapseAll(); } catch (Exception ex) { LogHelper.Log.Error("实体加载数据出错", ex); DXMessageBox.ShowWarning2("数据加载失败!请重试!"); } }); }
/// <summary> /// 获取上次体检数据 /// </summary> /// <param name="userId"></param> /// <param name="user_times"></param> /// <returns></returns> public DataSet GetUprisk(string userId, string user_times) { int timeup = 0; if (user_times == "1" || user_times == "0") { return(null); } else { timeup = Convert.ToInt32(user_times) - 1; } DataSet ds = TmoShare.getDataSetFromXML(riskxml, true); if (ds.Tables[0].Rows.Count == 0) { ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); } ds.Tables[0].Rows[0]["user_id"] = userId; ds.Tables[0].Rows[0]["user_time"] = timeup.ToString(); string xml = TmoShare.getXMLFromDataSet(ds); string resultxml = TmoLinkServer.TmoServiceClient.InvokeServerMethodT <string>(funCode.GetRiskData, new object[] { xml }); DataSet DsReslut = TmoShare.getDataSetFromXML(resultxml); return(DsReslut); }
public bool AddConsulting(string strxml) { if (!string.IsNullOrEmpty(strxml)) { DataSet ds = TmoShare.getDataSetFromXML(strxml); if (ds == null || ds.Tables.Count < 0 || ds.Tables[0] == null || ds.Tables[0].Rows.Count < 0) { return(false); } else { DataRow row = ds.Tables[0].Rows[0]; string sql = "insert into tmo_wechat_consulting (con_id,user_id,con_content,we_id,doc_id,is_reply,input_time,is_del)" + "VALUES('" + Guid.NewGuid().ToString("N") + "','" + row["user_id"].ToString() + "','" + row["con_content"].ToString() + "','" + row["we_id"].ToString() + "','" + row["doc_id"].ToString() + "',2,'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',1)"; int num1 = MySQLHelper.ExecuteSql(sql); if (num1 > 0) { return(true); } } } return(false); }
public void Indata(string videoId) { if (!string.IsNullOrEmpty(videoId)) { this.Text = "视频修改"; btnAdd.Text = "确定修改"; isadd = videoId; string strmlx = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetVideoId, new object[] { videoId }); DataSet ds = TmoShare.getDataSetFromXML(strmlx); if (TmoShare.DataSetIsNotEmpty(ds)) { if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; txtvideoUrl.Text = dr["video_url"].ToString(); txtvideoName.Text = dr["video_name"].ToString(); } } } else { this.Text = "视频添加"; btnAdd.Text = "确定添加"; isadd = ""; } }
private void btnAdd_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(user_id.Text)) { DXMessageBox.ShowWarning2("证件号不能为空!"); return; } bool idCard = Convert.ToBoolean(TmoServiceClient.InvokeServerMethodT <bool>(funCode.CheckIDCard, user_id.Text)); if (idCard) { DXMessageBox.ShowWarning2("用户ID不存在!"); return; } if (string.IsNullOrWhiteSpace(diary_date.Text)) { DXMessageBox.ShowWarning2("日期不能为空!"); return; } string result = "-2"; string data = diary_date.Text; DataSet ds = TmoShare.getDataSetFromXML(xmlTargetAppend, true); DataRow dr = ds.Tables[0].NewRow(); try { foreach (DevExpress.XtraEditors.PanelControl temp in this.Controls) { foreach (Control det in temp.Controls) { foreach (DataColumn dc in ds.Tables[0].Columns) { if (det.Name == dc.ColumnName) { dr[dc] = det.Text; } } } } } catch { DXMessageBox.ShowError("指标补充失败!", this); } ds.Tables[0].Rows.Add(dr); ds.AcceptChanges(); TmoServiceClient.InvokeServerMethodT <string>(funCode.CreatePointsUser, user_id.Text); result = (TmoServiceClient.InvokeServerMethodT <int>(funCode.AddTargetAppend, TmoShare.getXMLFromDataSet(ds))).ToString(); if (Convert.ToInt16(result) >= 0) { DXMessageBox.Show("指标补充成功!", true); if (this.ParentForm != null) { this.ParentForm.DialogResult = DialogResult.OK; this.ParentForm.Close(); } } else { DXMessageBox.ShowError("指标补充失败!", this); } }
public static string GetPushlist(string xml) { DataSet ds = TmoShare.getDataSetFromXML(xml); DataTable dt = ds.Tables[0]; DataSet ds1 = tmo_userinfoManager.Instance.GetPushlist(dt); return(TmoShare.getXMLFromDataSet(ds1)); }
public static object GetPointsGoodsList(string xml) { DataSet ds = TmoShare.getDataSetFromXML(xml); DataTable dt = ds.Tables[0]; DataSet dts = tmo_points_goodsManager.Instance.GetPointsGoodsList(dt); return(TmoShare.getXMLFromDataSet(dts)); }
public static object GetExpenseDetial(string xml) { DataSet ds = TmoShare.getDataSetFromXML(xml); DataTable dt = ds.Tables[0]; DataSet dts = tmo_pointsManager.Instance.GetExpenseDetial(dt); return(TmoShare.getXMLFromDataSet(dts)); }
public static object GetSellList(string xml) { DataSet ds = TmoShare.getDataSetFromXML(xml); DataTable dt = ds.Tables[0]; DataSet dts = tmo_purchase_sell_stockManager.Instance.GetSellList(dt); return(TmoShare.getXMLFromDataSet(dts)); }
public static object GetRiskData(string xml) { DataSet ds = TmoShare.getDataSetFromXML(xml); DataTable dt = ds.Tables[0]; DataSet dts = tmo_userinfoManager.Instance.GetRiskData(dt); return(TmoShare.getXMLFromDataSet(dts)); }
public static bool OptionalAdd(string xml) { DataSet ds = TmoShare.getDataSetFromXML(xml); DataTable dt = ds.Tables[0]; string docCode = "admin"; return(tmo_web_articleManager.Instance.OptionalAdd(docCode, ds)); }
/// <summary> /// 获取新客户意见 /// </summary> /// <returns></returns> public static object GetNewOpinionData(string xml) { DataSet ds = TmoShare.getDataSetFromXML(xml); DataTable dt = ds.Tables[0]; DataSet dts = tmo_wechat_consultingManager.Instance.GetNewOpinionData(dt); return(TmoShare.getXMLFromDataSet(dts)); }
public static string GetMonitorData24(string xml) { DataSet ds = TmoShare.getDataSetFromXML(xml); DataTable dt = ds.Tables[0]; DataSet dts = tmo_monitorManager.Instance.GetMonitorData24(dt); return(TmoShare.getXMLFromDataSet(dts)); }
/// <summary> /// 获取新延伸服务信息 /// </summary> /// <returns></returns> public static object GetNewServiceData(string xml) { DataSet ds = TmoShare.getDataSetFromXML(xml); DataTable dt = ds.Tables[0]; DataSet dts = tmo_extend_serviceManager.Instance.GetNewServiceData(dt); return(TmoShare.getXMLFromDataSet(dts)); }
/// <summary> /// 加载数据 /// </summary> public void GetData() { this.ShowWaitingPanel(() => { try { string projecttype = ""; string project = ""; if (!string.IsNullOrEmpty("全部类型")) { project = txtproject.Text; } string strmlx = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetProjectDic, new object[] { projecttype, project, "" }); DataSet ds = TmoShare.getDataSetFromXML(strmlx); if (TmoShare.DataSetIsNotEmpty(ds)) { return(ds.Tables[0]); } return(null); } catch { } return(null); }, x => { try { DataTable dt = x as DataTable; // prodiclist.DataSource = dt; //treeListFood.ClearNodes(); //if (treeListFood.Nodes.Count == 0) //{ // treeListFood.AppendNode(new object[] { "膳食分类", "", "", "", "", "", "", "-1", "" }, -1); //} //else //{ // treeListFood.Nodes[0]["Fc_Name"] = "膳食分类"; // treeListFood.Nodes[0]["Fc_Pid"] = "-1"; //} if (dt == null) { return; } FillTree(prodiclist, dt); prodiclist.CollapseAll(); } catch (Exception ex) { LogHelper.Log.Error("实体加载数据出错", ex); DXMessageBox.ShowWarning2("数据加载失败!请重试!"); } }); }
public static void createReport(string userId) { if (string.IsNullOrWhiteSpace(userId)) { return; } DataSet ds = TmoShare.getDataSetFromXML(riskxml, true); if (ds.Tables[0].Rows.Count == 0) { ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); } ds.Tables[0].Rows[0]["user_id"] = userId; string riskDxml = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetTimes, new object[] { userId }); DataSet riskState = TmoShare.getDataSetFromXML(riskDxml); if (riskState != null && riskState.Tables.Count > 0 && riskState.Tables[0] != null && riskState.Tables[0].Rows.Count > 0) { if (riskState.Tables[0].Rows[0] != null && riskState.Tables[0].Rows[0]["isrisk"].ToString() == "1") { ds.Tables[0].Rows[0]["user_time"] = riskState.Tables[0].Rows[0]["user_times"]; string selexml = TmoShare.getXMLFromDataSet(ds); string strmlx = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetRiskData, new object[] { selexml }); ds = TmoShare.getDataSetFromXML(strmlx); string c = CreateReport.pphase_Result(ds.Tables[0], ds.Tables[1], "1"); if (c == "1") { DXMessageBox.ShowWarning2("生成评估数据成功,请到输出报告查看!"); } else if (c == "2") { DXMessageBox.ShowWarning2("生成评估数据失败"); } else { DXMessageBox.ShowSuccess("恭喜您,您的身体非常健康\r\n我们暂时无法给你出报告!"); } } else if (riskState.Tables[0].Rows[0] != null && riskState.Tables[0].Rows[0]["isrisk"].ToString() == "2") { DXMessageBox.ShowWarning2("已经评估过!"); } else { DXMessageBox.ShowWarning2("问卷处于暂存状态,请填写完成问卷!"); } } else { DXMessageBox.ShowWarning2("暂时不能评估"); } }
/// <summary> /// 执行服务端远程接口方法 /// </summary> /// <param name="ip">服务器ip地址</param> /// <param name="port">服务器Port</param> /// <param name="funCode">方法编号</param> /// <param name="funParams">方法参数</param> /// <returns></returns> public static T InvokeServerMethodT <T>(string ip, int port, funCode funCode, params object[] funParams) { T retT = default(T); try { string result = InvokeServerMethod(ip, port, funCode, funParams); if (result != null && result.StartsWith("err_")) { throw new Exception(result); } if (typeof(T) == typeof(DataSet)) { if (!string.IsNullOrWhiteSpace(result)) { result = JsonConvert.DeserializeObject <string>(result); DataSet ds = TmoShare.getDataSetFromXML(result); if (ds != null) { retT = (T)(object)ds; } else { throw new Exception("返回结果非DataSet格式:" + result); } } } else if (typeof(T) == typeof(DataTable)) { if (!string.IsNullOrWhiteSpace(result)) { result = JsonConvert.DeserializeObject <string>(result); DataTable dt = TmoShare.getDataTableFromXML(result); if (dt != null) { retT = (T)(object)dt; } else { throw new Exception("返回结果非DataTable格式:" + result); } } } else { retT = JsonConvert.DeserializeObject <T>(result); } } catch (Exception ex) { LogHelper.Log.Error("InvokeServerMethodT<T>错误 funCode:" + funCode, ex); } return(retT); }
public void GetData() { this.ShowWaitingPanel(() => { try { DsQueryXml = TmoShare.getDataSetFromXML(SubmitXml, true); if (DsQueryXml.Tables[0].Rows.Count == 0) { DsQueryXml.Tables[0].Rows.Add(DsQueryXml.Tables[0].NewRow()); } DsQueryXml.Tables[0].Rows[0]["page_size"] = _pageSize.ToString(); DsQueryXml.Tables[0].Rows[0]["now_page"] = _currentPage.ToString(); DsQueryXml.Tables[0].Rows[0]["user_id"] = _uid; DsQueryXml.Tables[0].Rows[0]["mt_code"] = _dicCode; string dd = nurtype.EditValue.ToString(); string sqlWhere = "and a.mt_time>='" + this.startTime.EditValue + "'" + " and a.mt_time<='" + this.endDate.EditValue + "'"; DsQueryXml.Tables[0].Rows[0]["mt_time"] = sqlWhere; string selexml = TmoShare.getXMLFromDataSet(DsQueryXml); string strmlx = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetMonitorDataBy, new object[] { selexml }); _dsGetDataResult = TmoShare.getDataSetFromXML(strmlx); if (TmoShare.DataSetIsNotEmpty(_dsGetDataResult)) { return(_dsGetDataResult.Tables[1]); } else { return(null); } } catch { } return(null); }, x => { try { var dt = x as DataTable; if (_dicCode != "99") { SetContorl(dt, _dicNamevalue); } else { SetXueYaContorl(dt); } } catch (Exception ex) { } }); }
/// <summary> /// 加载数据 /// </summary> public void GetData() { this.ShowWaitingPanel(() => { try { string projecttype = ""; string project = ""; if (this.cmproType.Text != "全部类型") { projecttype = cmproType.Text; } if (!string.IsNullOrEmpty(txtproject.Text)) { project = txtproject.Text; } string strmlx = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetProjectDic, new object[] { projecttype, project, "" }); DataSet ds = TmoShare.getDataSetFromXML(strmlx); if (TmoShare.DataSetIsNotEmpty(ds)) { return(ds.Tables[0]); } return(null); } catch { } return(null); }, x => { try { DataTable dt = x as DataTable; dgcTree.DataSource = dt; if (gridView1.GroupCount > 0) { gridView1.ExpandAllGroups(); } gridView1.MoveFirst(); if (dt == null) { return; } } catch (Exception ex) { LogHelper.Log.Error("实体加载数据出错", ex); DXMessageBox.ShowWarning2("数据加载失败!请重试!"); } }); }
public bool SendEmail(string emailXML, out string err_tip) { #region 参数处理 err_tip = null; if (string.IsNullOrWhiteSpace(emailXML)) { err_tip = "传入参数为空"; return(false); } var ds = TmoShare.getDataSetFromXML(emailXML); if (ds == null) { err_tip = "传入参数非DataSet格式"; return(false); } if (TmoShare.DataSetIsEmpty(ds)) { err_tip = "传入DataSet数据为空"; return(false); } #endregion var dr = ds.Tables[0].Rows[0]; string user_code = dr.GetDataRowStringValue("user_code"); string sendaccount = dr.GetDataRowStringValue("sendaccount"); string sendEmail = EmailHelper.Instance.MailFrom; string sendToaccount = dr.GetDataRowStringValue("sendToaccount"); string sendcontent = dr.GetDataRowStringValue("sendcontent"); string sendtitle = dr.GetDataRowStringValue("sendtitle"); string sendtype = dr.GetDataRowStringValue("sendtype"); string doc_code = dr.GetDataRowStringValue("doc_code"); //发送邮件 bool sendsuc = EmailHelper.Instance.SendMail(sendtitle, sendcontent, sendaccount, sendToaccount, out err_tip); if (sendsuc) { string sql = "insert into tmo_sendemail(user_code,sendaccount,sendEmail,sendToaccount,sendcontent,sendtitle,sendtype,doc_code,input_time) values" + String.Format("('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}',sysdate())", user_code, sendaccount, sendEmail, sendToaccount, sendcontent, sendtitle, sendtype, doc_code); int n = MySQLHelper.ExecuteSql(sql); if (n < 1) { err_tip = "发送邮件成功,但保存记录失败"; } return(true); } return(false); }
public void SetControl(DataRowView drView) { string nurXml = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetnurtypeItem, new object[] { "" }); DataSet nurDs = TmoShare.getDataSetFromXML(nurXml); if (TmoShare.DataSetIsNotEmpty(nurDs)) { foreach (DataRow row in nurDs.Tables[0].Rows) { var item = new ImageComboBoxItem { Description = row["nurtype"].ToString(), Value = row["id"].ToString() }; nurtype.Properties.Items.Add(item); } if (drView["nurtype"] != null && drView["nurtype"].ToString() != "") { nurtype.SelectItemByDescription(drView["nurtype"].ToString()); } else { nurtype.SelectedIndex = 0; } } string hotXml = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetHotDic, new object[] { "" }); DataSet hotDs = TmoShare.getDataSetFromXML(hotXml); if (TmoShare.DataSetIsNotEmpty(hotDs)) { foreach (DataRow row in hotDs.Tables[0].Rows) { var item = new ImageComboBoxItem { Description = row["hotvalue"].ToString(), Value = row["id"].ToString() }; hottype.Properties.Items.Add(item); } if (drView["hotvalue"] != null && drView["hotvalue"].ToString() != "") { hottype.SelectItemByDescription(drView["hotvalue"].ToString()); } else { hottype.SelectedIndex = 0; } } }
public void GetData() { this.ShowWaitingPanel(() => { try { _pageSize = 1; DsQueryXml = TmoShare.getDataSetFromXML(SubmitXml, true); if (DsQueryXml.Tables[0].Rows.Count == 0) { DsQueryXml.Tables[0].Rows.Add(DsQueryXml.Tables[0].NewRow()); } DsQueryXml.Tables[0].Rows[0]["page_size"] = _pageSize.ToString(); DsQueryXml.Tables[0].Rows[0]["now_page"] = _currentPage.ToString(); DsQueryXml.Tables[0].Rows[0]["user_id"] = _uid; DsQueryXml.Tables[0].Rows[0]["mt_code"] = _dicCode; DsQueryXml.Tables[0].Rows[0]["mt_time"] = Convert.ToDateTime(this.dateEdit1.EditValue).ToString("yyyy-MM-dd 00:00:00"); string selexml = TmoShare.getXMLFromDataSet(DsQueryXml); string strmlx = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetMonitorData24, new object[] { selexml }); _dsGetDataResult = TmoShare.getDataSetFromXML(strmlx); if (TmoShare.DataSetIsNotEmpty(_dsGetDataResult)) { DataTable dtCount = _dsGetDataResult.Tables["Count"]; _count = dtCount.Rows[0]["totalRowCount"].ToString(); double countnum = double.Parse(_count) / _pageSize; _pageCount = Math.Ceiling(countnum).ToString(); return(_dsGetDataResult.Tables[1]); } else { return(null); } } catch { } return(null); }, x => { try { var dt = x as DataTable; SetContorl(dt, _dicNamevalue); } catch (Exception ex) { } }); }
public bool SendSms(string smsXML, out string err_tip, out int rt_code) { #region 参数处理 err_tip = null; rt_code = -99; if (string.IsNullOrWhiteSpace(smsXML)) { err_tip = "传入参数为空"; return(false); } var ds = TmoShare.getDataSetFromXML(smsXML); if (ds == null) { err_tip = "传入参数非DataSet格式"; return(false); } if (TmoShare.DataSetIsEmpty(ds)) { err_tip = "传入DataSet数据为空"; return(false); } #endregion var dr = ds.Tables[0].Rows[0]; string user_code = dr.GetDataRowStringValue("user_code"); string mobile = dr.GetDataRowStringValue("mobile"); string message = dr.GetDataRowStringValue("message"); string type = dr.GetDataRowStringValue("type"); string doc_code = dr.GetDataRowStringValue("doc_code"); //发送短信 bool sendsuc = SMSHelper.Instance.SendSms(mobile, message, out err_tip, out rt_code); if (sendsuc) { string sql = "insert into tmo_sendsms(user_code,mobile,message,type,doc_code,input_time) values" + String.Format("('{0}','{1}','{2}','{3}','{4}',sysdate())", user_code, mobile, message, type, doc_code); int n = MySQLHelper.ExecuteSql(sql); if (n < 1) { err_tip = "发送短信成功,但保存记录失败"; } return(true); } return(false); }
void okbtn_Click(object sender, EventArgs e) { bool answer = TmoServiceClient.InvokeServerMethodT <bool>(funCode.AddReply, new object[] { advise_id.Text, answer_content.Text, doc_code.Text }); if (answer) { string openid = weid.Text; string data = @"<data> <first> <value></value> <color></color> </first> <keyword1> <value></value> <color></color> </keyword1> <keyword2> <value></value> <color></color> </keyword2> <remark> <value></value> <color></color> </remark> </data>"; DataSet ds = TmoShare.getDataSetFromXML(data); ds.Tables["first"].Rows[0]["value"] = "尊敬的用户,您提出的问题有了新的回复:"; ds.Tables["first"].Rows[0]["color"] = TmoShare.RGBToWebColor(Color.Gray); ds.Tables["keyword1"].Rows[0]["value"] = advise_content.Text; ds.Tables["keyword1"].Rows[0]["color"] = TmoShare.RGBToWebColor(Color.Gray); ds.Tables["keyword2"].Rows[0]["value"] = answer_content.Text; ds.Tables["keyword2"].Rows[0]["color"] = TmoShare.RGBToWebColor(Color.Gray); ds.Tables["remark"].Rows[0]["value"] = "感谢您的使用!"; ds.Tables["remark"].Rows[0]["color"] = TmoShare.RGBToWebColor(Color.Gray); string content = TmoCommon.TmoShare.GetXml_NO_TITLE(ds); string templateID = ConfigHelper.GetConfigString("WX_TEMPLATE_RSID"); string err_tip = WeChatHelper.WXTemplateMsgSend(new object[] { "admin", openid, templateID, "", TmoShare.RGBToWebColor(Color.Green), content }); this.DialogResult = DialogResult.OK; DXMessageBox.Show("回复成功!", true); } else { DXMessageBox.Show("回复失败!", true); } }