コード例 #1
0
ファイル: orderapi.ashx.cs プロジェクト: shaojixing/MakaCake
        private void AddOrder(HttpContext context)
        {
            OrderBll bll           = new OrderBll();
            string   card_birthday = context.Request["card_birthday"];
            string   paytype       = context.Request["paytype"];
            string   remark        = context.Request["remark"];
            string   bastdate      = context.Request["bastdate"];



            if (bll.AddOrderByUserId(card_birthday, bastdate, paytype, remark))
            {
                context.Response.Write("sucess");
            }


            else
            {
                context.Response.Write("fail");
            }
        }
コード例 #2
0
        private void AddOrder(HttpContext context)
        {
            OrderBll bll           = new OrderBll();
            string   card_birthday = context.Request["card_birthday"];
            string   paytype       = context.Request["paytype"];
            string   remark        = context.Request["remark"];
            string   bastdate      = context.Request["bastdate"];


            string     ordercode  = DateTime.Now.ToString("yyyyMMddffffff");
            AddressBll addressbll = new AddressBll();
            CartBll    carbll     = new CartBll();
            UserBll    userbll    = new UserBll();
            int        userid     = userbll.GetUserIdByToken();

            if (carbll.GetCartListByUserId(userid).Count() > 0)
            {
                if (addressbll.GetAddressByUserId() != null)
                {
                    if (bll.AddOrderByUserId(card_birthday, bastdate, paytype, remark, ordercode))
                    {
                        context.Response.Write(ordercode);
                    }


                    else
                    {
                        context.Response.Write("fail");
                    }
                }
                else
                {
                    context.Response.Write("addressfail");
                }
            }
            else
            {
                context.Response.Write("cartisnull");
            }
        }