Ejemplo n.º 1
0
        //删除订单
        public void delect()
        {
            var aa = 200;
            //exec DelOrder '717112117155703'
            string OrCode = Request["OrId"];
            var    nums   = OrddeService.GetEntity(n => n.Code == OrCode).OrderBillChis.Count() + 1;
            var    sql    = $"exec DelOrder '{OrCode}'";

            if (OrddeService.QueryBySql(sql) == nums)
            {
                aa = 100;
            }
            Response.ContentType = "text/plain";
            Response.Write(aa);
            Response.End();
        }
Ejemplo n.º 2
0
        public void addOrder()
        {
            var aa = "200";

            var pink = 0;
            var memo = Request["Memo"];

            if (memo == "")
            {
                memo = null;
            }
            var pro = ShopCartService.GetEntities(n => n.checks == 1);

            orderViewModel.Addrresses = AddrressService.GetEntity(n => n.State == 1);
            foreach (var ppp in pro)
            {
                orderViewModel.price += ppp.Qty * ppp.Product.SellPrice;
            }
            int cusid = Convert.ToInt32(Session["cusId"]);

            foreach (var od in pro)
            {
                if (od.Product.IsPinkage)
                {
                    pink = 10;
                    break;
                }
            }
            var code = cusid + DateTime.Now.Year.ToString().Substring(2, 2) + DateTime.Now.Month + DateTime.Now.Day + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second + pro.First().ProCode.Substring(12, 2);
            var sql  = $"exec addOrder '{code}',{cusid},'{"待付款"}',{orderViewModel.price},{pink},'{memo}'";
            var nums = pro.Count() * 2 + 1;

            if (OrddeService.QueryBySql(sql) == nums)
            {
                aa = code;
            }
            Response.ContentType = "text/plain";
            Response.Write(aa);
            Response.End();
        }