예제 #1
0
        public static string insert(string name)
        {
            //insert
            LOAiSP l = new LOAiSP();

            l.TenLoai = name;
            return("success" + LOAiSP.insert(l));;
        }
예제 #2
0
        public static LOAiSP[] search(string name)
        {
            DataTable     dt = LOAiSP.search(name);
            List <LOAiSP> ls = new List <LOAiSP>();

            foreach (DataRow r in dt.Rows)
            {
                LOAiSP l = new LOAiSP();
                l.MaL     = Convert.ToInt32(r["MaL"]);
                l.TenLoai = r["TenLoai"].ToString();
                ls.Add(l);
            }
            return(ls.ToArray());
        }
예제 #3
0
        public static LOAiSP[] Paging()
        {
            DataTable dt             = LOAiSP.getList();
            int       so_item_1trang = 3;
            int       so_trang       = dt.Rows.Count / so_item_1trang + (dt.Rows.Count % so_item_1trang == 0 ? 0 : 1);
            int       page           = 0;
            //int page = 0;
            int from = (page - 1) * 3;
            int to   = page * 3 - 1;


            List <LOAiSP> ls = new List <LOAiSP>();

            foreach (DataRow r in dt.Rows)
            {
                LOAiSP l = new LOAiSP();
                l.MaL     = Convert.ToInt32(r["MaL"]);
                l.TenLoai = r["TenLoai"].ToString();
                ls.Add(l);
            }
            return(ls.ToArray());
        }