public string EditStatus(StatusEdit edit)
        {
            Result result = new Result();
            var    model  = db.tDanhMucSP.First(x => x.MaSP == edit.MaSP);

            if (edit.Status == "1")
            {
                model.Status = false;
                db.SaveChanges();
                result = new Result()
                {
                    ErrorCode    = "0",
                    ErrorMessage = "edit success"
                };
            }

            if (edit.Status == "0")
            {
                model.Status = true;
                db.SaveChanges();
                result = new Result()
                {
                    ErrorCode    = "0",
                    ErrorMessage = "edit success"
                };
            }
            return(JsonConvert.SerializeObject(result));
        }
Beispiel #2
0
 // Use this for initialization
 void Awake()
 {
     manager = GameObject.Find("PlayerManager").GetComponent <PlayerManager>();
     status  = manager.Statuses[GameManager.SelectLevel];
     transform.localScale = new Vector2(HitSize, HitSize);
     manager.Balls.Add(this);
     wallHitter = GameObject.Find("GameManager").GetComponent <WallHitter>();
     rb         = GetComponent <Rigidbody2D>();
     Setting();
     IsStoped = false;
 }