protected void Grid_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "ver") { VisualizacionComprobanteDto dto = new VisualizacionComprobanteDto(); dto.ArchivoAsociadoId = Convert.ToInt64(this.Grid.DataKeys[Convert.ToInt32(e.CommandArgument)].Value); string ip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (string.IsNullOrEmpty(ip)) { ip = Request.ServerVariables["REMOTE_ADDR"]; } if (string.IsNullOrEmpty(ip)) { ip = Request.UserHostAddress; } dto.Ip = ip; IComprobanteService svc = ServiceFactory.GetComprobanteService(); dto.UsuarioIdAuditoria = UIHelper.GetCustomIdentity().UserId; svc.AgregarVisualizacion(dto); Buscar(); //// Actualizo Estado //EstadoArchivoAsociadoDto estado = svc.ObtenerEstado(CodigosEstadoArchivoAsociado.Visualizado); //int columnaEstado = 4; //this.Grid.Rows[Convert.ToInt32(e.CommandArgument)].Cells[columnaEstado].Text = estado.Descripcion; //this.Grid.Rows[Convert.ToInt32(e.CommandArgument)].Cells[columnaEstado].ForeColor = Color.Green; } } catch (Exception ex) { ExceptionManager.Instance.HandleException(ex); } }
private void CargarEstadoComprobantes() { IComprobanteService svc = ServiceFactory.GetComprobanteService(); EstadoComprobantesDto dto = svc.ObtenerEstadoComprobantes(this.BaseMaster.ClienteId); this.CargarEstados(dto); this.pnlEstadoComprobantes.Visible = true; }
public ReporteRegistroControlController() { reportService = reportService ?? new ReporteRegistroControlService(); reportExcelService = reportExcelService ?? new ReporterService(); catalagoService = new CatalogoService(); serviceComprobante = new ComprobanteService(); usuarioAreaService = usuarioAreaService ?? new UsuarioAreaService(); usuarioService = usuarioService ?? new UserService(); }
protected override void InicializarControles() { base.InicializarControles(); // Estados IComprobanteService comprobanteSvc = ServiceFactory.GetComprobanteService(); List <EstadoArchivoAsociadoDto> estados = comprobanteSvc.ObtenerEstados(); UIHelper.LoadCbo(estados, this.ddlEstado, Constants.ValorInicialDdl, "Id", "Descripcion"); }
public ComprobanteController(IComprobanteService svc, IPartidasService svcPart, IUsuarioEmpresaService usEmpServ) { service = svc; servicePartida = svcPart; usuarioAreaService = new UsuarioAreaService(); usuarioEmpService = usEmpServ; areaOperativaService = areaOperativaService ?? new AreaOperativaService(); catalagoService = catalagoService ?? new CatalogoDetalleService(); comprobanteDetalleServ = comprobanteDetalleServ ?? new ComprobanteDetalleService(); empresaService = empresaService ?? new EmpresaService(); }
public ReporteRegistroControlController(IReporteRegistroControlService rep, IReporterService repexcel, ICatalogoService cat, ICatalogoService serv, IComprobanteService comprob, IUsuarioAreaService userArea, IAreaOperativaService area, IUserService usuario) { reportService = rep; reportExcelService = repexcel; catalagoService = serv; serviceComprobante = comprob; usuarioAreaService = userArea; areaOperativaService = area; usuarioService = usuario; catalogoService = cat; }
public ReportePartidasAprController() { partAprSrv = partAprSrv ?? new ReportePartidasAprService(); // reportExcelService = reportExcelService ?? new ReporterService(); catalagoService = new CatalogoService(); serviceComprobante = new ComprobanteService(); usuarioAreaService = usuarioAreaService ?? new UsuarioAreaService(); usuarioService = usuarioService ?? new UserService(); partApConcSrv = partApConcSrv ?? new ReportePartidasAprConciliablesService(); parService = parService ?? new ParametroService(); Ctaservice = Ctaservice ?? new CuentaContableService(); }
private static List <TipoComprobanteDto> ObtenerTiposDeComprobante(IComprobanteService comprobanteSvc) { const string key = "ObtenerTiposDeComprobante"; List <TipoComprobanteDto> tiposComprobante = HttpContext.Current.Cache.Get(key) as List <TipoComprobanteDto>; if (tiposComprobante == null) { tiposComprobante = comprobanteSvc.ObtenerTiposComprobantes(); HttpContext.Current.Cache.Add(key, tiposComprobante, null, Cache.NoAbsoluteExpiration, new TimeSpan(1, 0, 0), CacheItemPriority.Normal, null); } return(tiposComprobante); }
protected override void InicializarControles() { base.InicializarControles(); // Estados IComprobanteService comprobanteSvc = ServiceFactory.GetComprobanteService(); List <EstadoArchivoAsociadoDto> estados = comprobanteSvc.ObtenerEstados(); foreach (var estado in estados) { if (estado.Codigo != CodigosEstadoArchivoAsociado.Eliminado) { this.ddlEstado.Items.Add(new ListItem(estado.Descripcion, estado.Id.ToString())); } } this.ddlEstado.Items.Insert(0, new ListItem(Constants.ValorInicialDdl, Constants.CboNullValue)); }
private static string ObtenerArchivo(HttpContext context, long archivoId) { CustomPrincipal principal = context.User as CustomPrincipal; CustomIdentity identity = principal.Identity as CustomIdentity; IComprobanteService svc = ServiceFactory.GetComprobanteService(); string file = string.Empty; if (principal.IsInRole(Roles.Administrador)) { file = svc.ObtenerArchivo(archivoId); } else if (principal.IsInRole(Roles.Cliente)) { file = svc.ObtenerArchivo(archivoId, identity.ClientId.Value); } return(file); }
public ReportePartidasAprController(IReportePartidasAprService PartService, ICatalogoService cat, ICatalogoService serv, IComprobanteService comprob, IUsuarioAreaService userArea, IAreaOperativaService area, IUserService usuario, IReportePartidasAprConciliableService PartApConcSrv, IUsuarioEmpresaService objUsuarioAreaService) { // reportService = rep; // reportExcelService = repexcel; catalagoService = serv; serviceComprobante = comprob; usuarioAreaService = userArea; areaOperativaService = area; usuarioService = usuario; catalogoService = cat; partAprSrv = PartService; comprobanteService = comprobanteService ?? new ComprobanteService(); eventoServ = eventoServ ?? new EventosService(); partApConcSrv = PartApConcSrv; usuarioEmpresaService = objUsuarioAreaService; parService = parService ?? new ParametroService(); }
protected void btnAceptar_Click(object sender, EventArgs e) { if (Page.IsValid) { try { if (!this.BaseMaster.EsCliente) { // Cargo los valores de los inputs Dictionary <long, DateTime?> ArchivoAsociadoIdsFechaRecepcion = new Dictionary <long, DateTime?>(); foreach (string key in this.Request.Form.AllKeys) { if (key.StartsWith("txtFechaDeRecepcion_")) { string dateValue = this.Request.Form[key]; long archivoAsociadoId = Convert.ToInt64(key.Split('_')[1]); DateTime?fechaRecepcion = null; if (!String.IsNullOrEmpty(dateValue)) { fechaRecepcion = DateTime.ParseExact(dateValue, "dd/MM/yyyy", null); } ArchivoAsociadoIdsFechaRecepcion.Add(archivoAsociadoId, fechaRecepcion); } } // Tengo que guardar los cambios IComprobanteService comprobanteSvc = ServiceFactory.GetComprobanteService(); comprobanteSvc.AsociarFechaDeRecepcion(ArchivoAsociadoIdsFechaRecepcion, UIHelper.GetCustomIdentity().UserId); } Buscar(); // vuelve a buscar para cargar los datos } catch (Exception ex) { ExceptionManager.Instance.HandleException(ex); } } }
protected void Grid_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "eliminar") { long archivoAsociadoId = Convert.ToInt64(this.Grid.DataKeys[Convert.ToInt32(e.CommandArgument)].Value); IComprobanteService svc = ServiceFactory.GetComprobanteService(); svc.CambiarEstado(archivoAsociadoId, CodigosEstadoArchivoAsociado.Eliminado); Buscar(); } else if (e.CommandName == "ver") { long archivoAsociadoId = Convert.ToInt64(this.Grid.DataKeys[Convert.ToInt32(e.CommandArgument)].Value); this.Response.Redirect(string.Format("{0}?Id={1}", pagComprobanteAuditoria, archivoAsociadoId), true); } } catch (Exception ex) { ExceptionManager.Instance.HandleException(ex); } }
protected virtual void InicializarControles() { IComprobanteService comprobanteSvc = ServiceFactory.GetComprobanteService(); // Tipos Comprobante List <TipoComprobanteDto> tiposComprobante = ObtenerTiposDeComprobante(comprobanteSvc); UIHelper.LoadCbo(tiposComprobante, this.ddlTipoComprobanteControl, Constants.ValorInicialDdl, "Id", "Descripcion"); // Tipos Contrato List <TipoContratoDto> tiposContrato = ObtenerTiposDeContrato(comprobanteSvc); UIHelper.LoadCbo(tiposContrato, this.ddlTipoContratoControl, Constants.ValorInicialDdl, "Id", "Descripcion"); // Mes Facturacion this.CargarListaMeses(this.ddlMesFacturacionControl, false); // Anio Facturacion List <int> aniosFacturacion = comprobanteSvc.ObtenerAniosFacturacion(); UIHelper.LoadBasicCbo(aniosFacturacion, this.ddlAnioFacturacionControl, Constants.ValorInicialDdl); }
protected void Page_Load(object sender, EventArgs e) { try { HasPermissionToSeeMe(Operaciones.MensajesAlertasClientes); this.comprobanteSvc = ServiceFactory.GetComprobanteService(); if (!this.IsPostBack) { if (this.Request.QueryString["Id"] != null) { ComprobanteCriteria criteria = new ComprobanteCriteria(); this.ArchivoAsociadoId = long.Parse(this.Request.QueryString["Id"]); ComprobanteDto comprobante = this.comprobanteSvc.ObtenerComprobanteDeArchivoAsociado(ArchivoAsociadoId); this.lblComprobante.Text = comprobante.NroComprobante.ToString(); } this.Buscar(); } } catch (Exception ex) { ExceptionManager.Instance.HandleException(ex); } }
public ComprobanteController(IComprobanteService comprobanteService) { this._comprobanteService = comprobanteService; }