Esempio n. 1
0
        public async Task <IActionResult> GetScreenRights(Int64 pUserId, Int64 pMenuId)
        {
            try
            {
                ScreenRight result = new ScreenRight();

                result = await _repo_Menu.GetScreenRight(pUserId, pMenuId);

                return(Ok(result));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message.ToString()));
            }
        }
Esempio n. 2
0
 public async Task <ScreenRight> GetScreenRight(Int64 pUserId, Int64 pMenuId)
 {
     try
     {
         ScreenRight         result   = new ScreenRight();
         string              csql     = @" EXEC spGetScreenRight
                 @pi_UserId, @pi_MenuId";
         List <SqlParameter> sqlparam = new List <SqlParameter>()
         {
             new SqlParameter("@pi_UserId", pUserId),
             new SqlParameter("@pi_MenuId", pMenuId)
         };
         return(await _Context.GetScreenRights.FromSql(csql, sqlparam.ToArray()).SingleOrDefaultAsync());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }