Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int c_npartida = 0;

            if (Page.IsPostBack == false) // Se carga la pagina por primera vez
            {
                //saco el ultimo folio
                secuSolBO MysecuSolBO = new secuSolBO();
                secuSol MysecuSol = new secuSol();
                MysecuSol = MysecuSolBO.RetrieveCapacitacion(MysecuSol);
                MysecuSol.n_secuencia = MysecuSol.n_secuencia;
                c_npartida = MysecuSol.n_secuencia - 1;

                folio_solicitud.Text = Convert.ToString(c_npartida);

                UserId.Text = (string)(Session["Username"]);
                Ultimasolicitud();

            }
            //LoadEmpleadosFiltros();
            LoadEmpleadosFiltrosxCompania();
        }
Example #2
0
        public static string InsertarEncabezado(string parEmpleado, 
                                                string parFecha, 
                                                string parPuesto, 
                                                string parCurso, 
                                                string parLugar, 
                                                string parArea, 
                                                string parProveedor, 
                                                string parJustificacion, 
                                                string parComida, 
                                                string parCoffe, 
                                                string parJefeDirecto, 
                                                string parUnidadnegocio, 
                                                string parNombrecompleto, 
                                                string parUserId,
                                                string parNombreCompania)
        {
            //saco el ultimo folio
            secuSolBO MysecuSolBO = new secuSolBO();
            secuSol MysecuSol = new secuSol();
            MysecuSol = MysecuSolBO.RetrieveCapacitacion(MysecuSol);
            MysecuSol.n_secuencia = MysecuSol.n_secuencia;

            EntidadSolCapacitacion cap = new EntidadSolCapacitacion();
            cap.NoEmpleado = parEmpleado;
            cap.FechaCapacitacion = parFecha;
            cap.Puesto = parPuesto;
            cap.IdCurso = parCurso;
            cap.Lugar = parLugar;
            cap.Area = parArea;
            cap.Proveedor = parProveedor;
            cap.Justificacion = parJustificacion;
            cap.Comida = parComida;
            cap.Coffee = parCoffe;
            cap.JefeDirecto = parJefeDirecto;
            cap.UnidadNegocio = parUnidadnegocio;
            cap.NombreEmpleado = parNombrecompleto;
            cap.FolioSolicitud = MysecuSol.n_secuencia;
            cap.UserSolicitud = parUserId;
            cap.NombreCompania = parNombreCompania;

            //inserta el numero de folio 
            NegocioSolicitudCap nCap = new NegocioSolicitudCap(cap);
            bool bander = nCap.InsertEncabezadoSolicitud();

            //sino esta vacia el numero de solicitud insertamos el no de incidencia al archivo subido
            if (Convert.ToString(MysecuSol.n_secuencia) != "")
            {
                using (SqlConnection cnxUp = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
                {
                    cnxUp.Open();

                    string qUpdate = " UPDATE SOL_DOCUMENTOS set ID_SOLICITUD= " + MysecuSol.n_secuencia + " " +
                                     " WHERE  (ID_SOLICITUD = '0') AND (SOL_USER_ALTA ='" + parUserId + "') AND (SOL_STATUS = 'ALTA') AND " +
                                     " (CONVERT(VARCHAR(10), SOL_FECHA,103) = CONVERT(nvarchar(10), GETDATE(), 103)) AND " +
                                     " dateadd(HOUR, datediff(HOUR, 0, SOL_FECHA), 0) = dateadd(HOUR, datediff(HOUR, 0, GETDATE()), 0) ";
                    SqlCommand cmdUp = new SqlCommand(qUpdate, cnxUp);
                    SqlDataReader dr2 = cmdUp.ExecuteReader();
                }
            }

            //-==================================== ENVIA CORREO A RH y COORDINACION de ALTA DE INCIDENCIA ==============================
            string connectionString = ConfigurationManager.ConnectionStrings["conexionAPPS"].ConnectionString;
            string mensaje1 = " <table class=style1 font-family=calibri> " +
                                     " <tr><td colspan=8 align=center><strong>   SOLICITUD DE CAPACITACION  </strong></td></tr> " +
                                     " <tr>  " +
                                     " <td style=background-color: #C0C0C0 > " +
                                     " <strong>NO SOLICITUD</strong></td> " +
                                     " <td style=background-color: #C0C0C0> " +
                                     " <strong>FECHA DE CAPACITACION</strong></td> " +
                                     " <td style=background-color: #C0C0C0> " +
                                     " <strong>LUGAR</strong></td> " +
                                     " <td style=background-color: #C0C0C0> " +
                                     " <strong>SOLICITANTE</strong></td>  " +
                                     " <td style=background-color: #C0C0C0>  " +
                                     " <strong>PROVEEDOR</strong></td>  " +
                                     " <td style=background-color: #C0C0C0> " +
                                     " <strong>CURSO</strong></td> " +
                                     " <td style=background-color: #C0C0C0>  " +
                                     " <strong>ESTATUS</strong></td> " +
                                     " </tr> " +
                                     " <tr> " +
                                          "  <td> " + MysecuSol.n_secuencia + " </td> " +
                                          "  <td> " + parFecha +  " </td> " +
                                          "  <td> " + parLugar + " </td> " +
                                          "  <td> " + parEmpleado + " " + parNombrecompleto + " </td> " +
                                          "  <td> " + parProveedor + " </td> " +
                                          "  <td> " + parCurso + " </td> " +
                                          "  <td> " + parJustificacion + " </td> " +
                                      "  </tr> " +
                              " </table> ";

            //correoDO enviarCorreo = new correoDO();
            //enviarCorreo.EnviaMail("ALTA DE INCIDENCIA", mensaje1, "*****@*****.**");
            string email1 = "";
            using (SqlConnection cnx = new SqlConnection(connectionString))
            {
                cnx.Open();
                string query = " SELECT usr_username, usr_passwd, usr_nombre, usr_apellido_pat, usr_apellido_mat, usr_email, " +
                               "        usr_id_JDE, usr_id_JDE_AB " +
                               " FROM   SYS_USR_USERS " +
                               " WHERE  (usr_username = '******') ";
                SqlCommand cmd = new SqlCommand(query, cnx);
                SqlDataReader dr = cmd.ExecuteReader();
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        email1 = dr["usr_email"].ToString();
                    }
                }
            }
            string listaemail = "";
            if (email1 == "")
            {
                listaemail = "[email protected], [email protected], [email protected], [email protected]";
            }
            listaemail = email1 + ", [email protected], [email protected], [email protected], [email protected]";

            //envio el correo a la lista de empleados y el que capturo la incidencia
            correoDO enviarCorreo = new correoDO();
            enviarCorreo.EnviaMail("ALTA DE SOLICITUD DE CAPACITACION", mensaje1, listaemail);
            return "Add" ;
         
        }
Example #3
0
        // **** Eventos en Cabecera **** //
        protected void Click_BotonGuardarEnc(object sender, EventArgs e)
        {
            MensajeError(string.Empty);
            MensajeExito(string.Empty);

            int graba = 1;

            if (graba == 1 && this.list_empleados.SelectedValue.ToString() == "0")
            {
                MensajeError("Seleccione el Empleado que viajara");
                graba = 0;
            }

            if (graba == 1 && this.txt_f_inicio_sol.Text.ToString() == string.Empty)
            {
                MensajeError("Indique la fecha en la que viajara (Fecha de partida)");
                graba = 0;
            }
            if (graba == 1 && this.txt_f_fin_sol.Text.ToString() == "")
            {
                MensajeError("Capture la fecha en la que estara de vuelta (Fecha de regreso)");
                graba = 0;
            }

            if (graba == 1 && this.List_UniNeg.SelectedValue.ToString() == "00")
            {
                MensajeError("Capture la Unidad de Negocio");
                graba = 0;
            }

            if (graba == 1 && this.txt_d_referencias_sugeridas.Text.ToString() == "")
            {
                MensajeError("Capture la ciudad a la que viajara");
                graba = 0;
            }

            if (graba == 1 && this.txt_objeto.Text.ToString() == "")
            {
                MensajeError("Capture el proposito del viaje viaticos");
                graba = 0;
            }

            if (graba == 1 && this.List_vehiculos.SelectedValue.ToString() == "00")
            {
                MensajeError("Indique si necesitara vehiculo por parte de la empresa");
                graba = 0;
            }

            if (this.TextIdEmpresa.Text.ToString() == "" || this.TextIdEmpresa.Text.ToString() == null)
            {
                //MensajeError("Indique si necesitara vehiculo por parte de la empresa");
                TextIdEmpresa.Text = "0";
            }

            if (graba == 1)
            {
                DesahabilitarControles();

                solSolicitudesBO objsolSolicitudesBO = new solSolicitudesBO();
                solSolicitudes objsolSolicitudes = new solSolicitudes();

                objsolSolicitudes.C_tipo = "VIA";
                objsolSolicitudes.C_unidadNeg = this.List_UniNeg.SelectedValue.ToString();
                objsolSolicitudes.D_solicitud = txt_objeto.Text;
                objsolSolicitudes.C_estado_sol = "CAP";

                String usuario = Session["Username"].ToString();
                objsolSolicitudes.C_user_captura = usuario.ToUpper();

                objsolSolicitudes.F_solicitud = DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year;
                objsolSolicitudes.C_emp_solicita_JDE = list_empleados.SelectedValue.ToString();
                objsolSolicitudes.C_emp_autoriza_JDE = lbl_id_empAutoriza.Text;
                objsolSolicitudes.I_importe_total = 0;
                objsolSolicitudes.F_inicio_via = txt_f_inicio_sol.Text;
                objsolSolicitudes.F_fin_via = txt_f_fin_sol.Text;
                objsolSolicitudes.D_lugar_via = txt_d_referencias_sugeridas.Text;
                objsolSolicitudes.C_req_vehi = this.List_vehiculos.SelectedValue.ToString();
                objsolSolicitudes.C_num_unidad = this.TxtNumeroUnidad.Text;

                secuSolBO MysecuSolBO = new secuSolBO();
                secuSol MysecuSol = new secuSol();
                MysecuSol = MysecuSolBO.RetrieveViaticos(MysecuSol);
                MysecuSol.n_secuencia = MysecuSol.n_secuencia + 1;

                objsolSolicitudes.N_solicitud = MysecuSol.n_secuencia;

                objsolSolicitudes.D_unidadNeg = this.List_UniNeg.SelectedItem.Text.Trim();
                objsolSolicitudes.D_emp_solicita_JDE = list_empleados.SelectedItem.Text.Trim();
                objsolSolicitudes.D_emp_autoriza_JDE = lbl_d_autorizador.Text.Trim();

                objsolSolicitudes.C_idcompania = TextIdEmpresa.Text.Trim();

                objsolSolicitudesBO.graba(objsolSolicitudes);
                MysecuSolBO.Save(MysecuSol);

                etiquetaNoSolicitud.Text = MysecuSol.n_secuencia.ToString();
                //list_empleados.DataBind();

                // Oculta la Cabecera

                // Muestra panel de lineas
                panelCabecera.CssClass = "da-panel collapsible collapsed";
                panelPartidas.Visible = true;
                MensajeExitoPartidas("Proceda a Capturar las partidas que conforman la Solicitud..");
            }
        }
Example #4
0
        public static string InsertarFolio()
        {
            //busco el ultimo folio e incremento
            secuSolBO MysecuSolBO = new secuSolBO();
            secuSol MysecuSol = new secuSol();
            MysecuSol = MysecuSolBO.RetrieveCapacitacion(MysecuSol);
            MysecuSol.n_secuencia = MysecuSol.n_secuencia + 1;

            EntidadSolCapacitacion inc = new EntidadSolCapacitacion();
            inc.IdDescRegistro = MysecuSol.n_secuencia;
            //inc.IdProveedor = parStatus;

            //inserta el numero de folio 
            NegocioSolicitudCap nInc = new NegocioSolicitudCap(inc);
            bool bander = nInc.UpdateFolioSolicitudCap();

            //inserto el encabezado
            return "Add";
        }