public Status() { id = ""; name = ""; description = ""; statusCategory = new StatusCategory(); }
/// <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; }
/// <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) )); }
/// <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; }
/// <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); } }
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))); } }
public Status() { id = ""; name = ""; description = ""; statusCategory = new StatusCategory(); }
/// <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; }
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; }
public void Set_TextIsNull_ThrowArgumentNullException() { var status = new StatusCategory(new VkApi { AccessToken = "token" }); status.Set(null); }
public void Set_TextIsNull_ThrowArgumentNullException() { var status = new StatusCategory(new VkApi { AccessToken = "token" }); This.Action(() => status.Set(null)).Throws <ArgumentNullException>(); }
public Status FindStatus(StatusCategory _status) { for (int i = 0; i < optionList.Count; ++i) { if (optionList[i].category == _status) { return(optionList[i]); } } return(null); }
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(); } }
public void Add(StatusCategory statusCategory, out bool result, out string message) { _statusCategoryRepository.Add(statusCategory, out result, out message); if (result) { SaveChanges(); } else { Dispose(); } }
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); }
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); }
/// <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); }
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)); }
/// <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); }
/// <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; }
public void Get_AccessTokenInvalid_ThrowAccessTokenInvalidException() { var status = new StatusCategory(vk: new VkApi()); Assert.That(del: () => status.Get(userId: 1), expr: Throws.InstanceOf <AccessTokenInvalidException>()); }
/// <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; }
public void Set_AccessTokenInvalid_ThrowAccessTokenInvalidException() { var status = new StatusCategory(new VkApi()); This.Action(() => status.Set("test")).Throws <AccessTokenInvalidException>(); }
public TagStatusOther(StatusCategory cat, string name) : base(name) => category = cat;
public async Task CreateModel(StatusCategory statuscategory) { _context.Add(statuscategory); await _context.SaveChangesAsync(); }
public TagStatusValueOther(StatusCategory cat, TagStatusType type, string name) : base(type, name) => category = cat;
public void Set_AccessTokenInvalid_ThrowAccessTokenInvalidException() { var status = new StatusCategory(new VkApi()); status.Set("test"); }
internal StatusCategoryExtended(StatusCategory statusCategory, VkApi vk) { _status = statusCategory; _vk = vk; }
public void Set_AccessTokenInvalid_ThrowAccessTokenInvalidException() { var status = new StatusCategory(new VkApi()); Assert.That(() => status.Set("test"), Throws.InstanceOf <AccessTokenInvalidException>()); }
/// <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"; }