コード例 #1
0
        public async Task <IEnumerable <dynamic> > SaveOrUpdate(ImagePlottingViewModel ipvm)
        {
            string sql = "dbo.EAppSaveSensorPlotting";

            using (var conn = util.MasterCon())
            {
                try
                {
                    return(await(conn.QueryAsync <dynamic>(sql, new
                    {
                        ipvm.SensorPlotId,
                        ipvm.PlantAreaId,
                        ipvm.EquipmentId,
                        ipvm.UnitType,
                        ipvm.UnitId,
                        ipvm.UnitSensorId,
                        ipvm.PlotType,
                        ipvm.XPos,
                        ipvm.YPos,
                        ipvm.ImageWidth,
                        ipvm.ImageHeight,
                        ipvm.Active,
                        ipvm.UserId
                    }, commandType: CommandType.StoredProcedure)));
                }
                catch (Exception ex)
                {
                    throw new CustomException("Unable to Save Or Update, Please Contact Support!!!", "Error", true, ex);
                }
            }
        }
コード例 #2
0
 public async Task <IActionResult> LoadPlottingDetail([FromBody] ImagePlottingViewModel ipvm)
 {
     try
     {
         return(Ok(await imagePlottingRepo.LoadPlottingDetail(ipvm)));
     }
     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)));
     }
 }
コード例 #3
0
 public async Task <IActionResult> Create([FromBody] ImagePlottingViewModel ipvm)
 {
     try
     {
         CurrentUser cUser = new CurrentUser(HttpContext, _configuration);
         ipvm.UserId = cUser.UserId;
         return(Ok(await imagePlottingRepo.SaveOrUpdate(ipvm)));
     }
     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)));
     }
 }
コード例 #4
0
        public async Task <IEnumerable <dynamic> > LoadPlottingDetail(ImagePlottingViewModel ipvm)
        {
            string sql = "dbo.EAppGetPlottingDetail";

            using (var conn = util.MasterCon())
            {
                try
                {
                    return(await(conn.QueryAsync <dynamic>(sql, new
                    {
                        ipvm.PlotType,
                        ipvm.PlantAreaId,
                        ipvm.EquipmentId,
                        ipvm.UnitType,
                        ipvm.UnitId
                    }, commandType: CommandType.StoredProcedure)));
                }
                catch (Exception ex)
                {
                    throw new CustomException("Unable to Load Plotting Detail, Please Contact Support!!!", "Error", true, ex);
                }
            }
        }