Example #1
0
        public ActionResult OrderDeal(FormCollection collection)
        {
            string LastUser = "";

            if (CurrentWechatUserInfo != null)
            {
                LastUser = CurrentWechatUserInfo.openid;
            }
            else
            {
                return(Content("长时间未操作,系统已自动退出,请从微信公众号菜单重新进入!"));
            }
            try
            {
                // Save order
                Order order = new Order();
                order.CustomerID   = collection.GetValue("CustomerID").AttemptedValue.Trim();
                order.OrderID      = collection.GetValue("OrderID").AttemptedValue.Trim();
                order.DealDate     = collection.GetValue("DealDate").AttemptedValue.Trim();
                order.VINCode      = collection.GetValue("VINCode").AttemptedValue.Trim();
                order.PlateNO      = collection.GetValue("PlateNO").AttemptedValue.Trim();
                order.AfterSaleMan = collection.GetValue("AfterSaleMan").AttemptedValue.Trim();
                order.Loan         = collection.GetValue("Loan").AttemptedValue.Trim();
                order.Insure       = collection.GetValue("Insure").AttemptedValue.Trim();
                DataAPI.CustomerController dtc = new DataAPI.CustomerController();

                string re = "0";

                if (dtc.GetOrderStatus(int.Parse(order.OrderID)) == 1)
                {
                    return(Content("该订单已交车!"));
                }
                if (dtc.GetOrderStatus(int.Parse(order.OrderID)) == 2)
                {
                    return(Content("该订单已取消!"));
                }

                re = dtc.EditOrder(order);

                if (re == "1")
                {
                    return(Content("1"));
                }
                else
                {
                    return(Content("0"));
                }
            }
            catch
            {
                return(Content("-1"));
            }
        }
Example #2
0
        public ActionResult OrderCancel(FormCollection collection)
        {
            string LastUser = "";

            if (CurrentWechatUserInfo != null)
            {
                LastUser = CurrentWechatUserInfo.openid;
            }
            else
            {
                return(Content("长时间未操作,系统已自动退出,请从微信公众号菜单重新进入!"));
            }
            try
            {
                // Save order
                Order order = new Order();
                order.CustomerID   = collection.GetValue("CustomerID").AttemptedValue.Trim();
                order.OrderID      = collection.GetValue("OrderID").AttemptedValue.Trim();
                order.CancelDate   = collection.GetValue("CancelDate").AttemptedValue.Trim();
                order.CancelRemark = collection.GetValue("CancelRemark").AttemptedValue.Trim();
                Customer cust = new Customer();

                cust.CustomerID   = int.Parse(collection.GetValue("CustomerID").AttemptedValue.Trim());
                cust.Grade        = collection.GetValue("Grade").AttemptedValue.Trim();
                cust.NextPlanDate = collection.GetValue("NextPlanDate").AttemptedValue.Trim();

                Business bus = new Business();
                bus.NextPlanDate  = collection.GetValue("NextPlanDate").AttemptedValue.Trim();
                bus.CustomerID    = collection.GetValue("CustomerID").AttemptedValue.Trim();
                bus.BusinessDesc  = collection.GetValue("CancelRemark").AttemptedValue.Trim();
                bus.BusinessEvent = collection.GetValue("BusinessEvent").AttemptedValue.Trim();
                bus.Grade         = collection.GetValue("Grade").AttemptedValue.Trim();


                DataAPI.CustomerController dtc = new DataAPI.CustomerController();

                string re = "0";
                if (dtc.GetOrderStatus(int.Parse(order.OrderID)) == 1)
                {
                    return(Content("该订单已交车!"));
                }
                if (dtc.GetOrderStatus(int.Parse(order.OrderID)) == 2)
                {
                    return(Content("该订单已取消!"));
                }

                re = dtc.EditOrder(order, cust, bus, LastUser);

                if (re == "1")
                {
                    return(Content("1"));
                }
                else
                {
                    return(Content("0"));
                }
            }
            catch
            {
                return(Content("-1"));
            }
        }