コード例 #1
0
 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();
 }
コード例 #2
0
 public FileController()
 {
     //registroService = registroService ?? new RegistroControlService();
     partService          = partService ?? new PartidasService();
     centService          = centService ?? new CentroCostoService();
     empService           = empService ?? new EmpresaService();
     ctaService           = ctaService ?? new CuentaContableService();
     cncService           = cncService ?? new ConceptoCostoService();
     registroService      = registroService ?? new RegistroControlService();
     monedaSrv            = monedaSrv ?? new MonedaService();
     areaOperativaService = areaOperativaService ?? new AreaOperativaService();
     paramService         = paramService ?? new ParametroService();
     paramEmpresaAreaCentroCostoService = paramEmpresaAreaCentroCostoService ?? new EmpresaAreasCentroCostoService();
     paramEmpresaCentro = paramEmpresaCentro ?? new EmpresaCentroService();
     fileService        = fileService ?? new FilesProvider(partService, centService, empService, cncService, ctaService, monedaSrv, areaOperativaService, paramService, paramEmpresaAreaCentroCostoService, paramEmpresaCentro);
 }
コード例 #3
0
 public RegistroControlService(RegistroControl ao)
     : base(ao)
 {
     registroControl           = ao;
     fileProvider              = fileProvider ?? new FilesProvider();
     partidaService            = partidaService ?? new PartidasService();
     ctaService                = ctaService ?? new CuentaContableService();
     centroCostoService        = centroCostoService ?? new CentroCostoService();
     empresaService            = empresaService ?? new EmpresaService();
     conceptoCostoService      = conceptoCostoService ?? new ConceptoCostoService();
     monedaService             = monedaService ?? new MonedaService();
     paramService              = paramService ?? new ParametroService();
     areaOperativaService      = areaOperativaService ?? new AreaOperativaService();
     empresaAreaCentroCostoSrv = empresaAreaCentroCostoSrv ?? new EmpresaAreasCentroCostoService();
     empresaCentroSrv          = empresaCentroSrv ?? new EmpresaCentroService();
     empresaUsuarioService     = empresaUsuarioService ?? new UsuarioEmpresaService();
 }
コード例 #4
0
 public RegistroControlService(RegistroControl ao, IFilesProvider provider, IPartidasService partSvc, ICuentaContableService ctaSvc, ICentroCostoService centroCosSvc, IEmpresaService empSvc,
                               IConceptoCostoService cocosSvc)
     : base(ao)
 {
     registroControl           = ao ?? new RegistroControl();
     fileProvider              = provider ?? new FilesProvider();
     partidaService            = partSvc ?? new PartidasService();
     ctaService                = ctaSvc ?? new CuentaContableService();
     centroCostoService        = centroCosSvc ?? new CentroCostoService();
     empresaService            = empSvc ?? new EmpresaService();
     conceptoCostoService      = cocosSvc ?? new ConceptoCostoService();
     monedaService             = monedaService ?? new MonedaService();
     paramService              = paramService ?? new ParametroService();
     areaOperativaService      = areaOperativaService ?? new AreaOperativaService();
     empresaAreaCentroCostoSrv = empresaAreaCentroCostoSrv ?? new EmpresaAreasCentroCostoService();
     empresaCentroSrv          = empresaCentroSrv ?? new EmpresaCentroService();
     empresaUsuarioService     = empresaUsuarioService ?? new UsuarioEmpresaService();
 }
コード例 #5
0
        public PartidasModel CreateSinglePartida(PartidasModel par)
        {
            centroCostoService   = centroCostoService ?? new CentroCostoService();
            partidaService       = partidaService ?? new PartidasService();
            conceptoCostoService = conceptoCostoService ?? new ConceptoCostoService();
            contableService      = contableService ?? new CuentaContableService();
            empresaService       = empresaService ?? new EmpresaService();
            monedaService        = monedaService ?? new  MonedaService();

            IFormatProvider culture    = new CultureInfo("en-US", true);
            string          dateFormat = "MMddyyyy";
            //Counting number of record already exist.
            var counterRecords = partidaService.Count();

            var centroCostos   = centroCostoService.GetAll();
            var conceptoCostos = conceptoCostoService.GetAll();
            var cuentas        = contableService.GetAll();
            var empresa        = empresaService.GetAll();

            var context           = new System.ComponentModel.DataAnnotations.ValidationContext(par, serviceProvider: null, items: null);
            var validationResults = new List <ValidationResult>();

            bool           isValid = Validator.TryValidateObject(par, context, validationResults, true);
            ValidationList rules   = new ValidationList();

            rules.Add(new FTSFOValidation(par, null));
            rules.Add(new FTFCIFOValidation(par, null));
            rules.Add(new COValidation(par, cuentas));
            rules.Add(new CEValidation(par, empresa));
            rules.Add(new CONCEPCOSValidation(par, conceptoCostos));
            rules.Add(new IImporteValidation(par, null));
            if (!rules.IsValid)
            {
                throw new Exception("No se cumple con la entrada de datos y las reglas de negocios");
            }
            par.PA_STATUS_PARTIDA = Convert.ToInt16(BusinessEnumerations.EstatusCarga.POR_APROBAR);
            par.PA_REFERENCIA     = System.DateTime.Now.Date.ToString(dateFormat) + counterRecords;
            return(base.Insert(par, true));
        }