예제 #1
0
        public ActionResult SaveOrder(Z10Order xorder, bool?IsOutDepot, bool?IsPay, long?Bank)
        {
            EAP.Logic.Z10.Order order = EAP.Logic.Z10.Order.CreateWithSession();

            order.Z10Order.CustomerID = xorder.CustomerID;
            order.Z10Order.DateOrder  = xorder.DateOrder;
            order.Z10Order.DateShip   = xorder.DateOrder;
            order.Z10Order.Currency   = xorder.Currency;
            order.Z10Order.Remark     = xorder.Remark;
            order.Z10Order.FeeShip    = xorder.FeeShip;
            order.Z10Order.FeeShould  = xorder.FeeShould;

            order.Save(_tenant.TenantID.Value, db, null);

            db.ColAdd <Z01Customer>("ManageHot", xorder.CustomerID ?? 0);


            bool isout = IsOutDepot ?? false;
            bool ispay = IsPay ?? false;

            if (isout)
            {
                order.SaleOutDepot(_tenant.TenantID, _user.UserID);
            }
            if (ispay)
            {
                order.Pay(_tenant.TenantID, _user.UserID, xorder.FeeShould.Value, Bank);
            }
            Session.Remove("Z10Order");
            return(Content("1"));
        }
예제 #2
0
        public ActionResult SaveOrder(Z10Order xorder, bool?IsInDepot, bool?IsPay, long?Bank)
        {
            EAP.Logic.Z10.Order order = EAP.Logic.Z10.Order.CreateWithSession();

            order.Z10Order.CustomerID = xorder.CustomerID;
            order.Z10Order.DateOrder  = xorder.DateOrder;
            order.Z10Order.DateShip   = xorder.DateOrder;
            order.Z10Order.Currency   = xorder.Currency;
            order.Z10Order.Remark     = xorder.Remark;
            order.Z10Order.OrderType  = (int)EAP.Logic.Z10.OrderTypes.Purchase;
            order.Z10Order.FeeShip    = xorder.FeeShip;
            order.Z10Order.FeeShould  = xorder.FeeShould;

            order.Save(_tenant.TenantID.Value, db, null);
            Session.Remove("Z10Order");

            bool isin  = IsInDepot ?? false;
            bool ispay = IsPay ?? false;

            if (isin)
            {
                order.StockInDepot(_tenant.TenantID, _user.UserID);
            }
            if (ispay)
            {
                order.Pay(_tenant.TenantID, _user.UserID, -xorder.FeeShould.Value, Bank);
            }
            return(Content("1"));
        }
예제 #3
0
        public ActionResult PayAction(long bank, decimal feePaid, int orderStatus)
        {
            EAP.Logic.Z10.Order order = EAP.Logic.Z10.Order.CreateWithSession();

            var xOrderStatus = (EAP.Logic.Z10.OrderStatus)orderStatus;

            if (order != null)
            {
                var result = order.Pay(_tenant.TenantID.Value, _user.UserID.Value, xOrderStatus, feePaid, bank);

                if (result)
                {
                    return(Content("1"));
                }
                else
                {
                    return(Content("系统内部错误,请联系管理员。"));
                }
            }
            else
            {
                return(Content("不存在的出库单!"));
            }
        }