コード例 #1
0
        public override ReciboSueldo ReadBy(ReciboSueldo objeto)
        {
            ReciboSueldoDAC reciboSueldoComponent = new ReciboSueldoDAC();
            ReciboSueldo    reciboSueldo          = new ReciboSueldo();

            reciboSueldo = reciboSueldoComponent.ReadBy(objeto);
            EmpleadoComponent empleadoComponent = new EmpleadoComponent();

            reciboSueldo.empleado = empleadoComponent.ReadBy(reciboSueldo.empleado.Id);
            LegajoItemComponent legajoItemComponent = new LegajoItemComponent();
            LegajoItem          item = new LegajoItem();

            item.ReciboSueldo.Id   = objeto.Id;
            reciboSueldo.listaItem = legajoItemComponent.Obtener(item);
            foreach (LegajoItem unItem in reciboSueldo.listaItem)
            {
                if (unItem.item.Tipo.tipoItem == "Retencion")
                {
                    reciboSueldo.totalRetencion = reciboSueldo.totalRetencion + unItem.valor;
                }
                else if (unItem.item.Tipo.tipoItem == "Exentas")
                {
                    reciboSueldo.totalExenta = reciboSueldo.totalExenta + unItem.valor;
                }
                else if (unItem.item.Tipo.tipoItem == "Deducciones")
                {
                    reciboSueldo.totalDeducciones = reciboSueldo.totalDeducciones + unItem.valor;
                }
            }

            reciboSueldo.totalNeto = reciboSueldo.totalRetencion + reciboSueldo.totalExenta - reciboSueldo.totalDeducciones;


            return(reciboSueldo);
        }
コード例 #2
0
 public ActionResult Edit(int id, FormCollection collection)
 {
     try
     {
         // TODO: Add update logic here
         if (ModelState.IsValid)
         {
             EmpleadoComponent empleadoComponent = new EmpleadoComponent();
             Empleado          empleado          = new Empleado();
             empleado.apellido        = collection.Get("Apellido");
             empleado.banco           = collection.Get("banco");
             empleado.categoria.Id    = int.Parse(collection.Get("categoria.categoria"));
             empleado.cuenta          = collection.Get("cuenta");
             empleado.cuil            = collection.Get("cuil");
             empleado.departamento.Id = int.Parse(collection.Get("departamento.departamento"));
             empleado.division.Id     = int.Parse(collection.Get("division.division"));
             empleado.empresa.Id      = int.Parse(collection.Get("empresa.empresa"));
             empleado.fechaIngreso    = DateTime.Parse(collection.Get("fechaIngreso"));
             empleado.nombre          = collection.Get("nombre");
             empleado.Id = id;
             empleadoComponent.Update(empleado);
             return(RedirectToAction("Index"));
         }
         else
         {
             return(RedirectToAction("Index"));
         }
     }
     catch (Exception e)
     {
         return(View());
     }
 }
コード例 #3
0
        //
        // GET: /Empleado/Edit/5
        public ActionResult Edit(int id)
        {
            Empleado              empleado              = new Empleado();
            CategoriaComponent    categoriaComponent    = new CategoriaComponent();
            DivisionComponent     divisionComponent     = new DivisionComponent();
            EmpresaComponent      empresaComponent      = new EmpresaComponent();
            DepartamentoComponent departamentoComponent = new DepartamentoComponent();
            EmpleadoComponent     empleadoComponent     = new EmpleadoComponent();

            empleado = empleadoComponent.ReadBy(id);
            empleado.listaCategoria    = categoriaComponent.Read();
            empleado.listaDepartamento = departamentoComponent.Read();
            empleado.listaDivision     = divisionComponent.Read();
            empleado.listaEmpresa      = empresaComponent.Read();



            empleado.listaCategoria.Select(y =>
                                           new
            {
                y.Id,
                y.categoria
            });

            ViewBag.ListaCategoria = new SelectList(empleado.listaCategoria, "Id", "categoria");



            empleado.listaDepartamento.Select(y =>
                                              new
            {
                y.Id,
                y.departamento
            });

            ViewBag.ListaDepartamento = new SelectList(empleado.listaDepartamento, "Id", "departamento");



            empleado.listaDivision.Select(y =>
                                          new
            {
                y.Id,
                y.division
            });

            ViewBag.ListaDivision = new SelectList(empleado.listaDivision, "Id", "division");


            empleado.listaEmpresa.Select(y =>
                                         new
            {
                y.Id,
                y.empresa
            });

            ViewBag.ListaEmpresa = new SelectList(empleado.listaEmpresa, "Id", "empresa");

            return(View(empleado));
        }
コード例 #4
0
        // GET: ReciboSueldo/Create
        public ActionResult Create(int id)
        {
            ReciboSueldo      reciboSueldo = new ReciboSueldo();
            EmpleadoComponent empleado     = new EmpleadoComponent();

            reciboSueldo.listaEmpleado = empleado.Read();
            reciboSueldo.empleado      = empleado.ReadBy(id);

            return(View(reciboSueldo));
        }
コード例 #5
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         // TODO: Add delete logic here
         EmpleadoComponent empleadoComponent = new EmpleadoComponent();
         empleadoComponent.Delete(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
コード例 #6
0
        public ReciboSueldo ReadByLegajo(int id)
        {
            ReciboSueldoDAC reciboSueldoComponent = new ReciboSueldoDAC();
            ReciboSueldo    reciboSueldo          = new ReciboSueldo();

            reciboSueldo.listaReciboSueldo = reciboSueldoComponent.ReadByLegajo(id);

            EmpleadoComponent empleadoComponent = new EmpleadoComponent();

            if (reciboSueldo.listaReciboSueldo.Count != 0)
            {
                reciboSueldo.empleado = empleadoComponent.ReadBy(reciboSueldo.listaReciboSueldo[0].empleado.Id);
            }


            return(reciboSueldo);
        }
コード例 #7
0
        public override List <AporteJubilatorio> Read()
        {
            AporteJubilatorioDAC     aporteJubilatorio = new AporteJubilatorioDAC();
            List <AporteJubilatorio> lista             = new List <AporteJubilatorio>();
            List <AporteJubilatorio> result            = new List <AporteJubilatorio>();

            lista = aporteJubilatorio.Read();
            foreach (AporteJubilatorio item in lista)
            {
                AporteJubilatorio aporte = new AporteJubilatorio();
                aporte = item;
                EmpleadoComponent empleadoComponent = new EmpleadoComponent();
                aporte.empleado = empleadoComponent.ReadBy(item.empleado.Id);
                result.Add(aporte);
            }
            return(result);
        }
コード例 #8
0
        //
        // GET: /Empleado/Delete/5
        public ActionResult Delete(int id)
        {
            EmpleadoComponent empleadoComponent = new EmpleadoComponent();

            return(View(empleadoComponent.ReadBy(id)));
        }
コード例 #9
0
        //
        // GET: /Empleado/
        public ActionResult Index()
        {
            EmpleadoComponent empleadoComponent = new EmpleadoComponent();

            return(View(empleadoComponent.Read()));
        }