Exemple #1
0
        public async Task <IActionResult> Save([FromBody] FftViewModel fvm)
        {
            try
            {
                var result = await ffttRepo.Update(fvm);

                return(Ok(result));
            }
            catch (Exception ex)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, new EmaintenanceMessage(ex.Message)));
            }
        }
Exemple #2
0
        public async Task <int> SaveOrUpdatefft([FromBody] FftViewModel mvm)
        {
            // string sql = "dbo.ENAppSaveSites";

            try
            {
                string sql = @"Insert into dbo.Tempfft(id, time)
                           values(@id,@time)";

                using (var conn = util.MasterCon())
                {
                    return(await conn.ExecuteAsync(sql, new { mvm.id, mvm.time, }));
                }
            }
            catch (Exception ex)
            {
                throw new CustomException("Unable to Save Or Update, Please Contact Support!!!", "Error", true, ex);
            }
        }
Exemple #3
0
        public async Task <IEnumerable <dynamic> > Update([FromBody] FftViewModel fvm)
        {
            string sql = "";

            using (var conn = util.MasterCon())
            {
                try
                {
                    return(await(conn.QueryAsync <dynamic>(sql, new

                    {
                        //fvm.SEFftHistoryId,
                        //fvm.startTime,
                        //fvm.endTime,
                    }, commandType: CommandType.StoredProcedure)));
                }
                catch (Exception ex)
                {
                    throw new CustomException("Unable to Save Or Update, Please Contact Support!!!", "Error", true, ex);
                }
            }
        }