Beispiel #1
0
        public ActionResult OrderList(int clas = 0)
        {
            orderViewModel.clas = clas;
            int cusid = Convert.ToInt32(Session["cusId"]);

            orderViewModel.OrderBillFaths = OrddeService.GetEntities(n => n.CusId == cusid);
            return(View(orderViewModel));
        }
Beispiel #2
0
        public ActionResult OrderText(string ProCode, string Code)
        {
            OrderBillChi OrdPro = new OrderBillChi();

            foreach (var OrderBillChi in OrddeService.GetEntity(n => n.Code == Code).OrderBillChis)
            {
                if (OrderBillChi.ProCode == ProCode)
                {
                    OrdPro = OrderBillChi;
                }
            }

            return(View(OrdPro));
        }
Beispiel #3
0
        //取消订单
        public void ORDWORD()
        {
            var    aa     = 200;
            string OrCode = Request["OrId"];
            var    ord    = OrddeService.GetEntity(n => n.Code == OrCode);

            ord.State = "已取消";
            if (OrddeService.Add(ord))
            {
                aa = 100;
            }
            Response.ContentType = "text/plain";
            Response.Write(aa);
            Response.End();
        }
Beispiel #4
0
        //收货
        public void shouhuo()
        {
            var    aa     = 200;
            string OrCode = Request["OrId"];
            var    ord    = OrddeService.GetEntity(n => n.Code == OrCode);

            ord.State    = "已收货";
            ord.ReceTime = DateTime.Now;
            if (OrddeService.Add(ord))
            {
                aa = 100;
            }
            Response.ContentType = "text/plain";
            Response.Write(aa);
            Response.End();
        }
Beispiel #5
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();
        }
Beispiel #6
0
        public void OrderUp()
        {
            var aa    = 200;
            var code  = Request["Code"];
            var PayId = Convert.ToInt32(Request["PayId"]);
            var order = OrddeService.GetEntity(n => n.Code == code);

            order.PayId    = PayId;
            order.State    = "已发货";
            order.PayTime  = DateTime.Now;
            order.PostTime = DateTime.Now.AddMinutes(1);
            if (OrddeService.Add(order))
            {
                aa = 100;
            }
            Response.ContentType = "text/plain";
            Response.Write(aa);
            Response.End();
        }
Beispiel #7
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();
        }
Beispiel #8
0
        public ActionResult ExOrder(string Code)
        {
            var ord = OrddeService.GetEntity(n => n.Code == Code);

            return(View(ord));
        }
Beispiel #9
0
        public ActionResult OrderPay(string code)
        {
            var orders = OrddeService.GetEntity(n => n.Code == code);

            return(View(orders));
        }