Beispiel #1
0
        /// <summary>
        /// 借书页面Ajax 提交
        /// </summary>
        /// <param name="coll">参数</param>
        /// <returns>借书页面</returns>
        public string AjaxBorrowBook(FormCollection coll)
        {
            string result = string.Empty;

            try
            {
                string ispaied      = coll["IsPaied"] != null ? coll["IsPaied"].Trim() : string.Empty;
                string orderNumguid = coll["bookid"] != null ? coll["bookid"].Trim() : string.Empty;
                string bookman      = coll["name"] != null ? coll["name"].Trim() : string.Empty;
                Guid   orderid      = new Guid();
                if (Guid.TryParse(orderNumguid, out orderid))
                {
                    if (!string.IsNullOrEmpty(bookman))
                    {
                        switch (ispaied)
                        {
                        case "1":

                            // 付款并借书,付款失败不能借书
                            PayMoneyAndBorrowMgr payMoneyAndBorrowMgr = new PayMoneyAndBorrowMgr(bookman, orderid);
                            payMoneyAndBorrowMgr.Execute();
                            break;

                        case "0":
                            BorrowBookMgr borrowBookMgr = new BorrowBookMgr(bookman, orderid);
                            borrowBookMgr.Execute();
                            break;
                        }
                    }
                }
                else
                {
                    result = "图书条形码不符合规则";
                }
            }
            catch (AppException exp)
            {
                result = exp.Message;
            }
            catch (Exception exp)
            {
                result = exp.Message;
            }
            finally
            {
                LogManager.Log.WriteUiAcc("shaoyu", "AjaxBorrowBook", "shaoyu", "127.0.0.1", string.Empty, string.Empty, "借书页面Ajax 提交", null);
            }

            return(result);
        }
Beispiel #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();
        }