/// <summary> /// 功能说明:获取民族表信息 /// 开发人员:lzchina /// 创建时间:2011-12-1 14:33 /// </summary> /// <returns></returns> public DataSet GetWellDicNationality() { string strSQL = "select code,name from tmo_nationality"; DataSet ds = MySQLHelper.Query(strSQL); return(TmoShare.DataSetVerify(ds)); }
/// <summary> /// 功能说明:获取省级信息 /// 开发人员:lzchina /// 创建时间:2011-12-1 14:35 /// </summary> /// <returns></returns> public DataSet GetWellProvincecode() { string strSQL = "select concat(zimu,'-',province_name) as province_name,province_id from tmo_provincecode order by province_name"; DataSet ds = MySQLHelper.Query(strSQL); return(TmoShare.DataSetVerify(ds)); }
/// <summary> /// 功能说明:返回教育程序 /// 开发人员:lzchina /// 创建时间:2011-12-20 16:05 /// </summary> /// <returns></returns> public DataSet GetWellEducation() { string strSQL = "select code,name from tmo_education"; DataSet ds = MySQLHelper.Query(strSQL); return(TmoShare.DataSetVerify(ds)); }
{ /// <summary> /// 功能说明:获取婚姻表信息 /// 开发人员:lzchina /// 创建时间:2011-12-1 14:25 /// </summary> /// <returns></returns> public DataSet GetWellDicMarital() { string strSQL = "select code,name from tmo_marital"; DataSet ds = MySQLHelper.Query(strSQL); return(TmoShare.DataSetVerify(ds)); }
/// <summary> /// 功能说明:根据省级ID返回相应的市级信息 /// 开发人员:lzchina /// 创建时间:2011-12-1 14:46 /// </summary> /// <param name="province_id">The province_id.</param> /// <returns></returns> public DataSet GetWellCityCode(string province_id) { string strSQL = ""; strSQL = province_id == "" ? "select concat(zimu,'-',city_name) as city_name,city_id,province_id from well_citycode order by city_name" : string.Format("select concat(zimu,'-',city_name) as city_name,city_id,province_id from tmo_citycode where province_id='{0}' order by city_name", province_id); DataSet ds = MySQLHelper.Query(strSQL); return(TmoShare.DataSetVerify(ds)); }
/// <summary> /// 功能说明:根据市级ID返回相应的区县信息 /// 开发人员:lzchina /// 创建时间:2011-12-1 14:49 /// </summary> /// <param name="city_id">The city_id.</param> /// <returns></returns> public DataSet GetWellAreaCode(string city_id) { string strSQL = ""; strSQL = city_id == "" ? "select concat(zimu,'-',area_name) as area_name,area_id,city_id from well_areacode order by area_name" : string.Format("select concat(zimu,'-',area_name) as area_name,area_id,city_id from tmo_areacode where city_id='{0}' order by area_name", city_id); DataSet ds = MySQLHelper.Query(strSQL); return(TmoShare.DataSetVerify(ds)); }
/// <summary> /// 根据传过来参数获取数据 /// </summary> /// <param name="getdataEntityParams"></param> /// <returns></returns> public DataTable GetData(string getdataEntityParams) { List <string> list = StringPlus.GetStrArray(getdataEntityParams, "_;_"); string entityName = list[0]; string colums = list[1]; string rowStart = list[2]; string rowEnd = list[3]; string pkName = list[4]; string pkValue = list[5]; string where = list[6]; string order = list[7]; StringBuilder sbSql = new StringBuilder(); if (string.IsNullOrWhiteSpace(entityName)) { return(null); } if (string.IsNullOrWhiteSpace(colums) || colums == "*") { colums = "*"; } DataTable dtStruct = GetTableStruct(entityName); if (dtStruct == null) { return(null); } bool falseDel = dtStruct.Columns.Contains("is_del"); if (falseDel) { where += (string.IsNullOrWhiteSpace(where) ? "" : " and") + " (is_del!='1' or is_del is null)"; } sbSql.AppendFormat("select {0} from {1}", colums, entityName); if (!string.IsNullOrWhiteSpace(pkName) && !string.IsNullOrWhiteSpace(pkValue)) { if (string.IsNullOrWhiteSpace(where)) { sbSql.AppendFormat(" where {0}='{1}'", pkName, pkValue); } else { sbSql.AppendFormat(" where {0} and {1}='{2}'", where, pkName, pkValue); } } else { if (!string.IsNullOrWhiteSpace(where)) { sbSql.AppendFormat(" where {0}", where); } } if (!string.IsNullOrWhiteSpace(order)) { sbSql.AppendFormat(" order by {0}", order); } if (rowStart != "-1" && rowEnd != "-1") { sbSql.AppendFormat(" limit {0},{1}", rowStart, rowEnd); } DataSet ds = MySQLHelper.Query(sbSql.ToString()); ds = TmoShare.DataSetVerify(ds); if (ds != null) { return(ds.Tables[0].Copy()); } else { return(null); } }
public DataSet GetWAsBypage(string strInfo) { DataSet dsResult = null; DataSet ds = TmoShare.getDataSetFromXML(strInfo); if (ds == null || ds.Tables.Count < 0 || ds.Tables[0] == null) { return(null); } DataRow drXml = ds.Tables[0].Rows[0]; int page_size = Convert.ToInt32(drXml["page_size"].ToString()); int now_page = Convert.ToInt32(drXml["now_page"].ToString()); string doc_code = drXml["doc_code"].ToString(); string user_code = drXml["user_code"].ToString(); StringBuilder sqlCol = new StringBuilder(); sqlCol.Append("SELECT '查看' as 'read','删除'as del, '回复'as answer, r.user_code as user_code, r.gender as gender,r.name as name, w.doc_code,w.message_content,w.input_time," + " CASE w.is_look WHEN '1' THEN '已查看' WHEN '2' THEN '未查看' ELSE '未查看' END as look_state," + " CASE w.is_answer WHEN '1' THEN '已回复' WHEN '2' THEN '未回复' ELSE '未回复' END as answer_state," + "w.wm_id,w.r_mark,a.content,a.awm_id, w.token_open_id,a.input_time as as_time,w.wx_type,w.media_id,w.picturedata,w.format, CASE w.doc_code WHEN 'admin' THEN '管理员' ELSE d.name END as doc_r_name from "); StringBuilder sqlBody = new StringBuilder(); //张兴 2014-1-14 sqlBody.Append(" Tmo_weixin_content as w "); sqlBody.Append("left join tmo_reg_userinfo_token rt on rt.reg_login_token = w.token_open_id "); sqlBody.Append("left join tmo_reg_userinfo r on r.user_code = rt.user_code "); sqlBody.Append("left join tmo_weixin_answer a on a.wm_id =w.wm_id "); sqlBody.Append("left join tmo_doc_userinfo d on d.doc_code =r.doc_code "); sqlBody.Append("left join tmo_user_type typ on r.user_type = typ.type_id "); sqlBody.Append("WHERE "); sqlBody.Append(" w.is_del=1 "); if (!string.IsNullOrEmpty(user_code)) { sqlBody.Append(" and r.user_code = '" + user_code + "'"); } if (drXml["medical_code"].ToString() != "") { sqlBody.Append(" and r.medical_code = '" + drXml["medical_code"].ToString() + "'"); } if (drXml["name"].ToString() != "") { sqlBody.Append(" and r.name like '%" + drXml["name"].ToString() + "%' "); } if (drXml["user_type"].ToString() != "") { sqlBody.Append(" and r.user_type = '" + drXml["user_type"].ToString() + "'"); } if (drXml["doc_code"].ToString() != "" && drXml["doc_code"].ToString().ToLower() != "admin") { sqlBody.Append(" and r.doc_code = '" + drXml["doc_code"].ToString() + "'"); } if (drXml["answer_state"].ToString() != "") { sqlBody.Append(" and w.is_answer = '" + drXml["answer_state"].ToString() + "'"); } if (drXml["question_time_from"].ToString() != "") { sqlBody.Append(" and w.input_time > '" + drXml["question_time_from"].ToString() + "'"); sqlBody.Append(" and w.input_time < '" + drXml["question_time_end"].ToString() + "'"); } if (drXml["answer_time_from"].ToString() != "") { sqlBody.Append(" and a.input_time > '" + drXml["answer_time_from"].ToString() + "'"); sqlBody.Append(" and a.input_time < '" + drXml["answer_time_end"].ToString() + "'"); } dsResult = tmoCommonDal.GetPagingData(sqlCol, sqlBody, "order by w.input_time desc,w.wm_id desc,a.input_time desc", page_size, now_page); return(TmoShare.DataSetVerify(dsResult)); }