public string Action_Get_RelationsSearch(string value, AppLoader existedLoader) { string sql = "select * from profile_students where uid = '" + value + "' or nickname like '%" + value + "%'"; DataTable dtData = existedLoader.ExecuteSQL(Global.GlobalDefines.DB_KEY_IKCODER_BASIC, sql); return(MessageHelper.TransDatatableToXML(dtData)); }
public string Action_Get_RelationsAcceptableList(string token, AppLoader existedLoader) { try { Global.ItemAccountStudents activeItem = Global.LoginServices.Pull(token); string sql = "select * from relations_students where suname='" + activeItem.name + "' and isacc='0'"; DataTable dtData = existedLoader.ExecuteSQL(Global.GlobalDefines.DB_KEY_IKCODER_BASIC, sql); return(Data_dbDataHelper.ActionConvertDTtoXMLString(dtData)); } catch (Exception err) { return(err.Message + "|" + err.StackTrace); } }
public string Action_Get_BatchArrProfile(List <string> lstID, AppLoader existedLoader) { StringBuilder sql = new StringBuilder(); sql.Append("select * from profile_students where uid in ("); for (int i = 1; i <= lstID.Count; i++) { if (i == lstID.Count) { sql.Append("'" + lstID[i - 1] + "'"); } else { sql.Append("'" + lstID[i - 1] + "',"); } } sql.Append(")"); DataTable dtData = existedLoader.ExecuteSQL(Global.GlobalDefines.DB_KEY_IKCODER_BASIC, sql.ToString()); return(MessageHelper.TransDatatableToXML(dtData)); }
public string Action_Get_DialogList(string uid, AppLoader existedLoader) { string query_sql = "SELECT * FROM ikcoder_basic.messagesindex_students where symbol in (select symbol from ikcoder_basic.messagesindex_students where uid = '" + uid + "')"; DataTable activeDataTable = existedLoader.ExecuteSQL(Global.GlobalDefines.DB_KEY_IKCODER_BASIC, query_sql); if (activeDataTable == null) { return("<root type='error'><errmsg>nodata</errmsg></root>"); } else { XmlDocument returnDoc = new XmlDocument(); returnDoc.LoadXml("<root></root>"); XmlNode rootNode = returnDoc.SelectSingleNode("/root"); int uid_index = 1; foreach (DataRow activeRow in activeDataTable.Rows) { string strSymbol = string.Empty; Data_dbDataHelper.GetColumnData(activeRow, "symbol", out strSymbol); string uid_fromdb = string.Empty; Data_dbDataHelper.GetColumnData(activeRow, "uid", out uid_fromdb); if (uid == uid_fromdb) { continue; } XmlNode itemNode = returnDoc.SelectSingleNode("/root/item[@symbol='" + strSymbol + "']"); if (itemNode == null) { itemNode = Util_XmlOperHelper.CreateNode(returnDoc, "item", ""); rootNode.AppendChild(itemNode); } Util_XmlOperHelper.SetAttribute(itemNode, "uid", uid_fromdb); Util_XmlOperHelper.SetAttribute(itemNode, "symbol", strSymbol); Util_XmlOperHelper.SetAttribute(itemNode, "index", uid_index.ToString()); uid_index++; } return(returnDoc.OuterXml.ToString()); } }