示例#1
0
        //public static DataTable FindBook(string bookId)
        //{
        //    return Controller.FindBook(string.Format("where Book.Id ={0}", bookId));
        //}

        //public static DataTable FindBook(string bookName, string category)
        //{
        //    string where = "";
        //    if (bookName != "")
        //    {
        //        where += string.Format("BookTitle.Name ='{0}'", bookName);
        //    }
        //    if (category != "")
        //    {
        //        if (where != "")
        //        {
        //            where += " and ";
        //        }
        //        where += string.Format("Category.ID = {0}", category);
        //    }
        //    if (where != "")
        //        where = where.Insert(0, "Where ");
        //    return Controller.FindBook(where);
        //}
        //public static bool GetByBookId(string bookId)

        //{
        //    DataTable dt = Controller.GetByBookId(bookId);
        //    int number;
        //    int.TryParse(dt.Rows[0]["Count"].ToString(), out number);
        //    if (number > 0)
        //        return true;
        //    return false;
        //}

        //public static DataRow GetBookId(BookInfo info)
        //{
        //    var dt = Controller.GetByPublisherPublishYear(info.Publisher, info.PublishYear);
        //    //var dt = Controller.GetByTop("",
        //    //    string.Format("Publisher = N'{0}' and PublishYear = {1}", info.Publisher, info.PublishYear), "");
        //    if (dt.Rows.Count == 0)
        //    {
        //        return !Controller.Insert(info) ? null : Controller.GetByLast();
        //    }

        //    return dt.Rows[0];
        //}

        public static DataTable GetById(string id)
        {
            return(Controller.GetById(id));
        }