예제 #1
0
        public async Task <JsonResult> DeletarPagina([FromBody] object page, string token)
        {
            dynamic objEn = page;
            string  a     = objEn.idPagina.ToString();

            if (await Seguranca.validaTokenAsync(token))
            {
                Page obj = PageDAO.GetAll().Where(x => x.ID == Convert.ToInt32(a)).FirstOrDefault();
                return(Json(new { msg = PageDAO.Remove(obj) }));
                //return Json(new { msg = false });
            }
            else
            {
                return(Json(new { msg = false }));
            }
        }
예제 #2
0
 public void RemovePageTest()
 {
     var obj    = PageDAO.GetAll().Find(x => x.ID == 1);
     var result = PageDAO.Remove(obj);
 }