Пример #1
0
        public double GetCash()
        {
            if (rowSet != null && rowSet.Count > 0)
            {
                return(TypeParser.GetDoubleValue(rowSet[0].availableAmount));
            }

            return(0);
        }
Пример #2
0
 private bool IsMatchYijia(DataGridView grid, int rowIndex, UserSettings settings)
 {
     if (grid != null && settings != null && settings.Yijia.HasValue)
     {
         var target = TypeParser.GetDoubleValue(grid.Rows[rowIndex].Cells[Namespace.GridColYijia].Value);
         if (target <= settings.Yijia.Value)
         {
             return(true);
         }
     }
     return(false);
 }
Пример #3
0
        private bool IsMatchNextPaymentRemain(DataGridView grid, int rowIndex, UserSettings settings, bool seed)
        {
            var status = MatchNextPaymentStatus.UnMatch;

            if (grid == null || settings == null || !settings.NextPayment.HasValue || settings.NextPayment.Value <= 0)
            {
                status = MatchNextPaymentStatus.Invalid;
            }
            else
            {
                var target = Math.Ceiling(TypeParser.GetDoubleValue(grid.Rows[rowIndex].Cells[Namespace.GridColNextRemainDay].Value));
                if (target > 0 && target <= settings.NextPayment.Value)
                {
                    status = MatchNextPaymentStatus.Match;
                }
            }

            switch (status)
            {
            case MatchNextPaymentStatus.Invalid:
                break;

            case MatchNextPaymentStatus.Match:
                seed = seed && true;
                if (seed)
                {
                    grid.Rows[rowIndex].Cells[Namespace.GridColNextRemainDayDisplay].Style.ForeColor = COLOR_HIGHLIGHT;
                }
                break;

            case MatchNextPaymentStatus.UnMatch:
                seed = false;
                break;
            }

            return(seed);
        }
Пример #4
0
        private async Task <SxhResult> SubmitAsync()
        {
            if (Project != null && Account != null)
            {
                var para = new VmAcquire()
                {
                    AcquisitionPrice    = TypeParser.GetDoubleValue(Project.minTransferingPrice, 0),
                    Copies              = TypeParser.GetInt32Value(txtCopy.Text),
                    ProjectId           = Project.projectId,
                    ProjectName         = Project.projectTitle,
                    ShowPrice           = TypeParser.GetDoubleValue(Project.advicePrice),
                    TockenKey           = txtToken.Text,
                    TokenAcquire        = txtTokenAcquire.Text,
                    TransactionPassword = Account.PasswordTran,
                    VerificationCode    = txtVerifyCode.Text,
                    TokenOffical        = Account.TokenOffical,
                };

                var proxy = new ProxyAcquisition();
                return(await proxy.SubmitAsync(para));
            }

            return(new SxhResult(false, $"invalid project or account"));
        }