public async Task <IActionResult> SavePlantGeoLocation([FromBody]  PlantGeoLocationViewModel pglvm)
 {
     try
     {
         return(Ok(await imagePlottingRepo.SavePlantGeoLocation(pglvm)));
     }
     catch (CustomException cex)
     {
         var returnObj = new EmaintenanceMessage(cex.Message, cex.Type, cex.IsException, cex.Exception?.ToString());
         return(StatusCode(StatusCodes.Status500InternalServerError, returnObj));
     }
     catch (Exception ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, new EmaintenanceMessage(ex.Message)));
     }
 }
Exemplo n.º 2
0
        public async Task <IEnumerable <dynamic> > SavePlantGeoLocation(PlantGeoLocationViewModel pglvm)
        {
            string sql = "dbo.EAppSavePlantGeoLocation ";

            using (var conn = util.MasterCon())
            {
                try
                {
                    return(await(conn.QueryAsync <dynamic>(sql, new
                    {
                        pglvm.PlantAreaId,
                        pglvm.LatPos,
                        pglvm.LongPos,
                    }, commandType: CommandType.StoredProcedure)));
                }
                catch (Exception ex)
                {
                    throw new CustomException("Unable to Save Or Update, Please Contact Support!!!", "Error", true, ex);
                }
            }
        }