/// <summary> /// 获取所有品牌 /// </summary> /// <returns></returns> public DataTable GetAllBrand() { dh.Open(); DataTable dt = dh.GetDataTable(CommandType.Text, SelectBrand + OrderCondition1, null); dh.Close(); return(dt); }
/// <summary> /// 获取所有省 /// </summary> /// <returns></returns> public DataTable GetAllProvince() { dh.Open(); DataTable dt = dh.GetDataTable(CommandType.Text, "Select ID,code,name from province order by ID asc", null); dh.Close(); return(dt); }
/// <summary> /// 获取所有节点 /// </summary> /// <returns></returns> public DataTable GetAllNode() { dh.Open(); DataTable dt = dh.GetDataTable(CommandType.Text, SelectNodes + "order by "+OrderCondition1, null); dh.Close(); return dt; }
public DataTable GetInfoByNode(int NodeID, ArrayList FiledName, ArrayList FiledValues, int includechild, string OrderCondition, int startid, int endid) { string sbCondition = string.Empty; sbCondition = CommOperate.SelectCondition(FiledName, FiledValues); string cmdtxt = string.Empty; string orderbystring = string.Empty;//排序字符串 if (OrderCondition == "") { orderbystring = " order by a.SortID desc,InfoID desc "; } else { orderbystring = " order by " + OrderCondition + " "; } if (NodeID == 0) { cmdtxt = "select * from (select InfoID,InfoTitle,InfoSubMemo,InfoMemo,InfoPic, InfoType,a.SortID,IsRecom,InfoCateID,InfoAdder,InfoAddTime,IsCheck,row_number() over (" + orderbystring + ") as rowno,Admin_RealName from T_InfoList a left join T_Admin b on a.InfoAdder=b.Admin_ID where 1=1 and a.IsDelete=0 " + sbCondition + " ) as row where rowno between " + startid + " and " + endid.ToString() + " order by SortID desc,InfoID desc "; } else { if (includechild != 0)//包含子节点 { NodeOperate nop = new NodeOperate(); ArrayList childlist = nop.GetAllChildNode(NodeID); string childstring = string.Empty;//子节点列表 for (int i = 0; i < childlist.Count; i++) { childstring += childlist[i].ToString() + ","; } childstring = childstring.Substring(0, childstring.Length - 1); cmdtxt = "select * from (select InfoID,InfoTitle,InfoSubMemo,InfoMemo,InfoPic, InfoType,a.SortID,IsRecom,InfoCateID,InfoAdder,InfoAddTime,IsCheck,row_number() over (" + orderbystring + ") as rowno ,Admin_RealName from T_InfoList a left join T_Admin b on a.InfoAdder=b.Admin_ID where 1=1 and a.IsDelete=0 and InfoCateID in (" + childstring + ") " + sbCondition + " ) as row where rowno between " + startid + " and " + endid.ToString() + " order by SortID desc,InfoID desc "; } else { cmdtxt = "select * from (select InfoID,InfoTitle,InfoSubMemo,InfoMemo,InfoPic, InfoType,a.SortID,IsRecom,InfoCateID,InfoAdder,InfoAddTime,IsCheck,row_number() over (" + orderbystring + ") as rowno,Admin_RealName from T_InfoList a left join T_Admin b on a.InfoAdder=b.Admin_ID where 1=1 and a.IsDelete=0 and InfoCateID = " + NodeID.ToString() + " " + sbCondition + " ) as row where rowno between " + startid + " and " + endid.ToString() + " order by SortID asc,InfoID desc "; } } DataTable dt; dh.Open(); dh.BeginTrans(); dt = dh.GetDataTable(CommandType.Text, cmdtxt, null); dh.CommitTrans(); dh.Close(); return(dt); }
/// <summary> /// 获取管理员的datatable /// </summary> /// <param name="FiledName"></param> /// <param name="FiledValue"></param> /// <param name="startid"></param> /// <param name="endid"></param> /// <returns></returns> public DataTable GetAdminByCondition(ArrayList FiledName, ArrayList FiledValue, int startid, int endid) { string sbCondition = string.Empty; sbCondition = CommOperate.SelectCondition(FiledName, FiledValue); string cmdtxt = string.Empty; string orderbystring = " order by SortID asc,Admin_ID desc ";//排序字符串 cmdtxt = "select * from (select Admin_ID,Admin_UID,Admin_Stat,Admin_RealName,Admin_RegTime,Admin_LogTimes,Admin_Flag,SortID,row_number() over (" + orderbystring + ") as rowno from T_Admin where 1=1 and IsDelete=0 " + sbCondition + " ) as row where rowno between " + startid + " and " + endid.ToString() + orderbystring; dh.Open(); dh.BeginTrans(); DataTable dt = dh.GetDataTable(CommandType.Text, cmdtxt, null); dh.CommitTrans(); dh.Close(); return(dt); }