예제 #1
0
        /// <summary>
        /// 查询显示用户信息
        /// </summary>
        /// <param name="coll">传入参数</param>
        /// <returns>视图</returns>
        public ActionResult LibrayMgr(FormCollection coll)
        {
            this.trackID = TrackIdManager.GetInstance("shaoyu");
            List <DisplayInfo> displayInfolist = new List <DisplayInfo>();
            List <Bookinfo>    bookinfoList    = new List <Bookinfo>();

            try
            {
                // 初始信息
                if (coll.Count == 0)
                {
                    QueryAllBook queryAllBook = new QueryAllBook();
                    displayInfolist = queryAllBook.GetAllBookInfo();
                }
                else if (coll.Count > 0)
                {
                    // 查询信息
                    if (Request.IsAjaxRequest())
                    {
                        string     bookname   = coll["bookname"] != null ? coll["bookname"].Trim() : string.Empty;
                        DisplayMgr displayMgr = new DisplayMgr();

                        // 模糊查询
                        displayInfolist = displayMgr.QueryByName(bookname);
                        return(this.PartialView("BookList", displayInfolist));
                    }
                }
            }
            catch (AppException appexp)
            {
                return(this.View("Shared/Error", appexp.ToString()));
            }
            catch (Exception exp)
            {
                AppException appexp = new AppException(" 查询显示用户信息 ", exp, ExceptionLevel.Error);
                LogManager.Log.WriteException(appexp);
                return(this.View("Shared/Error", exp.ToString()));
            }
            finally
            {
                LogManager.Log.WriteUiAcc("shaoyu", "UserInfo", "shaoyu", "127.0.0.1", string.Empty, string.Empty, "查询显示用户信息", null);
            }

            return(this.View(displayInfolist));
        }
예제 #2
0
        static void Main(string[] args)
        {
            // 全部查询
            DisplayMgr         DisplayMgr   = new DisplayMgr();
            List <DisplayInfo> displaylist1 = new List <DisplayInfo>();

            displaylist1 = DisplayMgr.GetDisplayinfo();

            // 模糊查询

            List <DisplayInfo> displaylist2 = new List <DisplayInfo>();

            displaylist2 = DisplayMgr.QueryByName("英语");


            // 借书
            Guid          orderid       = new Guid("B24B5470-755E-4EB5-8AE8-00116B0355F6");
            string        name          = "张三";
            BorrowBookMgr BorrowBookMgr = new BorrowBookMgr(name, orderid);

            BorrowBookMgr.Execute();
            Console.ReadLine();
        }