Example #1
0
        public async Task <List <TRIALSpIndex> > GetIndex(Int64 ScreenId, Int64 UserId, Int64 RecordsPerPage, Int64 PageNo, Int64 TableId, Boolean LastPage)
        {
            TRIALSpIndex result = new TRIALSpIndex();

            try
            {
                string csql = @" EXEC spGetPageData
                    @pi_mScreenId
                    , @pi_mUserId
                    , @pi_RecordsPerPage
                    , @pi_PageNo
                    , @pi_mTableId
                    , @pi_LastPage";
                List <SqlParameter> sqlparam = new List <SqlParameter>()
                {
                    new SqlParameter("@pi_mScreenId", ScreenId),
                    new SqlParameter("@pi_mUserId", UserId),
                    new SqlParameter("@pi_RecordsPerPage", RecordsPerPage),
                    new SqlParameter("@pi_PageNo", PageNo),
                    new SqlParameter("@pi_mTableId", TableId),
                    new SqlParameter("@pi_LastPage", LastPage),
                };
                return(await _Context.TRIALSpIndex.FromSql(csql, sqlparam.ToArray()).ToListAsync());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        public async Task <TRIALSpIndex> GetEntry(Int64 id)
        {
            try
            {
                TRIALSpIndex result = await _Context.TRIALSpIndex.FromSql("Exec spmTRIALSpEntry @pi_mTRIALSpId", new SqlParameter("@pi_mTRIALSpId", id)).SingleOrDefaultAsync();

                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
        public async Task <IActionResult> Get(Int64 id)
        {
            TRIALSpIndex result = await _repo.GetEntry(id);

            return(Ok(result));
        }