Esempio n. 1
0
        //-----------------------FUNCIONES DE CREAR, EDITAR Y ELIMINAR
        public static bool Add_Trabajador_Sucursal(String[] valores)
        {
            trabajador nuevo = new trabajador()
            {
                cedula            = "0",
                primer_nombre     = " Trabajador Default " + valores[0],
                segundo_nombre    = "---",
                primer_apellido   = "---",
                segundo_apellido  = "---",
                email             = "---",
                fecha_nacimiento  = Convert.ToDateTime("1900-01-01"),
                edo_civil         = "Soltero(a)",
                sexo              = "Masculino",
                foto              = "~/source/archivos/foto_perfil/usuario.png",
                telefono_casa     = "---",
                telefono_movil    = "---",
                activo            = 1,
                id_ccf            = 0,
                direccion         = "---",
                id_municipio      = 1,
                id_puesto_trabajo = Mgr_PuestoTrabajo.Get_PuestoTrabajo(),
                es_discapacitado  = "No",
                desc_discapacidad = "---",
                id_horario        = Mgr_Horario.Get_Horario(),
                id_estatus_actual = 1,
                fecha_ingreso     = DateTime.Now
            };

            return(CRUD.Add_Fila(nuevo));
        }
Esempio n. 2
0
        protected void AgregarRegistro(object sender, EventArgs e)
        {
            extintor nuevo = new extintor()
            {
                serial_extintor       = txtSerial.Text,
                fecha_ultima_recarga  = Convert.ToDateTime(txtFechaUltRec.Text).Date,
                fecha_proxima_recarga = Convert.ToDateTime(txtFechaProxRec.Text).Date,
                peso           = txtPeso.Text,
                presion        = txtPresion.Text,
                tipo_extintor  = ddlTipoExt.SelectedValue,
                nombre_empresa = txtNombreEmpresa.Text,
                id_area        = Convert.ToInt32(ddlAreaAdd.SelectedValue)
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);

            if (ObjUsuario.Error)
            {
                alarma nueva_alarma = new alarma()
                {
                    descripcion   = "Proxima fecha de recarga para el extintor: " + txtSerial.Text,
                    fecha         = Convert.ToDateTime(txtFechaProxRec.Text).Date,
                    prioridad     = "Media",
                    id_categorias = 1,
                    id_usuario    = ObjUsuario.Id_usuario
                };
                ObjUsuario.Error = CRUD.Add_Fila(nueva_alarma);
                if (ObjUsuario.Error)
                {
                    Modal.CerrarModal("addModal", "AddModalScript", this);
                    Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
                    LlenarGridView();
                }
            }
        }
Esempio n. 3
0
        //-----------FUNCIONES DE CREAR, EDITAR Y ELIMINAR
        public static bool Add_Categoria_Empresa(String[] valores)
        {
            List <categoria> Listacategoria = new List <categoria>();

            Boolean berror = false;

            for (int i = 0; i < ValoresDefault.Nombre_Categorias.Value.Length; i++)
            {
                categoria ListaCategoria = new categoria();

                string nombreCat = ValoresDefault.Nombre_Categorias.Value[i];

                ListaCategoria.nombre = ValoresDefault.Nombre_Categorias.Value[i];

                ListaCategoria.descripcion = ValoresDefault.Descripcion_Categorias.Value[i];
                ListaCategoria.id_empresa  = Convert.ToInt32(valores[0]);

                Listacategoria.Add(ListaCategoria);

                berror = CRUD.Add_Fila(ListaCategoria);

                if (!berror)
                {
                    i = valores.Length;
                }
            }

            return(berror);
        }
Esempio n. 4
0
        //-----------------FUNCIONES DE CREAR, EDITAR Y ELIMINAR
        public static bool Add_Sucursal_Empresa(String[] valores)
        {
            string _id_municipio = null;

            if (valores[1] != "0")
            {
                _id_municipio = valores[1];
            }
            sucursal nuevo = new sucursal()
            {
                nombre         = valores[0],
                id_municpio    = Convert.ToInt32(_id_municipio),
                id_empresa     = Convert.ToInt32(valores[2]),
                direccion      = valores[3],
                sede_principal = 1,
                representante  = valores[4],
                movil          = valores[5],
                fijo           = valores[6],
                actividad_ppal = Convert.ToInt32(valores[7]),
                actividad_sec  = Convert.ToInt32(valores[8]),
                actividad_otra = Convert.ToInt32(valores[9]),
            };

            return(CRUD.Add_Fila(nuevo));
        }
Esempio n. 5
0
        public static bool Add_Empresa(String[] valores, FileUpload fuLogoEmpresa)
        {
            string ruta = Utilidades.GuardarImagen(fuLogoEmpresa, valores[0], Paginas.Archivos_LogosEmpresas.Value);

            if (!ruta.Contains("ERR-"))
            {
                empresa nuevo = new empresa()
                {
                    nombre        = valores[0],
                    CodEmpresa    = valores[1],
                    nit           = valores[2],
                    email         = valores[3],
                    representante = valores[4],
                    movil         = valores[5],
                    fijo          = valores[6],
                    logo_url      = ruta,
                    id_arl        = Convert.ToInt32(valores[7]),
                    jornada       = Convert.ToInt32(valores[8])
                };

                return(CRUD.Add_Fila(nuevo));
            }
            else
            {
                return(false);
            }
        }
        protected void Guardar(object sender, EventArgs e)
        {
            int IdEmpresa = ObjUsuario.Id_empresa;

            if (BoolEmpSuc.Item1)
            {
                IdEmpresa = Convert.ToInt32(ddlEmpresaAdd.SelectedValue);
            }

            string _ruta = Utilidades.GuardarArchivo(flpArchivo, IdEmpresa + "_PerfilMedico_" + IdEmpresa, "~/archivos/perfilmedico/");

            perfil_medico nuevo = new perfil_medico()
            {
                nombre      = txtNombre.Text,
                id_empresa  = IdEmpresa,
                ruta        = _ruta,
                descripcion = txtDescripcion.Text,
                id_cargo    = Convert.ToInt32(ddlCargoAdd.SelectedValue)
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);

            Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            LlenarGridView();
            Modal.CerrarModal("addModal", "AddModalScript", this);
        }
Esempio n. 7
0
        //------FUNCIONES DE CREAR, EDITAR Y ELIMINAR
        public static bool Add_TipoDocumento_Sucursal(String[] valores)
        {
            List <tipo_documento> ListaTipoDocumento = new List <tipo_documento>();
            Boolean berror = false;

            for (int i = 0; i < 41; i++)
            {
                tipo_documento ObjTipoDocumento = new tipo_documento();
                ObjTipoDocumento.id_sucursal = Convert.ToInt32(valores[0]);
                ObjTipoDocumento.nombre      = ValoresDefault.Nombre_TipoDocumento.Value[i];
                ObjTipoDocumento.dirigida    = ValoresDefault.Dirigida_TipoDocumento.Value[i];
                ObjTipoDocumento.modalidad   = ValoresDefault.Modalidad_TipoDocumento.Value[i];
                ObjTipoDocumento.responsable = ValoresDefault.Responsable_TipoDocumento.Value[i];
                ObjTipoDocumento.aprobado    = ValoresDefault.Aprobado_TipoDocumento.Value[i];
                ObjTipoDocumento.archivado   = ValoresDefault.Archivado_TipoDocumento.Value[i];
                ObjTipoDocumento.estatus     = "No Cumplido";
                ListaTipoDocumento.Add(ObjTipoDocumento);

                berror = CRUD.Add_Fila(ObjTipoDocumento);

                if (!berror)
                {
                    return(berror);
                }
            }

            return(berror);
        }
Esempio n. 8
0
        //---------------FUNCIONES DE CREAR, EDITAR Y ELIMINAR
        public static bool Add_AutoEvaluacion(Tuple <int, int> IdEmpSuc, String[] valores, FileUpload flpArchivo)
        {
            int     IdEmpresa  = IdEmpSuc.Item1;
            int     IdSucursal = IdEmpSuc.Item2;
            Boolean berror     = false;
            string  _ruta      = Utilidades.GuardarArchivo(flpArchivo, IdEmpresa + valores[0], Paginas.Archivos_Autoevaluacion.Value);

            DateTime fecha = new DateTime(Convert.ToInt32(valores[1]), 1, 1);

            documento nuevo = new documento()
            {
                nombre       = valores[2],
                ruta         = _ruta,
                fecha_subida = fecha,
                id_tabla     = IdSucursal,
                tipo         = TipoDocumento.Auto_Evaluacion.Value
            };

            berror = CRUD.Add_Fila(nuevo);

            if (berror)
            {
                GrupoLiEntities contexto = new GrupoLiEntities();
                lista_actividad Edit     = contexto.lista_actividad.SingleOrDefault(b => b.id_sucursal == IdSucursal);
                if (Edit != null)
                {
                    Edit.estatus = "Si";
                }
                berror = CRUD.Edit_Fila(contexto);
            }

            return(berror);
        }
Esempio n. 9
0
        protected void GuardarRegistro(object sender, EventArgs e)
        {
            int IdSucursal = Mgr_Sucursal.Set_IdSucursalDDl(ObjUsuario, ddlSucursal);

            matriz_responsabilidad tabla = new matriz_responsabilidad();

            ObjUsuario.Error = CRUD.Delete_Fila(tabla, Mgr_Documento.Get_Matriz_Responsabilidad(IdSucursal));

            matriz_responsabilidad nuevo = new matriz_responsabilidad()
            {
                id_sucursal = IdSucursal,
                puesto1     = txt1.Text,
                puesto2     = txt2.Text,
                puesto3     = txt3.Text,
                puesto4     = txt4.Text,
                puesto5     = txt5.Text,
                puesto6     = txt6.Text,
                puesto7     = txt7.Text,
                pusto8      = txt8.Text
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);

            if (ObjUsuario.Error)
            {
                cargarMatriz();
            }


            Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txt1);
        }
Esempio n. 10
0
        protected void btPrintSave_Click(object sender, EventArgs e)
        {
            DateTime?myDate = null;

            myDate       = txtFechaMuerte.Text == string.Empty ? myDate : Convert.ToDateTime(txtFechaMuerte.Text);
            IdTrabajador = Convert.ToInt32(ddlTrabajador.SelectedValue);

            at_it_el_pa nuevo = new at_it_el_pa()
            {
                fecha_accidente          = Convert.ToDateTime(txtFechaAcc.Text),
                hora_accidente           = Convert.ToDateTime(txtHoraAcc.Text),
                id_trabajador            = Convert.ToInt32(ddlTrabajador.SelectedValue),
                id_area                  = Convert.ToInt32(ddlArea.SelectedValue),
                id_puesto                = Convert.ToInt32(ddlProcesoTrabajo.SelectedValue),
                sitio                    = txtSitioAccidente.Text,
                descripcion              = txtDescTarea.Text,
                condiciones_inseguras    = txtCondIns.Text,
                actos_inseguros          = txtActos.Text,
                factores_inseguros       = txtFacTrab.Text,
                factores_personales      = txtFactPersonales.Text,
                tipo_evento              = "1",
                fecha_muerte             = myDate,
                dias_incapacidad         = txtDiasIncapacidad.Text == string.Empty ? 0 : Convert.ToInt32(txtDiasIncapacidad.Text),
                dias_cargados            = txtDiasCargados.Text == string.Empty ? 0 : Convert.ToInt32(txtDiasCargados.Text),
                dias_perdidos_ausencia   = txtDiasPerdidosAusTrab.Text == string.Empty ? 0 : Convert.ToInt32(txtDiasPerdidosAusTrab.Text),
                dias_perdidos_restingido = txtDiasPerdidosctRest.Text == string.Empty ? 0 : Convert.ToInt32(txtDiasPerdidosctRest.Text),
                dias_no_perdidos         = chkSinDias.Checked == true ? "true" : "false",
                tipo_enfermedad          = ddlTipoEnfermedad.SelectedValue
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);

            if (ObjUsuario.Error)
            {
                int id_at_it_el_pa = Mgr_Acc_Inc.Get_Accidente();

                #region insertar anexos
                if (fuAnexo.HasFile)
                {
                    int i = 0;
                    foreach (var archivo in fuAnexo.PostedFiles)
                    {
                        i++;
                        string ruta = Utilidades.GuardarArchivo(archivo,
                                                                "Accidente_" + id_at_it_el_pa + "_" + i, "~/archivos/accidentes/");

                        soporte nuevoFA = new soporte()
                        {
                            url      = ruta,
                            id_tabla = id_at_it_el_pa
                        };
                        ObjUsuario.Error = CRUD.Add_Fila(nuevoFA);
                    }
                }
                #endregion

                Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtFechaAcc);
            }
        }
Esempio n. 11
0
        public static bool Add_Trabajador(String[] valores, FileUpload fuFoto)
        {
            string     ruta  = Utilidades.GuardarImagen(fuFoto, valores[0] + "_foto", Paginas.Archivos_Foto_Perfil.Value);
            trabajador nuevo = new trabajador()
            {
                cedula            = valores[0],
                primer_nombre     = valores[1],
                segundo_nombre    = valores[2],
                primer_apellido   = valores[3],
                segundo_apellido  = valores[4],
                email             = valores[5],
                fecha_nacimiento  = Convert.ToDateTime(valores[6]),
                edo_civil         = valores[7],
                sexo              = valores[8],
                foto              = ruta,
                telefono_casa     = valores[9],
                telefono_movil    = valores[10],
                activo            = 1,
                id_ccf            = Convert.ToInt32(valores[11]),
                direccion         = valores[12],
                id_municipio      = Convert.ToInt32(valores[13]),
                id_puesto_trabajo = Convert.ToInt32(valores[14]),
                es_discapacitado  = valores[15],
                desc_discapacidad = valores[16] == string.Empty ? "---" : valores[16],
                id_horario        = Convert.ToInt32(valores[17]),
                id_estatus_actual = Convert.ToInt32(valores[18]),
                fecha_ingreso     = Convert.ToDateTime(valores[19]),
                tipo_vinculacion  = valores[20],
                tipo_horario      = valores[21],
                id_perfil_cargo   = Convert.ToInt32(valores[22]),
                salario           = Convert.ToInt32(valores[23]),
                mano_dominante    = valores[24]
            };
            Boolean berror = false;

            if (CRUD.Add_Fila(nuevo))
            {
                int idTrabajador           = Get_Trabajador();
                trabajador_estatus nuevoTE = new trabajador_estatus()
                {
                    id_estatus       = Convert.ToInt32(valores[18]),
                    id_trabajador    = idTrabajador,
                    fecha_registro   = DateTime.Now,
                    motivo           = "Registro de Trabajador",
                    id_enfermedad    = 0,
                    id_sistema       = 0,
                    url_constancia   = "",
                    fecha_constancia = DateTime.Now,
                    dias_reposo      = 0,
                    tpo_enfermedad   = ""
                };
                berror = CRUD.Add_Fila(nuevoTE);
            }


            return(berror);
        }
        protected void btnEditarCapacitacion_Click(object sender, EventArgs e)
        {
            int IdUsuario = Convert.ToInt32(ddlUsuEditCap.SelectedValue);

            int idGestion = Convert.ToInt32(hdfEditCapacitacionID.Value);

            GrupoLiEntities contexto = new GrupoLiEntities();
            gestion_laboral Edit     = contexto.gestion_laboral.SingleOrDefault(b => b.id_ges_lab == idGestion);

            if (Edit != null)
            {
                Edit.fecha       = Convert.ToDateTime(txtFechaEditCapacitacion.Text);
                Edit.descripcion = txtDesCapEdit.Text;
                Edit.cant_horas  = Convert.ToInt32(txtHorasEditCapacitacion.Text);
                Edit.objetivos   = txtObjCapEdit.Text;
                Edit.id_usuario  = IdUsuario;
            }
            ObjUsuario.Error = CRUD.Edit_Fila(contexto);

            if (ObjUsuario.Error)
            {
                alarma nuevo = new alarma()
                {
                    descripcion   = "Capacitacion (Editado) " + txtDesCapEdit.Text,
                    fecha         = Convert.ToDateTime(txtFechaEditCapacitacion.Text),
                    prioridad     = "Media",
                    id_categorias = 1,
                    id_usuario    = IdUsuario
                };

                ObjUsuario.Error = CRUD.Add_Fila(nuevo);
            }

            if (ObjUsuario.Error)
            {
                trabajador_gestion tabla = new trabajador_gestion();
                ObjUsuario.Error = CRUD.Delete_Fila(tabla, Convert.ToInt32(hdfEditCapacitacionID.Value));

                foreach (ListItem item in chkTrabajadores.Items)
                {
                    if (item.Selected == true)
                    {
                        trabajador_gestion nuevoTG3 = new trabajador_gestion()
                        {
                            id_trabajador = Convert.ToInt32(item.Value),
                            id_ges_lab    = Convert.ToInt32(hdfEditCapacitacionID.Value),
                            asistencia    = "-"
                        };
                        ObjUsuario.Error = CRUD.Add_Fila(nuevoTG3);
                    }
                }
            }

            Modal.MostrarAlertaEdit(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            Modal.CerrarModal("EditCapacitacion", "EditModalScript", this);
            LlenarGridView();
        }
Esempio n. 13
0
        //------------------FUNCIONES DE CREAR, EDITAR Y ELIMINAR
        public static bool Add_PuestoTrabajo_Sucursal(String[] valores)
        {
            puesto_trabajo nuevo = new puesto_trabajo()
            {
                nombre      = "Puesto de Trabajo Default " + valores[0],
                descripcion = "Descripcion del Puesto Default",
                id_area     = Mgr_Area.Get_Area()
            };

            return(CRUD.Add_Fila(nuevo));
        }
        protected void InsertarCapacitacion(object sender, EventArgs e)
        {
            int IdUsuario = Convert.ToInt32(ddlUsuAddCap.SelectedValue);

            gestion_laboral nuevoGestion = new gestion_laboral()
            {
                fecha        = Convert.ToDateTime(txtFechaCapacitacion.Text),
                descripcion  = txtDescCapAdd.Text,
                tipo_gestion = 2,
                cant_horas   = Convert.ToInt32(txtHoras.Text),
                objetivos    = txtObjCapAdd.Text,
                id_usuario   = IdUsuario
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevoGestion);

            if (ObjUsuario.Error)
            {
                alarma nuevo = new alarma()
                {
                    descripcion   = "Capacitacion  " + txtDescCapAdd.Text,
                    fecha         = Convert.ToDateTime(txtFechaCapacitacion.Text),
                    prioridad     = "Media",
                    id_categorias = 1,
                    id_usuario    = IdUsuario
                };
                ObjUsuario.Error = CRUD.Add_Fila(nuevo);
            }

            if (ObjUsuario.Error)
            {
                #region trabajador gestion
                string id_ges_lab = Convert.ToString(Mgr_GestionLaboral.GetId_GestionLaboral);

                foreach (ListItem item in chkTrabajadores.Items)
                {
                    if (item.Selected == true)
                    {
                        trabajador_gestion nuevoTG2 = new trabajador_gestion()
                        {
                            id_trabajador = Convert.ToInt32(item.Value),
                            id_ges_lab    = Convert.ToInt32(id_ges_lab),
                            asistencia    = "-"
                        };
                        ObjUsuario.Error = CRUD.Add_Fila(nuevoTG2);
                    }
                }
                #endregion

                Modal.CerrarModal("AddCapacitacion", "AddModalScript", this);
                Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
                LlenarGridView();
            }
        }
        protected void GuardarRegistro(object sender, EventArgs e)
        {
            plan nuevo = new plan()
            {
                id_sucursal = ObjUsuario.Id_sucursal,
                nombre      = txtProgInspecciones.Text
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);
            Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtProgInspecciones);
        }
        protected void btnEditarJornada_Click(object sender, EventArgs e)
        {
            int IdUsuario = Convert.ToInt32(ddlUsuEditJor.SelectedValue);

            GrupoLiEntities contexto  = new GrupoLiEntities();
            int             idGestion = Convert.ToInt32(hdfEditJornadaID.Value);
            gestion_laboral Edit      = contexto.gestion_laboral.SingleOrDefault(b => b.id_ges_lab == idGestion);

            if (Edit != null)
            {
                Edit.fecha       = Convert.ToDateTime(txtFechaEditJornada.Text);
                Edit.descripcion = txtDescEditJornada.Text;
            }
            ObjUsuario.Error = CRUD.Edit_Fila(contexto);

            if (ObjUsuario.Error)
            {
                alarma nuevo = new alarma()
                {
                    descripcion   = "Jornada Examenes (Editado) " + txtDescEditJornada.Text,
                    fecha         = Convert.ToDateTime(txtFechaEditJornada.Text),
                    prioridad     = "Media",
                    id_categorias = 1,
                    id_usuario    = IdUsuario
                };

                ObjUsuario.Error = CRUD.Add_Fila(nuevo);
            }

            if (ObjUsuario.Error)
            {
                #region codigo
                gestion_laboral tabla = new gestion_laboral();
                //ObjUsuario.Error = CRUD.Delete_Fila(tabla, Convert.ToInt32(hdfEditJornadaID.Value));

                foreach (ListItem item in chkTrabajadores.Items)
                {
                    if (item.Selected == true)
                    {
                        trabajador_gestion nuevoTG7 = new trabajador_gestion()
                        {
                            id_trabajador = Convert.ToInt32(item.Value),
                            id_ges_lab    = Convert.ToInt32(hdfEditJornadaID.Value)
                        };
                        ObjUsuario.Error = CRUD.Add_Fila(nuevoTG7);
                    }
                }
                #endregion
            }

            Modal.CerrarModal("EditJornada", "EditModalScript", this);
            Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            LlenarGridView();
        }
Esempio n. 17
0
        protected void AgregarRegistro(object sender, EventArgs e)
        {
            epp nuevo = new epp()
            {
                nombre      = txtNombreAdd.Text,
                id_tipo_epp = Convert.ToInt32(ddlTipoEppAdd.SelectedValue)
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);
            Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            LlenarGridView();
        }
        protected void InsertarJornada(object sender, EventArgs e)
        {
            int IdUsuario = Convert.ToInt32(ddlUsuAddJor.SelectedValue);

            gestion_laboral nuevoGestion = new gestion_laboral()
            {
                fecha        = Convert.ToDateTime(txtFechaJornada.Text),
                descripcion  = txtDescJornada.Text,
                tipo_gestion = 3,
                id_usuario   = IdUsuario
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevoGestion);

            if (ObjUsuario.Error)
            {
                alarma nuevo = new alarma()
                {
                    descripcion   = "Jornada de Examenes  " + txtDescJornada.Text,
                    fecha         = Convert.ToDateTime(txtFechaJornada.Text),
                    prioridad     = "Media",
                    id_categorias = 1,
                    id_usuario    = IdUsuario
                };

                ObjUsuario.Error = CRUD.Add_Fila(nuevo);
            }

            if (ObjUsuario.Error)
            {
                #region trabajador gestion
                string id_ges_lab = Convert.ToString(Mgr_GestionLaboral.GetId_GestionLaboral);

                foreach (ListItem item in chkTrabajadores.Items)
                {
                    if (item.Selected == true)
                    {
                        trabajador_gestion nuevoTG6 = new trabajador_gestion()
                        {
                            id_trabajador = Convert.ToInt32(item.Value),
                            id_ges_lab    = Convert.ToInt32(id_ges_lab)
                        };
                        ObjUsuario.Error = CRUD.Add_Fila(nuevoTG6);
                    }
                }
                #endregion

                Modal.CerrarModal("AddJornada", "AddModalScript", this);
                Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
                LlenarGridView();
            }
        }
Esempio n. 19
0
        public static bool Add_Respuesta(String[] valores)
        {
            Respuesta nuevo = new Respuesta()
            {
                cuerpo_respuesta = valores[0],
                usuario          = valores[1],
                id_pregunta      = Convert.ToInt32(valores[2]),
                fecha            = DateTime.Now,
                calificacion     = 0
            };

            return(CRUD.Add_Fila(nuevo));
        }
Esempio n. 20
0
        public static bool Add_Area_Sucursal(String[] valores)
        {
            area nuevo = new area()
            {
                nombre        = valores[0],
                id_sucursal   = Convert.ToInt32(valores[1]),
                id_area_padre = 0,
                nivel         = 1,
                tipo          = "Administrativa"
            };

            return(CRUD.Add_Fila(nuevo));
        }
Esempio n. 21
0
        //----------FUNCIONES DE CREAR, EDITAR Y ELIMINAR
        public static bool Add_Pregunta(Model_UsuarioSistema ObjUsuario, String[] valores)
        {
            Pregunta nuevo = new Pregunta()
            {
                titulo          = valores[0],
                cuerpo_pregunta = valores[1],
                id_usuario      = ObjUsuario.Id_usuario,
                estatus         = 0,
                fecha           = DateTime.Now
            };

            return(CRUD.Add_Fila(nuevo));
        }
Esempio n. 22
0
        //------------FUNCIONES DE CREAR, EDITAR Y ELIMINAR
        public static bool Add_Horario_Sucursal(String[] valores)
        {
            horario nuevo = new horario()
            {
                nombre         = "Horario Default " + valores[0],
                id_empresa     = Mgr_Empresa.Get_Max_Empresas(),
                fecha_inicio   = "12:00",
                fecha_fin      = "01:00",
                fecha_creacion = DateTime.Today
            };

            return(CRUD.Add_Fila(nuevo));
        }
Esempio n. 23
0
        public static bool Add_PuestoTrabajo(Model_UsuarioSistema ObjUsuario, String[] valores, FileUpload fuAnexo, ListBox ddlEpp)
        {
            string ruta = Utilidades.GuardarImagen(fuAnexo, valores[0] + "PuestoTrabajo", Paginas.Archivos_PuestoTrabajo.Value);

            puesto_trabajo nuevo = new puesto_trabajo()
            {
                nombre         = valores[0],
                descripcion    = valores[1],
                recurso_humano = valores[2],
                objeto_trabajo = valores[3],
                insumos        = valores[4],
                maquinas       = valores[5],
                herramientas   = valores[6],
                emisiones      = valores[7],
                productos      = valores[8],
                desechos       = valores[9],
                foto           = ruta,
                id_area        = Convert.ToInt32(valores[10])
            };


            int      IdUsuario   = ObjUsuario.Id_usuario;
            DateTime fechaActual = DateTime.Now;
            Boolean  bError      = false;

            if (CRUD.Add_Fila(nuevo))
            {
                if (ddlEpp.SelectedValue != string.Empty)
                {
                    foreach (ListItem li in ddlEpp.Items)
                    {
                        if (li.Selected)
                        {
                            puesto_trabajo_epp nuevopuestoEpp = new puesto_trabajo_epp()
                            {
                                id_puesto_trabajo = Convert.ToInt32(Get_PuestoTrabajo()),
                                id_epp            = Convert.ToInt32(li.Value)
                            };
                            bError = CRUD.Add_Fila(nuevopuestoEpp);

                            if (!bError)
                            {
                                return(bError);
                            }
                        }
                    }
                }
            }

            return(bError);
        }
Esempio n. 24
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            perfil_cargo nuevo = new perfil_cargo()
            {
                id_empresa  = ObjUsuario.Id_empresa,
                descripcion = txtDescripcion.Text,
                nombre      = txtNombre.Text,
                id_cno      = Convert.ToInt32(ddlCargo.SelectedValue)
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);

            Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtNombre);
        }
Esempio n. 25
0
        //----------FUNCIONES DE CREAR, EDITAR Y ELIMINAR
        public static bool Add_Lista_Actividad(int id_sucursal)
        {
            lista_actividad nuevo = new lista_actividad()
            {
                actividad   = "Crear Documento de Autoevaluación",
                id_sucursal = id_sucursal,
                estatus     = "No",
                fase        = "E",
                link        = "../EvaluacionInicial/index_AutoEvaluacion.aspx",
                anho        = DateTime.Now.Year
            };

            return(CRUD.Add_Fila(nuevo));
        }
Esempio n. 26
0
        protected void Guardar(object sender, EventArgs e)
        {
            phGuardar.Visible = true;

            Double totalSi = 0;
            Double totalNo = 0;

            for (int i = 1; i <= 36; i = i + 2)
            {
                HtmlInputRadioButton miradio1 = (HtmlInputRadioButton)panel1.FindControl("radio" + i);
                HtmlInputRadioButton miradio2 = (HtmlInputRadioButton)panel1.FindControl("radio" + (i + 1));

                if (miradio1.Checked == true)
                {
                    totalSi++;
                }
                if (miradio2.Checked == true)
                {
                    totalNo++;
                }
            }

            lbTotalSi.Text = "" + totalSi;
            lbTotalNo.Text = "" + totalNo;

            Double[] valores = { totalSi, totalNo };

            Double porcentaje = Math.Round(((totalNo * 100) / (totalSi + totalNo)), 2);

            lbObservaciones.Text = "El porcentaje de riesgo indican condiciones de trabajo que pueden estar asociadas a " +
                                   "alto riesgo de lesión o enfermedad es de: " + porcentaje + "%";


            encuesta_politica nuevo = new encuesta_politica()
            {
                id_trabajador = Convert.ToInt32(ddlTrabajador.SelectedValue),
                fecha         = DateTime.Now,
                si            = (100 - porcentaje),
                no            = porcentaje,
                tipo          = "Conocimiento Objetivos PoliticaSST"
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);

            if (ObjUsuario.Error)
            {
                Response.Redirect(Paginas.index_Encuesta_PoliticaSST.Value);
            }
        }
Esempio n. 27
0
        public static bool Add_EmpresaSimple(String[] valores)
        {
            empresa nuevo = new empresa()
            {
                nombre        = valores[0],
                CodEmpresa    = valores[1],
                nit           = valores[2],
                email         = valores[3],
                representante = valores[4],
                movil         = valores[5],
                fijo          = valores[6],
                logo_url      = ""
            };

            return(CRUD.Add_Fila(nuevo));
        }
Esempio n. 28
0
        protected void Guardar(object sender, EventArgs e)
        {
            int IdEmpresa = Mgr_Empresa.Set_IdEmpresaDDl(ObjUsuario, ddlEmpresaAdd);

            categoria nuevo = new categoria()
            {
                nombre      = txtNombre.Text,
                descripcion = txtDescripcion.Text,
                id_empresa  = IdEmpresa
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);
            Modal.CerrarModal("addModal", "AddModalScript", this);

            Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            LlenarGridView();
        }
Esempio n. 29
0
        protected void AgregarRegistro(object sender, EventArgs e)
        {
            string ruta      = Utilidades.GuardarArchivo(flpArchivo, txtNombreEdit.Text, "~/archivos/ico_tipo_epp/");
            int    IdEmpresa = Mgr_Empresa.Set_IdEmpresaDDl(ObjUsuario, ddlEmpresaAdd);

            tipo_epp nuevo = new tipo_epp()
            {
                nombre       = txtNombreAdd.Text,
                nombre_senal = txtNombreSenalAdd.Text,
                url_senal    = ruta
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);

            Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            LlenarGridView();
        }
Esempio n. 30
0
        //---------------FUNCIONES DE CREAR, EDITAR Y ELIMINAR
        public static bool Add_Area(CheckBox chkAreaPadre, String[] valores)
        {
            int id_area_padre = 0;

            if (!chkAreaPadre.Checked || (valores[0] == string.Empty))
            {
                valores[1] = "1";
            }
            else
            {
                id_area_padre = Convert.ToInt32(valores[0]);

                List <area> ListaArea = new List <area>();
                ListaArea = Get_Area(0, Convert.ToInt32(valores[0]), "");

                foreach (var item in ListaArea)
                {
                    valores[1] = item.nivel.ToString();
                }

                if (valores[1] == "1")
                {
                    valores[1] = "2";
                }
                else if (valores[1] == "2")
                {
                    valores[1] = "3";
                }
                else if (valores[1] == "3")
                {
                    valores[1] = "4";
                }
            }

            area nuevo = new area()
            {
                nombre        = valores[2],
                id_sucursal   = Convert.ToInt32(valores[3]),
                id_area_padre = id_area_padre,
                nivel         = Convert.ToInt32(valores[1]),
                tipo          = valores[4]
            };

            return(CRUD.Add_Fila(nuevo));
        }