Esempio n. 1
0
 public Status()
 {
     id = "";
     name = "";
     description = "";
     statusCategory = new StatusCategory();
 }
Esempio n. 2
0
        /// <summary>
        /// Инициализирует новый экземпляр класса <see cref="VkApi"/>.
        /// </summary>
        public VkApi()
        {
            Browser = new Browser();

            Users    = new UsersCategory(this);
            Friends  = new FriendsCategory(this);
            Status   = new StatusCategory(this);
            Messages = new MessagesCategory(this);
            Groups   = new GroupsCategory(this);
            Audio    = new AudioCategory(this);
            Wall     = new WallCategory(this);
            Database = new DatabaseCategory(this);
            Utils    = new UtilsCategory(this);
            Fave     = new FaveCategory(this);
            Video    = new VideoCategory(this);
            Account  = new AccountCategory(this);
            Photo    = new PhotoCategory(this);
            Docs     = new DocsCategory(this);
            Likes    = new LikesCategory(this);
            Pages    = new PagesCategory(this);
            Gifts    = new GiftsCategory(this);
            Apps     = new AppsCategory(this);
            NewsFeed = new NewsFeedCategory(this);
            Stats    = new StatsCategory(this);
            Auth     = new AuthCategory(this);

            RequestsPerSecond = 3;
        }
Esempio n. 3
0
        /// <summary>
        /// Returns true if OrderStatusOutput instances are equal
        /// </summary>
        /// <param name="other">Instance of OrderStatusOutput to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OrderStatusOutput other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Errors == other.Errors ||
                     Errors != null &&
                     Errors.SequenceEqual(other.Errors)
                     ) &&
                 (
                     IsCancellable == other.IsCancellable ||
                     IsCancellable != null &&
                     IsCancellable.Equals(other.IsCancellable)
                 ) &&
                 (
                     StatusCategory == other.StatusCategory ||
                     StatusCategory != null &&
                     StatusCategory.Equals(other.StatusCategory)
                 ) &&
                 (
                     StatusCode == other.StatusCode ||
                     StatusCode != null &&
                     StatusCode.Equals(other.StatusCode)
                 ));
        }
Esempio n. 4
0
        /// <summary>
        /// Инициализирует новый экземпляр класса <see cref="VkApi"/>.
        /// </summary>
        public VkApi()
        {
            Browser = new Browser();

            Users = new UsersCategory(this);
            Friends = new FriendsCategory(this);
            Status = new StatusCategory(this);
            Messages = new MessagesCategory(this);
            Groups = new GroupsCategory(this);
            Audio = new AudioCategory(this);
            Wall = new WallCategory(this);
            Database = new DatabaseCategory(this);
            Utils = new UtilsCategory(this);
            Fave = new FaveCategory(this);
            Video = new VideoCategory(this);
            Account = new AccountCategory(this);
            Photo = new PhotoCategory(this);
            Docs = new DocsCategory(this);
            Likes = new LikesCategory(this);
            Pages = new PagesCategory(this);
            Gifts = new GiftsCategory(this);
            Apps = new AppsCategory(this);
            NewsFeed = new NewsFeedCategory(this);
            Stats = new StatsCategory(this);
            Auth = new AuthCategory(this);
            Markets = new MarketsCategory(this);
            Execute = new ExecuteCategory(this);

            RequestsPerSecond = 3;
        }
Esempio n. 5
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Errors != null)
         {
             hashCode = hashCode * 59 + Errors.GetHashCode();
         }
         if (IsCancellable != null)
         {
             hashCode = hashCode * 59 + IsCancellable.GetHashCode();
         }
         if (StatusCategory != null)
         {
             hashCode = hashCode * 59 + StatusCategory.GetHashCode();
         }
         if (StatusCode != null)
         {
             hashCode = hashCode * 59 + StatusCode.GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 6
0
        public IActionResult SaveEntity(StatusCategory entity)
        {
            bool   result    = true;
            string message   = string.Empty;
            var    userEmail = User.GetSpecificClaim("Email");

            if (ModelState.IsValid)
            {
                entity.UserModified = userEmail;

                if (entity.Id == 0)
                {
                    entity.UserCreated = User.GetSpecificClaim("Email");
                    _statusCategoryService.Add(entity, out result, out message);
                }
                else
                {
                    _statusCategoryService.UpdateChangedProperties(entity, out result, out message);
                }

                return(new OkObjectResult(new GenericResult(result, message)));
            }
            else
            {
                List <ModelError> allErrors = ModelState.Values.SelectMany(v => v.Errors).ToList();
                return(new OkObjectResult(new GenericResult(false, allErrors)));
            }
        }
Esempio n. 7
0
 public Status()
 {
     id             = "";
     name           = "";
     description    = "";
     statusCategory = new StatusCategory();
 }
Esempio n. 8
0
        /// <summary>
        /// Инициализирует новый экземпляр класса <see cref="VkApi"/>.
        /// </summary>
        public VkApi(ICaptchaSolver captchaSolver = null)
        {
            Browser = new Browser();

            Users    = new UsersCategory(this);
            Friends  = new FriendsCategory(this);
            Status   = new StatusCategory(this);
            Messages = new MessagesCategory(this);
            Groups   = new GroupsCategory(this);
            Audio    = new AudioCategory(this);
            Wall     = new WallCategory(this);
            Board    = new BoardCategory(this);
            Database = new DatabaseCategory(this);
            Utils    = new UtilsCategory(this);
            Fave     = new FaveCategory(this);
            Video    = new VideoCategory(this);
            Account  = new AccountCategory(this);
            Photo    = new PhotoCategory(this);
            Docs     = new DocsCategory(this);
            Likes    = new LikesCategory(this);
            Pages    = new PagesCategory(this);
            Gifts    = new GiftsCategory(this);
            Apps     = new AppsCategory(this);
            NewsFeed = new NewsFeedCategory(this);
            Stats    = new StatsCategory(this);
            Auth     = new AuthCategory(this);
            Markets  = new MarketsCategory(this);
            Execute  = new ExecuteCategory(this);

            RequestsPerSecond = 3;

            MaxCaptchaRecognitionCount = 5;
            _captchaSolver             = captchaSolver;
        }
Esempio n. 9
0
 public CardStatus(string id, string name, string description, StatusCategory category)
 {
     Id          = !string.IsNullOrEmpty(id) ? id : throw new ArgumentNullException(nameof(id));
     Name        = !string.IsNullOrEmpty(name) ? name : throw new ArgumentNullException(nameof(name));
     Description = description;
     Category    = category;
 }
Esempio n. 10
0
        public void Set_TextIsNull_ThrowArgumentNullException()
        {
            var status = new StatusCategory(new VkApi {
                AccessToken = "token"
            });

            status.Set(null);
        }
Esempio n. 11
0
        public void Set_TextIsNull_ThrowArgumentNullException()
        {
            var status = new StatusCategory(new VkApi {
                AccessToken = "token"
            });

            This.Action(() => status.Set(null)).Throws <ArgumentNullException>();
        }
Esempio n. 12
0
 public Status FindStatus(StatusCategory _status)
 {
     for (int i = 0; i < optionList.Count; ++i)
     {
         if (optionList[i].category == _status)
         {
             return(optionList[i]);
         }
     }
     return(null);
 }
Esempio n. 13
0
 public void UpdateChangedProperties(StatusCategory statusCategory, out bool result, out string message)
 {
     _statusCategoryRepository.UpdateChangedProperties(statusCategory.Id, statusCategory, out result, out message);
     if (result)
     {
         SaveChanges();
     }
     else
     {
         Dispose();
     }
 }
Esempio n. 14
0
 public void Add(StatusCategory statusCategory, out bool result, out string message)
 {
     _statusCategoryRepository.Add(statusCategory, out result, out message);
     if (result)
     {
         SaveChanges();
     }
     else
     {
         Dispose();
     }
 }
Esempio n. 15
0
        public async Task <StatusCategory> GetStatusCategory(long id)
        {
            StatusCategory result = null;

            try
            {
                result = await _context.StatusCategories.FindAsync(Convert.ToInt64(id));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(result);
        }
Esempio n. 16
0
        public async Task <Boolean> Update(StatusCategory statusCategory)
        {
            Boolean result = false;

            try
            {
                statusCategory.UpdateDon = DateTime.Now;
                _context.Update(statusCategory);
                result = await _context.SaveChangesAsync() > 0;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(result);
        }
Esempio n. 17
0
File: VkApi.cs Progetto: ShamilS/vk
        /// <summary>
        /// Инициализирует новый экземпляр класса <see cref="VkApi"/>.
        /// </summary>
        public VkApi()
        {
            Browser = new Browser();

            Users    = new UsersCategory(this);
            Friends  = new FriendsCategory(this);
            Status   = new StatusCategory(this);
            Messages = new MessagesCategory(this);
            Groups   = new GroupsCategory(this);
            Audio    = new AudioCategory(this);
            Wall     = new WallCategory(this);
            Database = new DatabaseCategory(this);
            Utils    = new UtilsCategory(this);
            Fave     = new FaveCategory(this);
            Video    = new VideoCategory(this);
            Account  = new AccountCategory(this);
        }
Esempio n. 18
0
        public async Task <IActionResult> Create([FromBody] StatusCategory statusCategory)
        {
            try
            {
                var isCreated = await _coreStatusCategory.AddOrdUpdate(statusCategory);

                if (isCreated)
                {
                    return(Created("", statusCategory));
                }
            }
            catch (Exception exception)
            {
                return(BadRequest(exception));
            }
            return(BadRequest());
        }
        // GET: Match
        public ActionResult Index(int?matchStatus, string searchString, int pageIndex = 1, int pageSize = 10)
        {
            int totalRecord = 0;
            var model       = new MatchDao().ListAll(matchStatus, searchString, ref totalRecord, pageIndex, pageSize);

            ViewBag.SearchString = searchString;

            StatusCategory selectedMatchStatus = new StatusCategory()
            {
                Stt = 0, Name = "---Select one---"
            };

            if (matchStatus != null)
            {
                selectedMatchStatus = new StatusCategoryDao().GetByStt("Match", (int)matchStatus);
            }
            ViewBag.SelectedMatchStatus = selectedMatchStatus;

            ViewBag.Total = totalRecord;
            ViewBag.Page  = pageIndex;

            int maxPage   = 5;
            int totalPage = 0;

            if (totalRecord % pageSize != 0)
            {
                totalPage = (int)(totalRecord / pageSize) + 1;
            }
            else
            {
                totalPage = (int)(totalRecord / pageSize);
            }

            ViewBag.TotalPage = totalPage;
            ViewBag.MaxPage   = maxPage;
            ViewBag.First     = 1;
            ViewBag.Last      = totalPage;
            ViewBag.Next      = pageIndex + 1;
            ViewBag.Prev      = pageIndex - 1;

            return(View(model));
        }
Esempio n. 20
0
        /// <summary>
        /// Инициализирует новый экземпляр класса <see cref="VkApi"/>.
        /// </summary>
        public VkApi()
        {
            ServicePointManager.ServerCertificateValidationCallback = new PositiveCertificatePolicy().ServerCertificateValidationCallback;

            Browser = new Browser();

            Users    = new UsersCategory(this);
            Friends  = new FriendsCategory(this);
            Status   = new StatusCategory(this);
            Messages = new MessagesCategory(this);
            Groups   = new GroupsCategory(this);
            Audio    = new AudioCategory(this);
            Wall     = new WallCategory(this);
            Database = new DatabaseCategory(this);
            Utils    = new UtilsCategory(this);
            Fave     = new FaveCategory(this);
            Video    = new VideoCategory(this);
            Account  = new AccountCategory(this);
            Likes    = new LikesCategory(this);
            Photo    = new PhotoCategory(this);
        }
Esempio n. 21
0
        /// <summary>
        /// Инициализирует новый экземпляр класса <see cref="VkApi"/>.
        /// </summary>
        public VkApi()
        {
            Browser = new Browser();

            Users    = new UsersCategory(this);
            Friends  = new FriendsCategory(this);
            Status   = new StatusCategory(this);
            Messages = new MessagesCategory(this);
            Groups   = new GroupsCategory(this);
            Audio    = new AudioCategory(this);
            Wall     = new WallCategory(this);
            Database = new DatabaseCategory(this);
            Utils    = new UtilsCategory(this);
            Fave     = new FaveCategory(this);
            Video    = new VideoCategory(this);
            Account  = new AccountCategory(this);
            Photo    = new PhotoCategory(this);
            Docs     = new DocsCategory(this);

            RequestsPerSecond = 3;
            AutoTokenRefresh  = false;
        }
Esempio n. 22
0
        public void Get_AccessTokenInvalid_ThrowAccessTokenInvalidException()
        {
            var status = new StatusCategory(vk: new VkApi());

            Assert.That(del: () => status.Get(userId: 1), expr: Throws.InstanceOf <AccessTokenInvalidException>());
        }
Esempio n. 23
0
        /// <summary>
        /// Инициализирует новый экземпляр класса <see cref="VkApi"/>.
        /// </summary>
        public VkApi()
        {
            Browser = new Browser();

            Users = new UsersCategory(this);
            Friends = new FriendsCategory(this);
            Status = new StatusCategory(this);
            Messages = new MessagesCategory(this);
            Groups = new GroupsCategory(this);
            Audio = new AudioCategory(this);
            Wall = new WallCategory(this);
            Database = new DatabaseCategory(this);
            Utils = new UtilsCategory(this);
            Fave = new FaveCategory(this);
            Video = new VideoCategory(this);
			Account = new AccountCategory(this);
            Photo = new PhotoCategory(this);
            Docs = new DocsCategory(this);
            Likes = new LikesCategory(this);
			
            RequestsPerSecond = 3;
        }
Esempio n. 24
0
        public void Set_AccessTokenInvalid_ThrowAccessTokenInvalidException()
        {
            var status = new StatusCategory(new VkApi());

            This.Action(() => status.Set("test")).Throws <AccessTokenInvalidException>();
        }
Esempio n. 25
0
 public TagStatusOther(StatusCategory cat, string name) : base(name) => category = cat;
Esempio n. 26
0
 public async Task CreateModel(StatusCategory statuscategory)
 {
     _context.Add(statuscategory);
     await _context.SaveChangesAsync();
 }
Esempio n. 27
0
 public TagStatusValueOther(StatusCategory cat, TagStatusType type, string name) : base(type, name) => category = cat;
Esempio n. 28
0
        public void Set_AccessTokenInvalid_ThrowAccessTokenInvalidException()
        {
            var status = new StatusCategory(new VkApi());

            status.Set("test");
        }
Esempio n. 29
0
 internal StatusCategoryExtended(StatusCategory statusCategory, VkApi vk)
 {
     _status = statusCategory;
     _vk = vk;
 }
Esempio n. 30
0
        public void Set_AccessTokenInvalid_ThrowAccessTokenInvalidException()
        {
            var status = new StatusCategory(new VkApi());

            Assert.That(() => status.Set("test"), Throws.InstanceOf <AccessTokenInvalidException>());
        }
Esempio n. 31
0
File: VkApi.cs Progetto: justloot/vk
        /// <summary>
        /// Инициализирует новый экземпляр класса <see cref="VkApi"/>.
        /// </summary>
        public VkApi()
        {
            Browser = new Browser();

            Users = new UsersCategory(this);
            Friends = new FriendsCategory(this);
            Status = new StatusCategory(this);
            Messages = new MessagesCategory(this);
            Groups = new GroupsCategory(this);
            Audio = new AudioCategory(this);
            Wall = new WallCategory(this);
            Database = new DatabaseCategory(this);
            Utils = new UtilsCategory(this);
            Fave = new FaveCategory(this);
            Video = new VideoCategory(this);
			Account = new AccountCategory(this);

            ApiVersion = "5.9";
        }