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"); } }
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"); } }