Ejemplo n.º 1
0
        private async void DoubleTap(object sender, EventArgs e)
        {
            var             stackLayout = sender as StackLayout;
            var             image       = stackLayout.BindingContext as ImageData;
            var             user        = Parent.BindingContext as UserData;
            List <LikeData> likes       = await App.Database.GetLikesAsync();

            foreach (var like in likes)
            {
                if (like.UserId == user.Id && like.PostId == image.Id)
                {
                    await App.Database.DeleteLikeAsync(like);

                    image.Likes--;
                    await App.Database.SaveImageAsync(image);

                    (this.BindingContext as MainViewModel)?.GetImages();
                    return;
                }
            }
            LikeData addLike = new LikeData()
            {
                Id = 0, PostId = image.Id, UserId = user.Id
            };
            await App.Database.SaveLikeAsync(addLike);

            image.Likes++;
            await App.Database.SaveImageAsync(image);

            (this.BindingContext as MainViewModel)?.GetImages();
        }
Ejemplo n.º 2
0
        protected void LoadData(string keyword)
        {
            lookUpEdit1.EditValue = null;

            string exp = LikeData.CreateContainsPattern(keyword);
            List <MaterialEntity> materials = materialDal.QueryMaterial(exp);

            lookUpEdit1.Properties.DataSource = materials;
            lookUpEdit1.ShowPopup();
            lookUpEdit1.Text = keyword;
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> DislikeComment(LikeData id)
        {
            var err = await id.DislikeComment(User.Identity.Name, _context);

            if (err != null)
            {
                return(BadRequest(err));
            }

            return(Ok());
        }
Ejemplo n.º 4
0
        private void _WSServer_Like(LikeData data)
        {
            switch (data.name)
            {
            case "heart":
                Debug.Log("HEART");
                _MainCamera.backgroundColor = data.color;
                break;

            case "star":
                Debug.Log("STAR");
                _MainCamera.backgroundColor = data.color;
                break;
            }
        }
Ejemplo n.º 5
0
        protected override string OnCreateLookupDisplayFilter(string text, string displayMember)
        {
            List <CriteriaOperator> subStringOperators = new List <CriteriaOperator>();

            foreach (string sString in text.Split(' '))
            {
                string exp = LikeData.CreateContainsPattern(sString);
                List <CriteriaOperator> columnsOperators = new List <CriteriaOperator>();
                foreach (GridColumn col in Columns)
                {
                    if (col.Visible && col.ColumnType == typeof(string))
                    {
                        columnsOperators.Add(new BinaryOperator(col.FieldName, exp, BinaryOperatorType.Like));
                    }
                }
                subStringOperators.Add(new GroupOperator(GroupOperatorType.Or, columnsOperators));
            }
            return(new GroupOperator(GroupOperatorType.And, subStringOperators).ToString());
        }
Ejemplo n.º 6
0
    private void Update()
    {
        if (isTransition)
        {
            alpha         += 10;
            _overray.color = new Color32(25, 25, 25, (byte)alpha);
            if (alpha >= 160)
            {
                isTransition = false;
            }
        }

        if (moveEffect)
        {
            var epos = Effect.transform.position;
            Effect.transform.position = new Vector3(epos.x, epos.y + moveSpeed, epos.z);
            if (Effect.transform.position.y >= Screen.height + Effect.GetComponent <RectTransform>().sizeDelta.y)
            {
                moveEffect = false;

                if (GameObject.Find("DEMO") == null)
                {
                    // いいね!の送信
                    var data = new LikeData(effectName, colors[currentColor]);
                    GameObject.Find("WSClient").GetComponent <WSClient>().Send("LIKE", data);
                }

                // ダイアログの表示と画面遷移
                ReLike      = true;
                dialogShown = true;

                DialogManager.Instance.SetLabel("OK", "キャンセル", "閉じる");
                DialogManager.Instance.ShowSubmitDialog(
                    "いいね!を送信しました。",
                    (ret) => { SceneManager.LoadScene("Like"); }
                    );
            }
        }
    }
Ejemplo n.º 7
0
 public IActionResult Like([FromBody] LikeData data)
 {
     _boardService.Like(User, data.PostId, _mapper.Map <bo.LikeType?>(data.LikeType));
     return(Ok());
 }