81 lines
No EOL
2.8 KiB
C#
81 lines
No EOL
2.8 KiB
C#
using NLog;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Http;
|
|
using ULA.Cathay.CreditoModel.Credito;
|
|
using ULA.Cathay.ModuloMantenimiento.Commons;
|
|
using ULA.Cathay.ModuloMantenimiento.Json;
|
|
using Ultimus.Interfaces;
|
|
|
|
namespace ULA.Cathay.ModuloMantenimiento.ControllersWebApi
|
|
{
|
|
public class ConfiguracionRenovacionLineasAPIController : ApiController
|
|
{
|
|
private static Logger logger = LogManager.GetLogger("ConfiguracionRenovacionLineasAPIController");
|
|
|
|
private string _IDLogger;
|
|
public string IDLogger
|
|
{
|
|
get { return _IDLogger; }
|
|
set { _IDLogger = string.Format("INCIDENT {0}|", value); }
|
|
}
|
|
|
|
#region ConfiguracionRenovacionLineas
|
|
|
|
#region ObtenerItems
|
|
[HttpGet]
|
|
public List<ConfiguracionRenovacionLineas> ObtenerItems()
|
|
{
|
|
List<ConfiguracionRenovacionLineas> listaConfiguracionRenovacionLineas = null;
|
|
try
|
|
{
|
|
listaConfiguracionRenovacionLineas = new List<ConfiguracionRenovacionLineas>();
|
|
using (CreditoContex db = new CreditoContex())
|
|
{
|
|
listaConfiguracionRenovacionLineas = db.ConfiguracionRenovacionLineas.ToList();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logger.Error(IDLogger + " Error " + Utilities.GetCurrentMethodName() + "=" + ex.Message + ex.StackTrace);
|
|
}
|
|
return listaConfiguracionRenovacionLineas;
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region ModificarItem
|
|
[HttpPost]
|
|
public string ModificarItem(ConfiguracionRenovacionLineas model)
|
|
{
|
|
try
|
|
{
|
|
using (CreditoContex db = new CreditoContex())
|
|
{
|
|
ConfiguracionRenovacionLineas _model = db.ConfiguracionRenovacionLineas.Where(t => t.IdConfiguracion == model.IdConfiguracion).FirstOrDefault();
|
|
if (_model != null)
|
|
{
|
|
_model.DiaEjecucion = model.DiaEjecucion;
|
|
_model.HoraEjecucion = model.HoraEjecucion;
|
|
_model.TotalDiasVencimiento = model.TotalDiasVencimiento;
|
|
db.SaveChanges();
|
|
return TipoCodigoRespuesta.EXITOSO.ToString();
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logger.Error(IDLogger + " Error " + Utilities.GetCurrentMethodName() + "=" + ex.Message + ex.StackTrace);
|
|
return TipoCodigoRespuesta.ERROR.ToString();
|
|
}
|
|
return TipoCodigoRespuesta.ERROR.ToString();
|
|
}
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
}
|
|
} |