Exemplo n.º 1
0
        // private static int curAccount;

        #region 界面显示控制

        private void UpdateTargetAccounts()
        {
            List <IPropertyOwner> list = new List <IPropertyOwner>();
            BasicBankAccount      cur  = ThisUser.FindBankAccount(BankAccount.SelectedValue);

            foreach (var account in ThisUser.BankAccounts)
            {
                if (account != cur)
                {
                    list.Add(account as IPropertyOwner);
                }
            }
            foreach (var user in WebSharp.Module.User.UserDictionary)
            {
                if (user.Value != ThisUser)
                {
                    list.Add(user.Value as IPropertyOwner);
                }
            }

            TransferTarget.DataSource     = list;
            TransferTarget.DataTextField  = "OwnerId";
            TransferTarget.DataValueField = "OwnerId";
            TransferTarget.DataBind();
        }
Exemplo n.º 2
0
        public static ETransferAmount Init(TransferTarget target, string TransferId, float TransferAmount, string AliPayAccount, EOrderInfo order, EUserInfo ui = null)
        {
            ETransferAmount obj = new ETransferAmount();

            obj.TransferId     = TransferId;
            obj.TransferAmount = TransferAmount;
            obj.TransDate      = DateTime.Now;
            obj.TransDateStr   = obj.TransDate.ToString("yyyy-MM-dd HH:mm");
            obj.OrderNo        = order.OrderNo;
            obj.QRUserId       = order.QRUserId;
            obj.TransferStatus = TransferStatus.Open;
            obj.TargetAccount  = AliPayAccount;
            obj.Log            = "";
            if (ui != null)
            {
                if (target == TransferTarget.Agent || target == TransferTarget.ParentAgent)
                {
                    obj.AgentOpenId = ui.OpenId;
                    obj.AgentName   = ui.Name;
                }
            }

            obj.TransferTarget = target;
            return(obj);
        }
Exemplo n.º 3
0
        internal void SyncTarget(TransferTarget target, int weaponId)
        {
            target.EntityId     = Entity?.EntityId ?? -1;
            target.TargetPos    = TargetPos;
            target.HitShortDist = (float)HitShortDist;
            target.OrigDistance = (float)OrigDistance;
            target.TopEntityId  = TopEntityId;
            target.WeaponId     = weaponId;

            if (IsProjectile)
            {
                target.State = TransferTarget.TargetInfo.IsProjectile;
            }
            else if (IsFakeTarget)
            {
                target.State = TransferTarget.TargetInfo.IsFakeTarget;
            }
            else if (HasTarget)
            {
                target.State = TransferTarget.TargetInfo.IsEntity;
            }

            if (!HasTarget)
            {
                target.State = TransferTarget.TargetInfo.Expired;
            }
        }
Exemplo n.º 4
0
        public static string GenerateTransferNo(TransferTarget target)
        {
            string pix = "YJTO";

            switch (target)
            {
            case TransferTarget.Agent:
                pix = "YJTOA";
                break;

            case TransferTarget.ParentAgent:
                pix = "YJTOPA";
                break;

            case TransferTarget.User:
                pix = "YJTOU";
                break;
            }
            return(pix + DateTime.Now.ToString("yyyyMMddhhmmss") + GetRnd(2, true, true, false, false, ""));
        }
Exemplo n.º 5
0
        internal void ClientUpdate(Weapon w, TransferTarget tData)
        {
            MyEntity targetEntity = null;

            if (tData.EntityId <= 0 || MyEntities.TryGetEntityById(tData.EntityId, out targetEntity, true))
            {
                Entity = targetEntity;

                if (tData.EntityId == 0)
                {
                    w.Target.Reset(w.System.Session.Tick, States.ServerReset);
                }
                else
                {
                    StateChange(true, tData.EntityId == -2 ? States.Fake : States.Acquired);

                    if (w.Target.IsProjectile)
                    {
                        GridAi.TargetType targetType;
                        GridAi.AcquireProjectile(w, out targetType);

                        if (targetType == GridAi.TargetType.None)
                        {
                            if (w.NewTarget.CurrentState != States.NoTargetsSeen)
                            {
                                w.NewTarget.Reset(w.Comp.Session.Tick, States.NoTargetsSeen);
                            }
                            if (w.Target.CurrentState != States.NoTargetsSeen)
                            {
                                w.Target.Reset(w.Comp.Session.Tick, States.NoTargetsSeen, !w.Comp.Data.Repo.Base.State.TrackingReticle);
                            }
                        }
                    }
                }
                w.TargetData.WeaponRandom.AcquireCurrentCounter = w.TargetData.WeaponRandom.AcquireTmpCounter;
                w.TargetData.WeaponRandom.AcquireRandom         = new Random(w.TargetData.WeaponRandom.CurrentSeed);
                ClientDirty = false;

                //Log.Line($"UpdateTarget: id:{tData.EntityId}({TargetId}) - entity:{Entity != null}({targetEntity != null}) - state:{CurrentState}({PreviousState}) - hasTarget:{tData.EntityId != 0}({HasTarget})");
            }
        }
Exemplo n.º 6
0
        internal void ClientUpdate(Weapon w, TransferTarget tData)
        {
            MyEntity targetEntity = null;

            if (tData.EntityId <= 0 || MyEntities.TryGetEntityById(tData.EntityId, out targetEntity, true))
            {
                Entity = targetEntity;

                if (tData.EntityId == 0)
                {
                    w.Target.Reset(w.System.Session.Tick, States.ServerReset);
                }
                else
                {
                    StateChange(true, tData.EntityId == -2 ? States.Fake : States.Acquired);

                    if (w.Target.IsProjectile)
                    {
                        GridAi.TargetType targetType;
                        GridAi.AcquireProjectile(w, out targetType);

                        if (targetType == GridAi.TargetType.None)
                        {
                            if (w.NewTarget.CurrentState != States.NoTargetsSeen)
                            {
                                w.NewTarget.Reset(w.Comp.Session.Tick, States.NoTargetsSeen);
                            }

                            if (w.Target.CurrentState != States.NoTargetsSeen)
                            {
                                w.Target.Reset(w.Comp.Session.Tick, States.NoTargetsSeen, !w.Comp.Data.Repo.Base.State.TrackingReticle && w.Comp.Data.Repo.Base.Set.Overrides.Control != GroupOverrides.ControlModes.Painter);
                            }
                        }
                    }
                }
                w.TargetData.WeaponRandom.AcquireCurrentCounter = w.TargetData.WeaponRandom.AcquireTmpCounter;
                w.TargetData.WeaponRandom.AcquireRandom         = new Random(w.TargetData.WeaponRandom.CurrentSeed);
                ClientDirty = false;
            }
        }
Exemplo n.º 7
0
 /// <summary>
 ///     Transfers an answered call to the specified call party. Applicable for a call session in "Answered" or "Hold"
 ///     state.
 ///     HTTP Method: post
 ///     Endpoint:
 ///     /restapi/{apiVersion}/account/{accountId}/telephony/sessions/{telephonySessionId}/parties/{partyId}/transfer
 ///     Rate Limit Group: Light
 ///     App Permission: CallControl
 /// </summary>
 public async Task <CallParty> Post(TransferTarget transferTarget, RestRequestConfig restRequestConfig = null)
 {
     return(await rc.Post <CallParty>(Path(), transferTarget, null, restRequestConfig));
 }
Exemplo n.º 8
0
        /// <summary>
        /// 转账
        /// </summary>
        /// <param name="target">转帐方向</param>
        /// <param name="app">支付宝App</param>
        /// <param name="ui">转账对象</param>
        /// <param name="order">根据订单获取转账金额</param>
        /// <param name="accessToken"></param>
        /// <param name="GlobalConfig">获取是否微信转账配置</param>
        /// <returns></returns>
        public ETransferAmount TransferHandler(TransferTarget target, EAliPayApplication app, EAliPayApplication subApp, EUserInfo ui, ref EOrderInfo order, float AmountNotInOrder = 0, string accessToken = null, EGlobalConfig GlobalConfig = null)
        {
            string          TransferId = "";
            ETransferAmount transfer   = null;
            AlipayFundTransToaccountTransferResponse res = null;
            string        AliPayAccount  = null;
            float         TransferAmount = 0;
            PayTargetMode PayTargetMode  = PayTargetMode.AliPayAccount;

            switch (target)
            {
            case TransferTarget.Agent:
                AliPayAccount  = ui.AliPayAccount;
                TransferAmount = order.RateAmount;
                break;

            case TransferTarget.L3Agent:
                AliPayAccount  = ui.AliPayAccount;
                TransferAmount = order.L3CommissionAmount;
                break;

            case TransferTarget.ParentAgent:
                AliPayAccount  = ui.AliPayAccount;
                TransferAmount = order.ParentCommissionAmount;
                break;

            case TransferTarget.User:
                if (string.IsNullOrEmpty(order.BuyerAliPayAccount))
                {
                    AliPayAccount = order.BuyerAliPayId;
                    PayTargetMode = PayTargetMode.AliPayId;
                }
                else
                {
                    AliPayAccount = order.BuyerAliPayAccount;
                }

                TransferAmount = order.BuyerTransferAmount;
                break;

            case TransferTarget.MidStore:
                AliPayAccount  = ui.AliPayAccount;
                TransferAmount = AmountNotInOrder;
                break;
            }
            if (target == TransferTarget.User)
            {
                res = DoTransferAmount(target, subApp, AliPayAccount, TransferAmount.ToString("0.00"), PayTargetMode, out TransferId, order);
                //if (res.Code == "40004" && res.SubCode == "PAYER_BALANCE_NOT_ENOUGH")
                //{
                //    string tid;
                //    Random r = new Random();
                //    int num = r.Next(11890, 15588);
                //    AlipayFundTransToaccountTransferResponse response = DoTransferAmount(TransferTarget.Internal,app, "*****@*****.**", num.ToString("0.00"), PayTargetMode.AliPayAccount, out tid);
                //    if(response.Code == "10000")
                //    {
                //        res = DoTransferAmount(target, subApp, AliPayAccount, TransferAmount.ToString("0.00"), PayTargetMode, out TransferId, order);
                //    }
                //}
            }
            else
            {
                res = DoTransferAmount(target, app, AliPayAccount, TransferAmount.ToString("0.00"), PayTargetMode, out TransferId, order);
            }

            transfer = ETransferAmount.Init(target, TransferId, TransferAmount, AliPayAccount, order, ui);
            transfer.AliPayOrderId = res.OrderId;

            if (res.Code == "10000")
            {
                //转账记录开始
                transfer.TransferStatus = TransferStatus.Success;
            }
            else
            {
                transfer.TransferStatus = TransferStatus.Failure;
                transfer.Log           += string.Format("[Transfer to {2}] SubCode:{0};Submsg:{1}", res.SubCode, res.SubMsg, target.ToString());

                order.LogRemark  += "【转账错误】" + string.Format("[Transfer to {2}] SubCode:{0};Submsg:{1}", res.SubCode, res.SubMsg, target.ToString());
                order.OrderStatus = IQBCore.IQBPay.BaseEnum.OrderStatus.Exception;
            }
            return(transfer);
        }
Exemplo n.º 9
0
        public AlipayFundTransToaccountTransferResponse DoTransferAmount(TransferTarget target,
                                                                         EAliPayApplication app,
                                                                         string toAliPayAccount,
                                                                         string Amount,
                                                                         PayTargetMode PayTargetMode,
                                                                         out string TransferId,
                                                                         EOrderInfo order = null,
                                                                         string ShowName  = null)
        {
            IAopClient aliyapClient = new DefaultAopClient("https://openapi.alipay.com/gateway.do", app.AppId,
                                                           app.Merchant_Private_Key, "json", "1.0", "RSA2", app.Merchant_Public_key, "GBK", false);

            AlipayFundTransToaccountTransferRequest request = new AlipayFundTransToaccountTransferRequest();

            TransferId = StringHelper.GenerateTransferNo(target);
            AlipayFundTransToaccountTransferModel model = new AlipayFundTransToaccountTransferModel();

            model.Amount   = Amount;
            model.OutBizNo = TransferId;
            if (PayTargetMode == PayTargetMode.AliPayAccount)
            {
                model.PayeeType = "ALIPAY_LOGONID";
            }
            else
            {
                model.PayeeType = "ALIPAY_USERID";
            }

            model.PayeeAccount = toAliPayAccount;
            if (!string.IsNullOrEmpty(ShowName))
            {
                model.PayerShowName = ShowName;
            }
            else
            {
                string profix = "";
                if (target == TransferTarget.ParentAgent)
                {
                    profix = "(上级佣金)";
                }
                else if (target == TransferTarget.Agent)
                {
                    profix = "(代理费)";
                }
                else if (target == TransferTarget.User)
                {
                    profix = "(打款)";
                }
                else if (target == TransferTarget.L3Agent)
                {
                    profix = "(三级)";
                }
                else if (target == TransferTarget.MidStore)
                {
                    profix = "(码商)";
                }
                model.PayerShowName = profix + "服务费";
            }

            if (order != null)
            {
                model.Remark = string.Format("#{0}-订单金额:{1}-订单ID:{2}", order.AgentName, order.TotalAmount, order.OrderNo);
            }

            request.SetBizModel(model);

            AlipayFundTransToaccountTransferResponse response = aliyapClient.Execute(request);

            return(response);
        }