Exemplo n.º 1
0
        public AccountInfoResult GetAcInfo(Int32 UId)
        {
            var Result = new AccountInfoResult();

            try
            {
                dbContext.Configuration.LazyLoadingEnabled = false;
                var oAclist = dbContext.APPACINFOes.Where(t => t.USERID == UId).ToList();
                if (oAclist != null)
                {
                    Result.Status     = true;
                    Result.RequestMsg = oAclist.Count + " result/s found.";
                    Result.AcList     = new List <APPACINFO>(oAclist);
                }
                else
                {
                    Result.Status     = false;
                    Result.RequestMsg = " 0 result found.";
                    Result.AcList     = null;
                }
            }
            catch (Exception ex)
            {
                Result.Status     = false;
                Result.RequestMsg = (ex.InnerException != null) ? ex.Message : ex.InnerException.Message;
                Result.AcList     = null;
            }
            return(Result);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Async call to authorize on MAIL.RU server.
 /// </summary>
 /// <returns>True or false result operation.</returns>
 public async Task <bool> LoginAsync()
 {
     if (!IsAnonymous)
     {
         Info = await RequestRepo.AccountInfo();
     }
     return(true);
 }
Exemplo n.º 3
0
        public static AccountInfo ToAccountInfo(this AccountInfoResult data)
        {
            var res = new AccountInfo
            {
                FileSizeLimit = data.body.cloud.file_size_limit
            };

            return(res);
        }
Exemplo n.º 4
0
        // Token: 0x060003AE RID: 942 RVA: 0x0003FFD4 File Offset: 0x0003E1D4
        public static async Task <double?> GetYandexBalanceAsync()
        {
            AccountInfoRequest <AccountInfoResult> accountInfoRequest = new AccountInfoRequest <AccountInfoResult>(YandexMoney.Connection, new JsonSerializer <AccountInfoResult>());
            AccountInfoResult accountInfoResult2 = await accountInfoRequest.Perform();

            AccountInfoResult accountInfoResult = accountInfoResult2;

            accountInfoResult2 = null;
            return(new double?(accountInfoResult.Balance));
        }
Exemplo n.º 5
0
        public static DiskUsage ToDiskUsage(this AccountInfoResult data)
        {
            var res = new DiskUsage
            {
                Total     = data.body.cloud.space.total * 1024 * 1024,
                Used      = data.body.cloud.space.used * 1024 * 1024,
                OverQuota = data.body.cloud.space.overquota
            };

            return(res);
        }
Exemplo n.º 6
0
        public static AccountInfoResult ToAccountInfo(this AccountInfoRequest.Result data)
        {
            var res = new AccountInfoResult
            {
                FileSizeLimit = data.body.cloud.file_size_limit,

                DiskUsage = new DiskUsage
                {
                    Total     = data.body.cloud.space.total * 1024 * 1024,
                    Used      = data.body.cloud.space.used * 1024 * 1024,
                    OverQuota = data.body.cloud.space.overquota
                }
            };

            return(res);
        }
Exemplo n.º 7
0
        public static AccountInfoResult ToAccountInfo(this AccountInfoRequestResult data)
        {
            var res = new AccountInfoResult
            {
                FileSizeLimit = data.Body.Cloud.FileSizeLimit,

                DiskUsage = new DiskUsage
                {
                    Total     = data.Body.Cloud.Space.BytesTotal, //total * 1024 * 1024,
                    Used      = data.Body.Cloud.Space.BytesUsed,  //used * 1024 * 1024,
                    OverQuota = data.Body.Cloud.Space.IsOverquota
                }
            };

            return(res);
        }
Exemplo n.º 8
0
        public static AccountInfoResult ToAccountInfo(this YadResponseModel <YadAccountInfoRequestData, YadAccountInfoRequestParams> data)
        {
            var info = data.Data;
            var res  = new AccountInfoResult
            {
                FileSizeLimit = info.FilesizeLimit,

                DiskUsage = new DiskUsage
                {
                    Total     = info.Limit,
                    Used      = info.Used,
                    OverQuota = info.Used > info.Limit
                }
            };

            return(res);
        }
Exemplo n.º 9
0
        public AccountInfoResult GetAccountInfo(int idUser)
        {
            AccountInfoResult res = new AccountInfoResult();

            try
            {
                DateTime fechaActual = DateTime.Now;

                //BUSCA EL HISTORIAL DE CONSULTAS HECHAS POR EL USUARIO, PARA CONOCER LA ULTIMA FECHA
                var hist = (from h in db.USER_SEARCH_HISTORY
                            where h.ID_USER == idUser
                            orderby h.INSERT_DATE descending

                            select new SearchHistoryResult
                {
                    Id = h.ID,
                    Fecha = h.INSERT_DATE,
                    FechaBusqueda = h.SEARCH_DATE == null ? h.INSERT_DATE : h.SEARCH_DATE.Value,
                    RFC = h.RFC,
                    T69 = h.C69.Length > 0 ? true : false,
                    T69B = h.C69_B.Length > 0 ? true : false,
                    S69 = h.C69,
                    S69B = h.C69_B,
                    C69 = h.C69_C == null ? 0 : h.C69_C.Value,
                    C69B = h.C69_BC == null ? 0 : h.C69_BC.Value,
                }).FirstOrDefault();
                ///////////////////////////////////////////////////////////////////////////////////////

                //BUSCA LA ULTIMA CARGA DEL TIPO SOURCE 1
                var source_1 = (from s in db.UPDATE
                                where s.ID_SOURCE_TYPE == 1
                                orderby s.DATE_UPDATE descending

                                select new UpdateResult
                {
                    Id = s.ID,
                    DateUpdate = s.DATE_UPDATE,
                    F = s.F,
                    M = s.M,
                    IdSourceType = s.ID_SOURCE_TYPE,
                    Name = s.NAME,
                    Records = s.RECORDS,
                    TableQuery = s.TABLE_QUERY
                }).FirstOrDefault();

                //BUSCA LA ULTIMA CARGA DEL TIPO SOURCE 2
                var source_2 = (from s in db.UPDATE
                                where s.ID_SOURCE_TYPE == 2
                                orderby s.DATE_UPDATE descending

                                select new UpdateResult
                {
                    Id = s.ID,
                    DateUpdate = s.DATE_UPDATE,
                    F = s.F,
                    M = s.M,
                    IdSourceType = s.ID_SOURCE_TYPE,
                    Name = s.NAME,
                    Records = s.RECORDS,
                    TableQuery = s.TABLE_QUERY
                }).FirstOrDefault();

                if (source_1.DateUpdate <= source_2.DateUpdate)
                {
                    res.LastUpdate = source_2.DateUpdate;
                }
                else
                {
                    res.LastUpdate = source_1.DateUpdate;
                }

                ///////////////////////////////////////////////////////////////////////////////////////
                //VERIFICA LAS FECHAS DE CADA ACTUALIZACION CON LA ÚLTIMA ACTUALIZACIÓN

                if (hist != null)
                {
                    res.LastSearch = hist.Fecha;

                    if (hist.Fecha < source_1.DateUpdate && hist.Fecha < source_2.DateUpdate) // SI...LA ULTIMA BUSQUEDA ES INFERIOR A AMBAS CARGAS
                    {
                        res.Title   = "Riesgo";
                        res.Message = "Existen nuevas actualizaciones.";
                        res.Status  = 3;
                    }
                    else
                    {
                        if (hist.Fecha < source_1.DateUpdate || hist.Fecha < source_2.DateUpdate)
                        {
                            res.Status  = 2;
                            res.Message = "Existe una nueva actualización.";
                            res.Title   = "Precaución";
                        }
                        else
                        {
                            res.Title  = "Seguro";
                            res.Status = 1;
                        }
                    }
                }
                else
                {
                    res.Status  = 4;
                    res.Title   = "Riesgo";
                    res.Message = "No se ha realizado alguna búsqueda.";
                }

                res.Res = true;
                return(res);
            }
            catch (Exception ex)
            {
                res.Res     = false;
                res.Message = ex.Message;
                return(res);
            }
        }
Exemplo n.º 10
0
        // Token: 0x060003AD RID: 941 RVA: 0x0003FF88 File Offset: 0x0003E188
        private async void YandexMoney_LoadAsync(object sender, EventArgs e)
        {
            this.labelProxy.Text   = YandexMoney._proxyStatus;
            this.ClientId          = Settings.Default.YansexClientId;
            this.RedirectUri       = Settings.Default.YandexRedirectUri;
            YandexMoney.auth.Token = Settings.Default.YandexToken;
            bool flag = string.IsNullOrEmpty(this.ClientId) || string.IsNullOrEmpty(this.RedirectUri);

            if (flag)
            {
                this.label1.Text = "Заполните настройки.";
            }
            else
            {
                try
                {
                    this.webBrowser1.Visible = false;
                    this.label1.Text         = "Проверка подключения.";
                    Label  label = this.label1;
                    double?num   = await YandexMoney.GetYandexBalanceAsync();

                    label.Text = "Подключено. Баланс = " + num;
                    label      = null;
                    num        = null;
                    string text = await YandexMoney.GetYandexOrderHistoryAsync();

                    string hist = text;
                    text = null;
                    this.labelHist.Text = hist;
                    return;
                }
                catch (Exception ex)
                {
                    this.label1.Text         = "Не подключено: " + ex.Message;
                    this.webBrowser1.Visible = true;
                }
                this.webBrowser1.Refresh();
                YandexMoney.Wrapper             wrapper = new YandexMoney.Wrapper(this.webBrowser1);
                YandexMoney.AuthorizationBroker ab      = new YandexMoney.AuthorizationBroker();
                string text2 = await ab.AuthorizeAsync(YandexMoney.Connection, wrapper, YandexMoney.hp.AuthorizationdUri.ToString(), new AuthorizationRequestParams
                {
                    ClientId    = this.ClientId,
                    RedirectUri = this.RedirectUri,
                    Scope       = Scopes.Compose(new string[]
                    {
                        Scopes.AccountInfo,
                        Scopes.OperationHistory,
                        Scopes.OperationDetails
                    })
                });

                string token = text2;
                text2 = null;
                YandexMoney.auth.Token       = token;
                Settings.Default.YandexToken = token;
                Settings.Default.Save();
                AccountInfoRequest <AccountInfoResult> accountInfoRequest = new AccountInfoRequest <AccountInfoResult>(YandexMoney.Connection, new JsonSerializer <AccountInfoResult>());
                AccountInfoResult accountInfoResult2 = await accountInfoRequest.Perform();

                AccountInfoResult accountInfoResult = accountInfoResult2;
                accountInfoResult2 = null;
                this.label1.Text   = "Подключено. Баланс = " + accountInfoResult.Balance;
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// Async call to authorize on MAIL.RU server.
        /// </summary>
        /// <returns>True or false result operation.</returns>
        public async Task <bool> LoginAsync()
        {
            Info = await RequestRepo.AccountInfo();

            return(true);
        }