Example #1
0
    public static List <St_TTimuDaXue> getList(string sc, string kemuId, string leimu, string seq, string readType, int top, ref AFDictionary <string, int> dic1)
    {
        AFDictionary <string, St_TTimuDaXue> dicLeimu1 = BLL1.GetDic(sc, kemuId, leimu, ref dic1);

        int index1 = 0;

        if (dic1.ContainsKey(seq))
        {
            index1 = dic1[seq];
        }
        if (index1 < 0)
        {
            index1 = 0;
        }
        if (top == 0)
        {
            top = 50;
        }
        List <St_TTimuDaXue> list1 = new List <St_TTimuDaXue>();

        list1.AddRange(dicLeimu1.Values);

        if (list1.Count > 0)
        {
            List <St_TTimuDaXue> list2 = new List <St_TTimuDaXue>();
            if ((string.IsNullOrEmpty(readType) || readType == "0") && list1.Count > 0)
            {
                St_TTimuDaXue[] list3 = new St_TTimuDaXue[top];
                list1.CopyTo(index1, list3, 0, top);
                list2.AddRange(list3);
                return(list2);
            }
            else
            {
                int index2 = index1 - top;
                if (index2 < 0)
                {
                    index2 = 0;
                }
                St_TTimuDaXue[] list3 = new St_TTimuDaXue[top];
                list1.CopyTo(index2, list3, 0, top);
                list2.AddRange(list3);
                return(list2);
            }
        }
        return(list1);
    }
Example #2
0
    public static AFDictionary <string, St_TTimuDaXue> GetDic(string sc, string kemuId, string leimu, ref AFDictionary <string, int> dic2)
    {
        AFDictionary <string, St_TTimuDaXue> dic1 = new AFDictionary <string, St_TTimuDaXue>();

        if (string.IsNullOrEmpty(leimu))
        {
            leimu = "0";
        }
        dic1 = BLL1.GetDic(sc, kemuId, Convert.ToInt32(leimu), ref dic2);

        if (dic1.Count == 0)
        {
            sc   = "194";
            dic1 = BLL1.GetDic(sc, kemuId, Convert.ToInt32(leimu), ref dic2);
        }
        return(dic1);
    }