public async Task <IEnumerable <dynamic> > GetAssetClassByAssetDetail([FromBody] ListEMaintAssetClassByAssetIDViewModel lehvm)
        {
            string sql = "dbo.OAppDBAssetClassDetailsByAssetID";

            using (var conn = util.MasterCon())
            {
                try
                {
                    return(await(conn.QueryAsync <dynamic>(sql, new
                    {
                        lehvm.AssetName
                    }, commandType: CommandType.StoredProcedure)));
                }
                catch (Exception ex)
                {
                    throw new CustomException("Unable to Load Data, Please Contact Support!!!", "Error", true, ex);
                }
            }
        }
Exemple #2
0
        //[SKFAuthorize("PRG12:P1")]
        public async Task <IActionResult> GetAssetClassByAssetDetail([FromBody] ListEMaintAssetClassByAssetIDViewModel lehvm)
        {
            CurrentUser cUser = new CurrentUser(HttpContext, _configuration);

            try
            {
                lehvm.AssetName = lehvm.AssetName;
                //lehvm.ClientSiteId
                var result = await observerDashboardRepo.GetAssetClassByAssetDetail(lehvm);

                await auditLogService.LogActivity(cUser.UserId, cUser.HostIP, cUser.SessionId, "Area", "Area list Loaded.");

                return(Ok(result));
            }
            catch (CustomException cex)
            {
                var responseObj = new EmaintenanceMessage(cex.Message, cex.Type, cex.IsException, cex.Exception?.ToString());
                return(StatusCode(StatusCodes.Status500InternalServerError, responseObj));
            }
            catch (Exception ex)
            {
                return(Ok(new EmaintenanceMessage(ex.Message)));
            }
        }