public ActionResult Nuevo()
        {
            #region Validar Session
            if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
            {
                return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
            }
            SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
            SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
            #endregion

            empleado_info_list.set_list(bus_empleado.get_list_combo(Convert.ToInt32(SessionFixed.IdEmpresa)), Convert.ToDecimal(SessionFixed.IdTransaccionSession));

            #region Validar Session
            if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
            {
                return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
            }
            SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
            SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
            #endregion
            ro_marcaciones_x_empleado_Info model = new ro_marcaciones_x_empleado_Info
            {
                IdEmpresa            = Convert.ToInt32(SessionFixed.IdEmpresa),
                Fecha_Transac        = DateTime.Now,
                IdNomina             = 1,
                IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession)
            };
            model.detalle = new List <ro_marcaciones_x_empleado_Info>();
            detalle.set_list(model.detalle, model.IdTransaccionSession);
            cargar_combos();
            return(View(model));
        }
示例#2
0
        private void cargar_combo()
        {
            int IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa);

            ViewBag.lst_empleado   = bus_empleado.get_list_combo(IdEmpresa);
            ViewBag.lst_vacaciones = lst_vacaciones;
        }
示例#3
0
        public ActionResult Nuevo()
        {
            #region Validar Session
            if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
            {
                return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
            }
            SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
            SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
            #endregion

            empleado_info_list.set_list(bus_empleado.get_list_combo(Convert.ToInt32(SessionFixed.IdEmpresa)), Convert.ToDecimal(SessionFixed.IdTransaccionSession));

            ro_PrestamoMasivo_Info model = new ro_PrestamoMasivo_Info
            {
                IdEmpresa            = Convert.ToInt32(SessionFixed.IdEmpresa),
                IdSucursal           = Convert.ToInt32(SessionFixed.IdSucursal),
                IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession),
                Fecha_PriPago        = DateTime.Now,
                descuento_mensual    = false,
                descuento_quincena   = false,
                descuento_men_quin   = false
            };
            model.lst_detalle = new List <ro_PrestamoMasivo_Det_Info>();
            ListaDetalle.set_list(model.lst_detalle, model.IdTransaccionSession);

            return(View(model));
        }
示例#4
0
        public ActionResult Nuevo()
        {
            #region Validar Session
            if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
            {
                return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
            }
            SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
            SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
            #endregion

            cargar_combos(0, 0);
            ro_nomina_x_horas_extras_Info info = new ro_nomina_x_horas_extras_Info();
            info.IdTransaccionSession    = Convert.ToDecimal(SessionFixed.IdTransaccionSession);
            info.lst_nomina_horas_extras = new List <ro_nomina_x_horas_extras_det_Info>();
            info.IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa);

            var lst_empleado = bus_empleado.get_list_combo(Convert.ToInt32(SessionFixed.IdEmpresa));
            empleado_info_list.set_list(lst_empleado, Convert.ToDecimal(SessionFixed.IdTransaccionSession));

            return(View(info));
        }
 private void cargar_combos()
 {
     try
     {
         IdEmpresa               = GetIdEmpresa();
         ViewBag.lst_empleado    = bus_empleado.get_list_combo(IdEmpresa);
         ViewBag.lst_institucion = bus_catalogo.get_list_x_tipo(5);
         ViewBag.lst_titulo      = bus_catalogo.get_list_x_tipo(4);
     }
     catch (Exception)
     {
         throw;
     }
 }
        public ActionResult Nuevo()
        {
            empleado_info_list.set_list(bus_empleado.get_list_combo(Convert.ToInt32(SessionFixed.IdEmpresa)));

            ro_EmpleadoNovedadCargaMasiva_Info model = new ro_EmpleadoNovedadCargaMasiva_Info
            {
                IdEmpresa    = Convert.ToInt32(SessionFixed.IdEmpresa),
                FechaCarga   = DateTime.Now,
                IdNomina     = 1,
                IdNominaTipo = 2,
                IdSucursal   = Convert.ToInt32(SessionFixed.IdSucursal),
            };

            model.detalle = new List <ro_EmpleadoNovedadCargaMasiva_det_Info>();
            detalle.set_list(model.detalle);
            cargar_combos();
            return(View(model));
        }
示例#7
0
        private void cargar_combo()
        {
            try
            { ro_nomina_tipo_Bus bus_nomina = new ro_nomina_tipo_Bus();
              IdEmpresa         = GetIdEmpresa();
              lis_empleado      = bus_empleado.get_list_combo(IdEmpresa);
              lst_tipo_contrato = bus_catalogo.get_list_x_tipo(2);
              lst_esta_contrato = bus_catalogo.get_list_x_tipo(33);

              ViewBag.lst_empleado        = lis_empleado;
              ViewBag.lst_tipo_contrato   = lst_tipo_contrato;
              ViewBag.lst_estado_contrato = lst_esta_contrato;
              ViewBag.lst_nomina          = bus_nomina.get_list(IdEmpresa, false); }
            catch (Exception)
            {
                throw;
            }
        }
        private void cargar_combo()
        {
            try
            {
                bus_tipo         = new ro_marcaciones_tipo_Bus();
                ViewBag.lst_tipo = bus_tipo.get_list();

                bus_empleado = new ro_empleado_Bus();
                bus_catalogo = new ro_catalogo_Bus();
                ro_nomina_tipo_Bus bus_nomina = new ro_nomina_tipo_Bus();
                IdEmpresa                 = GetIdEmpresa();
                ViewBag.lst_empleado      = bus_empleado.get_list_combo(IdEmpresa);
                ViewBag.lst_tipomarcacion = bus_catalogo.get_list_x_tipo(18);
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#9
0
        public static void FileUploadComplete(object sender, DevExpress.Web.FileUploadCompleteEventArgs e)
        {
            #region Variables
            ro_empleado_Bus         bus_empleado = new ro_empleado_Bus();
            Af_Activo_fijo_tipo_Bus bus_tipo     = new Af_Activo_fijo_tipo_Bus();

            Af_Activo_fijo_tipo_List             ListaTipo       = new Af_Activo_fijo_tipo_List();
            List <Af_Activo_fijo_tipo_Info>      Lista_Tipo      = new List <Af_Activo_fijo_tipo_Info>();
            Af_Activo_fijo_Categoria_List        ListaCategoria  = new Af_Activo_fijo_Categoria_List();
            List <Af_Activo_fijo_Categoria_Info> Lista_Categoria = new List <Af_Activo_fijo_Categoria_Info>();
            Af_Departamento_List        ListaDepartamento        = new Af_Departamento_List();
            List <Af_Departamento_Info> Lista_Departamento       = new List <Af_Departamento_Info>();
            Af_Catalogo_List            ListaCatalogo            = new Af_Catalogo_List();
            List <Af_Catalogo_Info>     Lista_Catalogo           = new List <Af_Catalogo_Info>();
            Af_Activo_fijo_List         ListaActivoFijo          = new Af_Activo_fijo_List();
            List <Af_Activo_fijo_Info>  Lista_ActivoFijo         = new List <Af_Activo_fijo_Info>();
            //Af_Activo_fijo_CtaCble_List ListaActivoFijoCtaCble = new Af_Activo_fijo_CtaCble_List();
            List <Af_Activo_fijo_CtaCble_Info> Lista_ActivoFijoCtaCble = new List <Af_Activo_fijo_CtaCble_Info>();


            int     cont = 0;
            decimal IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual);
            int     IdEmpresa            = Convert.ToInt32(SessionFixed.IdEmpresa);
            #endregion


            Stream stream = new MemoryStream(e.UploadedFile.FileBytes);
            if (stream.Length > 0)
            {
                IExcelDataReader reader = null;
                reader = ExcelReaderFactory.CreateOpenXmlReader(stream);

                #region Tipo
                while (reader.Read())
                {
                    if (!reader.IsDBNull(0) && cont > 0)
                    {
                        Af_Activo_fijo_tipo_Info info = new Af_Activo_fijo_tipo_Info
                        {
                            IdEmpresa              = IdEmpresa,
                            IdActivoFijoTipo       = Convert.ToInt32(reader.GetValue(0)),
                            CodActivoFijo          = reader.GetString(1),
                            Af_Descripcion         = reader.GetString(2),
                            Af_Porcentaje_depre    = Convert.ToDouble(reader.GetValue(3)),
                            Af_anio_depreciacion   = Convert.ToInt32(reader.GetValue(4)),
                            IdCtaCble_Activo       = Convert.ToString(reader.GetValue(6)),
                            IdCtaCble_Dep_Acum     = Convert.ToString(reader.GetValue(7)),
                            IdCtaCble_Gastos_Depre = Convert.ToString(reader.GetValue(8)),
                            Se_Deprecia            = reader.GetString(5) == "SI" ? true : false,
                            IdCtaCble_CostoVenta   = Convert.ToString(reader.GetValue(9)),
                            IdCtaCble_Mejora       = Convert.ToString(reader.GetValue(10)),
                            IdCtaCble_Baja         = Convert.ToString(reader.GetValue(11)),
                            IdCtaCble_Retiro       = Convert.ToString(reader.GetValue(12)),
                            IdUsuario              = SessionFixed.IdUsuario
                        };
                        Lista_Tipo.Add(info);
                    }
                    else
                    {
                        cont++;
                    }
                }
                ListaTipo.set_list(Lista_Tipo, IdTransaccionSession);
                #endregion

                cont = 0;
                //Para avanzar a la siguiente hoja de excel
                reader.NextResult();

                #region Categoria
                while (reader.Read())
                {
                    if (!reader.IsDBNull(0) && cont > 0)
                    {
                        Af_Activo_fijo_Categoria_Info info = new Af_Activo_fijo_Categoria_Info
                        {
                            IdEmpresa        = IdEmpresa,
                            IdCategoriaAF    = Convert.ToInt32(reader.GetValue(0)),
                            IdActivoFijoTipo = Convert.ToInt32(reader.GetValue(1)),
                            CodCategoriaAF   = string.IsNullOrEmpty(Convert.ToString(reader.GetValue(2))) ? null : Convert.ToString(reader.GetValue(2)),
                            Descripcion      = Convert.ToString(reader.GetValue(3)),
                            IdUsuario        = SessionFixed.IdUsuario
                        };
                        Lista_Categoria.Add(info);
                    }
                    else
                    {
                        cont++;
                    }
                }
                ListaCategoria.set_list(Lista_Categoria, IdTransaccionSession);
                #endregion

                cont = 0;
                reader.NextResult();

                #region Departamento
                while (reader.Read())
                {
                    if (!reader.IsDBNull(0) && cont > 0)
                    {
                        Af_Departamento_Info info = new Af_Departamento_Info
                        {
                            IdEmpresa         = IdEmpresa,
                            IdDepartamento    = Convert.ToInt32(reader.GetValue(0)),
                            Descripcion       = Convert.ToString(reader.GetValue(1)),
                            IdUsuarioCreacion = SessionFixed.IdUsuario
                        };
                        Lista_Departamento.Add(info);
                    }
                    else
                    {
                        cont++;
                    }
                }
                ListaDepartamento.set_list(Lista_Departamento, IdTransaccionSession);
                #endregion

                cont = 0;
                reader.NextResult();

                #region Catalogo
                while (reader.Read())
                {
                    if (!reader.IsDBNull(0) && cont > 0)
                    {
                        Af_Catalogo_Info info = new Af_Catalogo_Info
                        {
                            IdCatalogo     = Convert.ToString(reader.GetValue(0)),
                            IdTipoCatalogo = Convert.ToString(reader.GetValue(1)),
                            Descripcion    = Convert.ToString(reader.GetValue(2)),
                            IdUsuario      = SessionFixed.IdUsuario
                        };
                        info.IdCatalogo     = info.IdCatalogo.Trim();
                        info.IdTipoCatalogo = info.IdTipoCatalogo.Trim();

                        Lista_Catalogo.Add(info);
                    }
                    else
                    {
                        cont++;
                    }
                }
                ListaCatalogo.set_list(Lista_Catalogo, IdTransaccionSession);
                #endregion

                cont = 0;
                reader.NextResult();

                #region ActivoFijo
                var ListaEmpleado = bus_empleado.get_list_combo(IdEmpresa);
                ro_empleado_info_list Lista_Empleado = new ro_empleado_info_list();
                Lista_Empleado.set_list(ListaEmpleado);

                while (reader.Read())
                {
                    if (!reader.IsDBNull(0) && cont > 0)
                    {
                        var IdTipo    = Convert.ToInt32(reader.GetValue(3));
                        var ini_depre = Convert.ToDateTime(reader.GetValue(13));
                        var info_empleado_custodio  = Lista_Empleado.get_list().Where(q => q.pe_cedulaRuc == Convert.ToString(reader.GetValue(23))).FirstOrDefault();
                        var info_empleado_encargado = Lista_Empleado.get_list().Where(q => q.pe_cedulaRuc == Convert.ToString(reader.GetValue(22))).FirstOrDefault();
                        var info_tipo_activofijo    = ListaTipo.get_list(IdTransaccionSession).Where(q => q.IdActivoFijoTipo == IdTipo).FirstOrDefault();

                        Af_Activo_fijo_Info info = new Af_Activo_fijo_Info
                        {
                            IdEmpresa                = IdEmpresa,
                            IdUsuario                = SessionFixed.IdUsuario,
                            IdActivoFijo             = Convert.ToInt32(reader.GetValue(0)),
                            CodActivoFijo            = string.IsNullOrEmpty(Convert.ToString(reader.GetValue(1))) ? null : Convert.ToString(reader.GetValue(1)),
                            Af_Codigo_Barra          = string.IsNullOrEmpty(Convert.ToString(reader.GetValue(24))) ? null : Convert.ToString(reader.GetValue(24)),
                            Af_Nombre                = Convert.ToString(reader.GetValue(2)),
                            IdCategoriaAF            = Convert.ToInt32(reader.GetValue(4)),
                            IdActivoFijoTipo         = Convert.ToInt32(reader.GetValue(3)),
                            IdSucursal               = Convert.ToInt32(reader.GetValue(5)),
                            IdDepartamento           = Convert.ToInt32(reader.GetValue(6)),
                            IdCatalogo_Marca         = Convert.ToString(reader.GetValue(7)),
                            IdCatalogo_Modelo        = Convert.ToString(reader.GetValue(8)),
                            IdCatalogo_Color         = Convert.ToString(reader.GetValue(10)),
                            IdTipoCatalogo_Ubicacion = Convert.ToString(reader.GetValue(11)),
                            IdEmpleadoCustodio       = info_empleado_custodio.IdEmpleado,
                            IdEmpleadoEncargado      = info_empleado_encargado.IdEmpleado,
                            Af_fecha_compra          = Convert.ToDateTime(reader.GetValue(12)),
                            Af_fecha_ini_depre       = ini_depre,
                            Af_costo_compra          = Convert.ToDouble(reader.GetValue(15)),
                            Af_Depreciacion_acum     = Convert.ToDouble(reader.GetValue(16)),
                            Af_ValorSalvamento       = Convert.ToDouble(reader.GetValue(25)),
                            Af_NumSerie              = string.IsNullOrEmpty(Convert.ToString(reader.GetValue(9))) ? null : Convert.ToString(reader.GetValue(9)),
                            Af_NumPlaca              = string.IsNullOrEmpty(Convert.ToString(reader.GetValue(21))) ? null : Convert.ToString(reader.GetValue(21)),
                            Estado_Proceso           = "TIP_ESTADO_AF_ACTIVO",
                            Af_fecha_fin_depre       = ini_depre.AddYears(info_tipo_activofijo.Af_anio_depreciacion),
                            Af_Meses_depreciar       = (info_tipo_activofijo.Af_anio_depreciacion * 12),
                            Af_porcentaje_deprec     = info_tipo_activofijo.Af_Porcentaje_depre,
                            Af_Vida_Util             = info_tipo_activofijo.Af_anio_depreciacion,
                            Af_observacion           = Convert.ToString(reader.GetValue(20)),
                            Cantidad = Convert.ToInt32(reader.GetValue(26))
                        };

                        Lista_ActivoFijo.Add(info);
                    }
                    else
                    {
                        cont++;
                    }
                }
                ListaActivoFijo.set_list(Lista_ActivoFijo, IdTransaccionSession);
                #endregion

                cont = 0;
                reader.NextResult();

                #region ActivoFijo_CtaCble
                //while (reader.Read())
                //{
                //    if (!reader.IsDBNull(0) && cont > 0)
                //    {
                //        Af_Activo_fijo_CtaCble_Info info = new Af_Activo_fijo_CtaCble_Info
                //        {
                //            IdEmpresa = IdEmpresa,
                //            IdActivoFijo = Convert.ToInt32(reader.GetValue(0)),
                //            IdDepartamento = Convert.ToInt32(reader.GetValue(1)),
                //            IdCtaCble = Convert.ToString(reader.GetValue(2)),
                //            Porcentaje = Convert.ToDouble(reader.GetValue(3))
                //        };
                //        Lista_ActivoFijoCtaCble.Add(info);
                //    }
                //    else
                //        cont++;
                //}
                //ListaActivoFijoCtaCble.set_list(Lista_ActivoFijoCtaCble, IdTransaccionSession);
                #endregion
            }
        }
 private void cargar_combo()
 {
     IdEmpresa              = GetIdEmpresa();
     ViewBag.lst_empleado   = bus_empleado.get_list_combo(IdEmpresa);
     ViewBag.lst_vacaciones = lst_vacaciones;
 }