Exemple #1
0
        /// <summary>
        /// 根据单据类型和单据编号取得已经确认的销售收款单
        /// </summary>
        /// <param name="orderSysNo">单据系统编号</param>
        /// <param name="orderType">单据类型</param>
        /// <returns></returns>
        public SOIncomeInfo GetConfirmed(int orderSysNo, SOIncomeOrderType orderType)
        {
            DataCommand command = DataCommandManager.GetDataCommand("GetConfirmedSOIncomeInfo");

            command.SetParameterValue("@SOSysNo", orderSysNo);
            command.SetParameterValue("@OrderType", orderType);
            return(command.ExecuteEntity <SOIncomeInfo>());
        }
Exemple #2
0
        /// <summary>
        /// 根据单据类型和单据编号取得有效的销售收款单
        /// </summary>
        /// <param name="soSysNo">单据系统编号</param>
        /// <param name="type">单据类型</param>
        /// <returns>符合条件的有效的收款单,如果没有找到符合条件的收款单则返回NULL</returns>
        public static SOIncomeInfo GetValidSOIncomeInfo(int soSysNo, SOIncomeOrderType type)
        {
            DataCommand command = DataCommandManager.GetDataCommand("GetValidSOIncomeInfo");

            command.SetParameterValue("@SOSysNo", soSysNo);
            command.SetParameterValue("@OrderType", type);
            return(command.ExecuteEntity <SOIncomeInfo>());
        }
Exemple #3
0
        /// <summary>
        /// 取得收款单应收金额
        /// </summary>
        /// <param name="orderSysNo"></param>
        /// <param name="orderType"></param>
        /// <returns></returns>
        public decimal GetIncomeAmt(int orderSysNo, SOIncomeOrderType orderType)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("GetIncomeAmt");

            cmd.SetParameterValue("@OrderSysNo", orderSysNo);
            cmd.SetParameterValue("@OrderType", orderType);

            return(Convert.ToDecimal(cmd.ExecuteScalar()));
        }
Exemple #4
0
        public bool ExistsTrackingInfo(int orderSysNo, SOIncomeOrderType orderType)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("ExistsTrackingInfo");

            cmd.SetParameterValue("@OrderSysNo", orderSysNo);
            cmd.SetParameterValue("@OrderType", orderType);

            return(cmd.ExecuteScalar <Int32>() > 0);
        }
Exemple #5
0
        public TrackingInfo LoadTrackingInfoByOrderSysNo(int orderSysNo, SOIncomeOrderType orderType)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("QueryTrackingInfoByOrderSysNo");

            cmd.SetParameterValue("@OrderSysNo", orderSysNo);
            cmd.SetParameterValue("@OrderType", orderType);

            return(cmd.ExecuteEntity <TrackingInfo>());
        }
Exemple #6
0
        /// <summary>
        /// 查询单据
        /// </summary>
        /// <param name="orderSysNo"></param>
        /// <param name="orderType"></param>
        /// <param name="callback"></param>
        public void QueryOrder(string orderSysNo, SOIncomeOrderType orderType, Action <OrderQueryResultVM> callback)
        {
            OrderQueryFilter filter = new OrderQueryFilter()
            {
                OrderType  = orderType,
                OrderSysNo = orderSysNo
            };

            string relativeUrl = "/InvoiceService/TrackingInfo/QueryOrder";

            restClient.QueryDynamicData(relativeUrl, filter, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                OrderQueryResultVM result = new OrderQueryResultVM();
                result.ResultList         = DynamicConverter <OrderVM> .ConvertToVMList(args.Result.Rows);
                result.TotalCount         = args.Result.TotalCount;

                callback(result);
            });
        }
Exemple #7
0
 /// <summary>
 /// 根据单据类型和单据编号取得销售收款单
 /// </summary>
 /// <param name="orderSysNo">单据系统编号</param>
 /// <param name="orderType">单据类型</param>
 /// <returns>符合条件的有效的收款单,如果没有找到符合条件的收款单则返回NULL</returns>
 public SOIncomeInfo GetConfirmedSOIncome(int orderSysNo, SOIncomeOrderType orderType)
 {
     return(ObjectFactory <SOIncomeProcessor> .Instance.GetConfirmed(orderSysNo, orderType));
 }
        public void SyncSAPSales(DataTable dt, SOIncomeOrderType soIncomeOrderType)
        {
            int    orderTypeSysNo = -1;
            string orderType      = string.Empty;

            switch (soIncomeOrderType)
            {
            case SOIncomeOrderType.SO:
                orderTypeSysNo = 2;
                orderType      = EnumHelper.ToEnumDesc(SOIncomeOrderType.SO);
                break;

            case SOIncomeOrderType.RO:
                orderTypeSysNo = 4;
                orderType      = EnumHelper.ToEnumDesc(SOIncomeOrderType.RO);
                break;

            case SOIncomeOrderType.AO:
                orderTypeSysNo = 7;
                orderType      = EnumHelper.ToEnumDesc(SOIncomeOrderType.AO);
                break;

            case SOIncomeOrderType.RO_Balance:
                orderTypeSysNo = 6;
                orderType      = EnumHelper.ToEnumDesc(SOIncomeOrderType.RO_Balance);
                break;

            case SOIncomeOrderType.OverPayment:
                orderTypeSysNo = 8;
                orderType      = EnumHelper.ToEnumDesc(SOIncomeOrderType.OverPayment);
                break;
            }

            TransactionOptions options = new TransactionOptions();

            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout        = new System.TimeSpan(0, 10, 0);

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                ObjectFactory <INECN_SyncSAPSalesDA> .Instance.DeleteSAPSales(orderTypeSysNo);

                foreach (DataRow dr in dt.Rows)
                {
                    SAPSalesInfo entity = DataMapper.GetEntity <SAPSalesInfo>(dr);

                    entity.SalesSysNo      = Convert.ToString(dr["SysNo"]);
                    entity.CreateTime      = Convert.ToDateTime(dr["IncomeTime"]);
                    entity.CreateUserName  = !dr.IsNull("IncomeUser") ? Convert.ToString(dr["IncomeUser"]) : "";
                    entity.ConfirmUserName = !dr.IsNull("ConfirmUser") ? Convert.ToString(dr["ConfirmUser"]) : "";
                    entity.PayType         = dr.IsNull("PayTypeSysNo") ? new Nullable <int>() : Convert.ToInt32(dr["PayTypeSysNo"]);
                    entity.OrderStatus     = Convert.ToString(dr["IncomeStatus"]);
                    entity.ReturnCash      = !dr.IsNull("SAPReturnCashAmt") ? Convert.ToDecimal(dr["SAPReturnCashAmt"]) : new Nullable <decimal>();
                    entity.ReturnPoint     = !dr.IsNull("SAPReturnPointAmt") ? Convert.ToInt32(dr["SAPReturnPointAmt"]) : new Nullable <int>();
                    entity.ShipPrice       = Convert.ToDecimal(dr["ShippingFee"]);
                    entity.PayPrice        = Convert.ToDecimal(dr["PackageFee"]);
                    entity.Premium         = Convert.ToDecimal(dr["RegisteredFee"]);

                    entity.OrderType      = orderType;
                    entity.OrderTypeSysNo = orderTypeSysNo;

                    entity.PrepayAmt = (orderTypeSysNo == 2 && entity.PrepayAmt == 0) ? null : entity.PrepayAmt;
                    entity.SOSysNo   = orderTypeSysNo != 7 ? entity.SOSysNo : null;
                    entity.ShipCost  = (entity.ShipCost == 0 && orderTypeSysNo != 6) ? (decimal?)null : entity.ShipCost;

                    if (entity.RefundPayTypeSysNo != null)
                    {
                        entity.RefundPayType = EnumHelper.ToEnumDesc((RefundPayType)dr["RefundPayTypeSysNo"]);
                    }

                    ObjectFactory <INECN_SyncSAPSalesDA> .Instance.SyncSAPSales(entity);
                }
                scope.Complete();
            }
        }
 public virtual TrackingInfo GetTrackingInfoByOrderSysNo(int orderSysNo, SOIncomeOrderType orderType)
 {
     return(m_TrackInfoDA.LoadTrackingInfoByOrderSysNo(orderSysNo, orderType));
 }
Exemple #10
0
 /// <summary>
 /// 根据单据类型和单据编号取得有效的销售收款单
 /// </summary>
 /// <param name="soSysNo">单据系统编号</param>
 /// <param name="type">单据类型</param>
 /// <returns>符合条件的有效的收款单,如果没有找到符合条件的收款单则返回NULL</returns>
 public static SOIncomeInfo GetValidSOIncomeInfo(int soSysNo, SOIncomeOrderType type)
 {
     return(SOIncomeDA.GetValidSOIncomeInfo(soSysNo, type));
 }
Exemple #11
0
 /// <summary>
 /// 根据单据类型和单据编号取得有效的销售收款单
 /// </summary>
 /// <param name="orderSysNo">单据系统编号</param>
 /// <param name="orderType">单据类型</param>
 /// <returns></returns>
 public virtual SOIncomeInfo GetValid(int orderSysNo, SOIncomeOrderType orderType)
 {
     return(ObjectFactory <SOIncomeProcessor> .Instance.GetValid(orderSysNo, orderType));
 }
 internal static SOIncomeInfo GetValidSOIncomeInfo(int orderSysNo, SOIncomeOrderType orderType)
 {
     return(ObjectFactory <IInvoiceBizInteract> .Instance.GetValidSOIncome(orderSysNo, orderType));
 }