public string Update(solSolicitudes objsolSolicitudes) { try { String _c_tipo = objsolSolicitudes.C_tipo; int _n_solicitud = objsolSolicitudes.N_solicitud; String _c_unidadNeg = objsolSolicitudes.C_unidadNeg; String _c_unidadNegNew = objsolSolicitudes.C_unidadNegNew; String _d_solicitud = objsolSolicitudes.D_solicitud; String _c_estado_sol = objsolSolicitudes.C_estado_sol; String _c_user_captura = objsolSolicitudes.C_user_captura; String _f_solicitud = objsolSolicitudes.F_solicitud; String _c_emp_solicita_JDE = objsolSolicitudes.C_emp_solicita_JDE; String _f_autoriza_sol = objsolSolicitudes.F_autoriza_sol; String _c_emp_autoriza_JDE = objsolSolicitudes.C_emp_autoriza_JDE; float _i_importe_total = objsolSolicitudes.I_importe_total; String _f_inicio_via = objsolSolicitudes.F_inicio_via; String _f_fin_via = objsolSolicitudes.F_fin_via; String _d_lugar_via = objsolSolicitudes.D_lugar_via; String _c_req_vehi = objsolSolicitudes.C_req_vehi; String _c_num_unidad = objsolSolicitudes.C_num_unidad; String _d_unidadNeg = objsolSolicitudes.D_unidadNeg; String _d_emp_solicita_JDE = objsolSolicitudes.D_emp_solicita_JDE; String _d_emp_autoriza_JDE = objsolSolicitudes.D_emp_autoriza_JDE; String strQuery = " UPDATE SOL_SOLICITUDES SET C_TIPO =" + " '" + _c_tipo + "'," + " N_SOLICITUD =" + " " + _n_solicitud + "," + " C_UNIDADNEG =" + " '" + _c_unidadNegNew + "'," + " D_SOLICITUD =" + " '" + _d_solicitud + "'," + " C_ESTADO_SOL =" + " '" + _c_estado_sol + "'," + " C_USER_CAPTURA =" + " '" + _c_user_captura + "'," + " F_SOLICITUD =" + " '" + _f_solicitud + "'," + " C_EMP_SOLICITA_JDE =" + " '" + _c_emp_solicita_JDE + "'," + " F_AUTORIZA_SOL =" + " '" + _f_autoriza_sol + "'," + " C_EMP_AUTORIZA_JDE =" + " '" + _c_emp_autoriza_JDE + "'," + " I_IMPORTE_TOTAL =" + " " + _i_importe_total + "," + " F_INICIO_VIA =" + " '" + _f_inicio_via + "'," + " F_FIN_VIA =" + " '" + _f_fin_via + "'," + " D_LUGAR_VIA =" + " '" + _d_lugar_via + "'," + " C_REQ_VEHI =" + " '" + _c_req_vehi + "'," + " C_NUM_UNIDAD =" + " '" + _c_num_unidad + "', " + " d_unidadNeg =" + " '" + _d_unidadNeg + "', " + " d_emp_solicita_JDE =" + " '" + _d_emp_solicita_JDE + "', " + " d_emp_autoriza_JDE =" + " '" + _d_emp_autoriza_JDE + "' " + " WHERE C_TIPO = '" + _c_tipo + "' AND N_SOLICITUD= " + _n_solicitud + " AND C_UNIDADNEG='" + _c_unidadNeg + "'"; ActionQuery(strQuery); strQuery = " UPDATE dSol_solicitudes SET c_unidadNeg =" + " '" + _c_unidadNegNew + "' " + " WHERE C_TIPO = '" + _c_tipo + "' AND N_SOLICITUD= " + _n_solicitud + " AND C_UNIDADNEG='" + _c_unidadNeg + "'"; ActionQuery(strQuery); return "true"; } catch (Exception e) { throw e; } }
public String grabarFinal(solSolicitudes objsolSolicitudes) { solSolicitudesDO MysolSolicitudesDO = new solSolicitudesDO(); //return MysolSolicitudesDO.grabarFinal(objsolSolicitudes); int N_solicitud = objsolSolicitudes.N_solicitud; String C_tipo = objsolSolicitudes.C_tipo; String C_unidadNeg = objsolSolicitudes.C_unidadNeg; float total = 0; int partidaAviones = 0; try { total = float.Parse(QueryEscalar("SELECT SUM(n_total) AS total FROM dSol_solicitudes WHERE N_SOLICITUD=" + N_solicitud + " AND c_tipo='" + C_tipo + "' AND c_unidadNeg='" + C_unidadNeg + "'")); String strQuery = " UPDATE SOL_SOLICITUDES SET n_finalCaptura =" + 1 + " , i_importe_total=" + total + " WHERE N_SOLICITUD=" + N_solicitud + " AND c_tipo='" + C_tipo + "' AND c_unidadNeg='" + C_unidadNeg + "'"; ActionQuery(strQuery); //----------------------------------------------------------------------------------------------------- // ----- 21-10-2014 --------- // ----- Verificar si el viatico tiene partida de aviones GPA -> PASAJES AEREOS --------- //----------------------------------------------------------------------------------------------------- //partidaAviones = int.Parse(QueryEscalar("SELECT COUNT(n_solicitud) FROM dSol_solicitudes WHERE N_SOLICITUD = " + N_solicitud + " AND N_ISPLANE = 1 AND N_CONCEPTO_VIA = 'GPA' ")); partidaAviones = int.Parse(QueryEscalar("SELECT count(n_partida) FROM dSol_solicitudes WHERE N_SOLICITUD = " + N_solicitud + " AND N_ISPLANE = 1 AND N_CONCEPTO_VIA = 'GPA' ")); if (partidaAviones > 0) { objsolSolicitudes = MysolSolicitudesDO.Retrieve(objsolSolicitudes); dSolicitudes MydSolicitudes = new dSolicitudes(); dSolicitudesDO MydSolicitudesDO = new dSolicitudesDO(); MydSolicitudes.C_tipo = objsolSolicitudes.C_tipo; MydSolicitudes.N_solicitud = objsolSolicitudes.N_solicitud ; MydSolicitudes.C_unidadNeg = objsolSolicitudes.C_unidadNeg; MydSolicitudes.N_partida = partidaAviones; MydSolicitudes = MydSolicitudesDO.Retrieve(MydSolicitudes); // Enviar correo a recepcion string asunto = "Solicitud Boletos Avión -" + objsolSolicitudes.D_emp_solicita_JDE + "-" + objsolSolicitudes.D_lugar_via; string cuerpoCorreo = "El empleado " + objsolSolicitudes.D_emp_solicita_JDE + " levantó una solicitud de boletos de avión para viajar a " + objsolSolicitudes.D_lugar_via + " iniciando el " + objsolSolicitudes.F_inicio_via + " y regresando el " + objsolSolicitudes.F_fin_via + " <BR><P> Viatico : VIA-" + objsolSolicitudes.N_solicitud + " <BR>Observaciones : " + MydSolicitudes.D_solicitud + "</P>"; correoDO correo = new correoDO(); correo.EnviaMail(asunto, cuerpoCorreo, "*****@*****.**"); } //------------------------------------------------------------------------------------------------ return "true"; } catch (Exception e) { throw e; } }
public solSolicitudes Retrieve(solSolicitudes objsolSolicitudes) { SqlDataReader objDR; try { String _c_tipo = objsolSolicitudes.C_tipo; int _n_solicitud = objsolSolicitudes.N_solicitud; String _c_unidadNeg = objsolSolicitudes.C_unidadNeg; String strQuery = " SELECT c_tipo " + " ,n_solicitud " + " ,c_unidadNeg " + " ,d_solicitud " + " ,c_estado_sol " + " ,c_user_captura " + " ,convert(varchar, f_solicitud, 103) AS f_solicitud " + " ,c_emp_solicita_JDE " + " ,convert(varchar, f_autoriza_sol, 103) AS f_autoriza_sol " + " ,c_emp_autoriza_JDE " + " ,i_importe_total " + " ,convert(varchar, f_inicio_via, 103) AS f_inicio_via " + " ,convert(varchar, f_fin_via, 103) AS f_fin_via " + " ,d_lugar_via " + " ,c_req_vehi " + " ,c_num_unidad " + " ,d_unidadNeg " + " ,d_emp_solicita_JDE " + " ,d_emp_autoriza_JDE " + " ,n_finalCaptura " + " FROM SOL_SOLICITUDES " + " WHERE C_TIPO = '" + _c_tipo + "' AND N_SOLICITUD= " + _n_solicitud + " AND C_UNIDADNEG='" + _c_unidadNeg + "'"; objDR = QueryDR(strQuery); //SELECT // c_tipo // ,n_solicitud // ,c_unidadNeg // ,d_solicitud // ,c_estado_sol // ,c_user_captura // ,convert(varchar, f_solicitud, 103) AS f_solicitud // ,c_emp_solicita_JDE // ,convert(varchar, f_autoriza_sol, 103) AS f_autoriza_sol // ,c_emp_autoriza_JDE // ,i_importe_total // ,convert(varchar, f_inicio_via, 103) AS f_inicio_via // ,convert(varchar, f_fin_via, 103) AS f_fin_via // ,d_lugar_via // ,c_req_vehi // ,c_num_unidad // ,d_unidadNeg // ,d_emp_solicita_JDE // ,d_emp_autoriza_JDE // ,n_finalCaptura //FROM SOL_SOLICITUDES while (objDR.Read()) { objsolSolicitudes.C_tipo = objDR["c_tipo"].ToString(); objsolSolicitudes.N_solicitud = int.Parse(objDR["n_solicitud"].ToString()); ; objsolSolicitudes.C_unidadNeg = objDR["c_unidadNeg"].ToString(); objsolSolicitudes.D_solicitud = objDR["d_solicitud"].ToString(); objsolSolicitudes.C_estado_sol = objDR["c_estado_sol"].ToString(); objsolSolicitudes.C_user_captura = objDR["c_user_captura"].ToString(); objsolSolicitudes.F_solicitud = objDR["f_solicitud"].ToString(); objsolSolicitudes.C_emp_solicita_JDE = objDR["c_emp_solicita_JDE"].ToString(); objsolSolicitudes.F_autoriza_sol = objDR["f_autoriza_sol"].ToString(); objsolSolicitudes.C_emp_autoriza_JDE = objDR["c_emp_autoriza_JDE"].ToString(); objsolSolicitudes.I_importe_total = float.Parse(objDR["i_importe_total"].ToString()); objsolSolicitudes.F_inicio_via = objDR["f_inicio_via"].ToString(); objsolSolicitudes.F_fin_via = objDR["f_fin_via"].ToString(); objsolSolicitudes.D_lugar_via = objDR["d_lugar_via"].ToString(); objsolSolicitudes.C_req_vehi = objDR["c_req_vehi"].ToString(); objsolSolicitudes.C_num_unidad = objDR["c_num_unidad"].ToString(); objsolSolicitudes.D_unidadNeg = objDR["d_unidadNeg"].ToString(); objsolSolicitudes.D_emp_solicita_JDE = objDR["d_emp_solicita_JDE"].ToString(); objsolSolicitudes.D_emp_autoriza_JDE = objDR["d_emp_autoriza_JDE"].ToString(); } objDR.Close(); return objsolSolicitudes; } catch (Exception e) { throw e; } }
public DataTable BuscaViaticosPropios(String _n_solicitud, String _c_unidadNeg, String c_estado_sol, String c_emp_autoriza_JDE, String d_solicitud, String c_user_captura) { solSolicitudes objsolSolicitudes = new solSolicitudes(); objsolSolicitudes.C_tipo = "VIA"; if (_n_solicitud != null) objsolSolicitudes.N_solicitud = int.Parse(_n_solicitud); else objsolSolicitudes.N_solicitud = 0; if (c_estado_sol == "ALL") objsolSolicitudes.C_estado_sol = ""; else objsolSolicitudes.C_estado_sol = c_estado_sol; objsolSolicitudes.C_unidadNeg = _c_unidadNeg; objsolSolicitudes.C_user_captura = c_user_captura; objsolSolicitudes.D_emp_solicita_JDE = c_emp_autoriza_JDE; //objsolSolicitudes.C_emp_autoriza_JDE = c_emp_autoriza_JDE; objsolSolicitudes.D_solicitud = d_solicitud; solSolicitudesDO MysolSolicitudesDO = new solSolicitudesDO(); return MysolSolicitudesDO.BuscaSolicitudPropias(objsolSolicitudes); }
public DataTable BuscaSolicitudPropias(solSolicitudes objsolSolicitudes) { try { String _c_tipo = objsolSolicitudes.C_tipo; String _n_solicitud; String strfiltron_solici = ""; String _c_unidadNeg; String c_estado_sol = objsolSolicitudes.C_estado_sol; String D_emp_solicita_JDE = objsolSolicitudes.D_emp_solicita_JDE; String d_solicitud; DataTable mytabla = new DataTable(); if (objsolSolicitudes.N_solicitud > 0) { _n_solicitud = objsolSolicitudes.N_solicitud.ToString(); strfiltron_solici = " n_solicitud = '" + _n_solicitud + "' and "; String strQuery = " SELECT * " + " FROM Sol_solicitudes " + " WHERE n_solicitud = '" + _n_solicitud + "' and " + " c_estado_sol like '%" + c_estado_sol + "%' "; mytabla = QueryDS(strQuery).Tables[0]; } else { _n_solicitud = ""; strfiltron_solici = ""; if (objsolSolicitudes.C_unidadNeg == "00") _c_unidadNeg = ""; else _c_unidadNeg = objsolSolicitudes.C_unidadNeg; //String C_user_captura; //if (objsolSolicitudes.D_emp_solicita_JDE == "0") // C_user_captura = " c_user_captura = '" + objsolSolicitudes.C_user_captura + "' "; //else // C_user_captura = " c_emp_solicita_JDE = '" + D_emp_solicita_JDE + "' "; //String c_emp_autoriza_JDE = objsolSolicitudes.C_emp_autoriza_JDE; if (objsolSolicitudes.D_solicitud != null) d_solicitud = objsolSolicitudes.D_solicitud; else d_solicitud = ""; String strQuery = " SELECT * " + " FROM Sol_solicitudes " + " WHERE " + strfiltron_solici + " c_unidadNeg like '%" + _c_unidadNeg + "%' and " + " c_estado_sol like '%" + c_estado_sol + "%' and " + " c_tipo like '%" + _c_tipo + "%' and " + " d_solicitud like '%" + d_solicitud + "%' and " + " c_emp_solicita_JDE = '" + D_emp_solicita_JDE + "' "; mytabla = QueryDS(strQuery).Tables[0]; } //for (int i = 0; i < mytabla.Rows.Count; i++) //{ //} return mytabla; //SELECT * //FROM [APPSDB].[dbo].[Sol_solicitudes] //WHERE n_solicitud LIKE '%%' and // c_unidadNeg like '%%' and // c_estado_sol like '%%' and // c_tipo like '%%' and // c_emp_autoriza_JDE like '%%' } catch (Exception e) { throw new Exception("Encabezado Solicitudes.", e); } }
protected void List_c_cta_contable_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow gvr; DropDownList CmbCOncepto = (DropDownList)sender; String StrCuenta = CmbCOncepto.SelectedValue; String StrEmpleadoViat; StrEmpleadoViat = list_empleados.SelectedValue; //StrEmpleadoViat = lbl_c_empleado.Text; System.DateTime Dt1; System.DateTime Dt2; int dias; int bandera = 1; if ((etiquetaNoSolicitud.Text == "") || (etiquetaNoSolicitud.Text.Trim() == "0")) { MensajeError("Grabe el encabezado de la Solicitud, Verifique!"); bandera = 0; } idviatico.Text = etiquetaNoSolicitud.Text; idviatico2.Text = etiquetaNoSolicitud.Text; if (StrCuenta == "HTL") //para cuando selecciona Gastos de Hotel { ClientScript.RegisterStartupScript(this.GetType(), "myScript", "PrepararComponentes();", true); } if (StrCuenta == "GPA") //para cuando selecciona PASAJES AEREOS { ClientScript.RegisterStartupScript(this.GetType(), "myScript", "PrepararComponentes2();", true); } if (bandera == 1) { if (String.IsNullOrEmpty(txt_f_inicio_sol.Text) == false && String.IsNullOrEmpty(txt_f_fin_sol.Text) == false) { Dt1 = DateTime.ParseExact(txt_f_inicio_sol.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); Dt2 = DateTime.ParseExact(txt_f_fin_sol.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); //dias = DateDiff(DateInterval.Day, Dt1, Dt2) + 1 dias = (int)(Dt2 - Dt1).TotalDays + 1; if (GView_Detalle.Rows.Count == 0) { TextBox txt_q_requeridoNO; TextBox txt_d_materialNO; //Dim emptyRow As = GView_Detalle.Controls(0).Controls(0) GridViewRow emptyRow = (GridViewRow)GView_Detalle.Controls[0].Controls[0]; txt_q_requeridoNO = (TextBox)(emptyRow.FindControl("txt_q_requeridoNO")); txt_d_materialNO = (TextBox)(emptyRow.FindControl("txt_d_materialNO")); Double monto1Tmp; Double Monto; //-------------------------------------------------------------------------------- empleadosBO MyEmpleado = new empleadosBO(); String idEmpleadoJDE = list_empleados.SelectedValue.ToString(); //empleadosBO MyEmpleado = new empleadosBO(); empleado MyEmpleadoE = new empleado(); MyEmpleadoE.IdlibretaDir = int.Parse(idEmpleadoJDE); MyEmpleadoE = MyEmpleado.Retrievex_idlibretaDir(MyEmpleadoE); solSolicitudesBO MydSolicitudesBO = new solSolicitudesBO(); solSolicitudes MydSolicitudes = new solSolicitudes(); MydSolicitudes.N_solicitud = int.Parse(etiquetaNoSolicitud.Text); MydSolicitudes.C_tipo = "VIA"; MydSolicitudes.C_unidadNeg = List_UniNeg.SelectedValue; MydSolicitudes = MydSolicitudesBO.Retrieve(MydSolicitudes); //MydSolicitudes.C_emp_solicita_JDE empleado empBusGer = new empleado(); empleadosBO empBusGerBO = new empleadosBO(); empBusGer.IdlibretaDir = int.Parse(MydSolicitudes.C_emp_solicita_JDE); empBusGer = empBusGerBO.Retrievex_idlibretaDir(empBusGer); //-------------------------------------------------------------------------------- grupoBO mygrupoBO = new grupoBO(); monto1Tmp = mygrupoBO.BuscaGruposPolitica(empBusGer.IdGerencia, StrCuenta); if (monto1Tmp > 0.0) { //B = CDbl(Val(Campo5)) '// Val do hard work Monto = monto1Tmp * dias; txt_q_requeridoNO.Text = Monto.ToString(); txt_q_requeridoNO.ReadOnly = true; txt_q_requeridoNO.Enabled = false; txt_q_requeridoNO.BackColor = System.Drawing.Color.LightGray; if (StrCuenta == "HTL" || StrCuenta == "GPA") //para cuando selecciona Gastos de Hotel y Pasajes aeros { if (txt_q_requeridoNO.Text == "") { txt_q_requeridoNO.Text = "0"; txt_d_materialNO.Text = "-"; } } } else { txt_q_requeridoNO.ReadOnly = false; txt_q_requeridoNO.Enabled = true; txt_q_requeridoNO.BackColor = System.Drawing.Color.White; txt_q_requeridoNO.Text = ""; if (StrCuenta == "HTL" || StrCuenta == "GPA") //para cuando selecciona Gastos de Hotel y Pasajes aeros { if (txt_q_requeridoNO.Text == "") { txt_q_requeridoNO.Text = "0"; txt_d_materialNO.Text = "-"; } } } } else { TextBox txt_q_requeridoNO; TextBox txt_d_materialNO; GridViewRow emptyRow = (GridViewRow)GView_Detalle.FooterRow; txt_q_requeridoNO = (TextBox)(emptyRow.FindControl("txt_q_requerido")); txt_d_materialNO = (TextBox)(emptyRow.FindControl("txt_d_materialNO")); Double monto1Tmp; Double Monto; grupoBO mygrupoBO = new grupoBO(); monto1Tmp = mygrupoBO.BuscaGruposPolitica(lbl_idgerencia.Text, StrCuenta); if (monto1Tmp > 0.0) { //B = CDbl(Val(Campo5)) '// Val do hard work Monto = monto1Tmp * dias; txt_q_requeridoNO.Text = Monto.ToString(); txt_q_requeridoNO.ReadOnly = true; txt_q_requeridoNO.Enabled = false; txt_q_requeridoNO.BackColor = System.Drawing.Color.LightGray; if (StrCuenta == "HTL" || StrCuenta == "GPA") //para cuando selecciona Gastos de Hotel y Pasajes aeros { if (txt_q_requeridoNO.Text == "") { txt_q_requeridoNO.Text = "0"; txt_d_materialNO.Text = "-"; } } } else { //TextBox txt_d_materialNO2; //txt_d_materialNO2 = (TextBox)(emptyRow.FindControl("txt_d_materialNO")); txt_q_requeridoNO.ReadOnly = false; txt_q_requeridoNO.Enabled = true; txt_q_requeridoNO.BackColor = System.Drawing.Color.White; txt_q_requeridoNO.Text = ""; if (StrCuenta == "HTL" || StrCuenta == "GPA") //para cuando selecciona Gastos de Hotel y Pasajes aeros { if (txt_q_requeridoNO.Text == "") { txt_q_requeridoNO.Text = "0"; // txt_d_materialNO.Text = "-"; } } } } } } }
// -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- public solSolicitudes CompaniaxEmpleado(solSolicitudes objCompaniaSol) { String DesCompania = objCompaniaSol.C_compania + "%"; OracleDataReader objDR; try { objDR = QueryDR(" SELECT ABAN8, ABTAX, ABALPH, trim(ALADD2) || ' ' || trim(ALADD3) || ' ' || trim(ALADD4) || ' ' || trim(ALADDZ) || ' ' || trim(ALCTY1) as direccion " + " FROM PRODDTA.F0101 E " + " LEFT OUTER JOIN PRODDTA.F0116 A ON E.ABAN8 = A.ALAN8 " + " WHERE 1 = 1 " + " AND ABAT1 = 'O' " + " and abalph like '" + DesCompania + "' " + " ORDER BY ABAN8 "); while (objDR.Read()) { objCompaniaSol.C_companiaRFC = objDR["ABTAX"].ToString(); objCompaniaSol.C_compania = objDR["ABALPH"].ToString(); objCompaniaSol.C_companiaDir = objDR["DIRECCION"].ToString(); objCompaniaSol.C_idcompania = objDR["ABAN8"].ToString(); } objDR.Close(); return objCompaniaSol; } catch (Exception e) { throw e; } }
public bool Delete(solSolicitudes objsolSolicitudes) { solSolicitudesDO MysolSolicitudesDO = new solSolicitudesDO(); return MysolSolicitudesDO.Delete(objsolSolicitudes); }
/* para compania*/ public solSolicitudes BuscaCompania(solSolicitudes objCompaniaSol) { unidadNegOracleDO myUnidadNegOracleDO = new unidadNegOracleDO(); return myUnidadNegOracleDO.CompaniaxEmpleado(objCompaniaSol); }
//public bool Delete(empleado objEmpleado ) //{ // usuarioDO MyUsuarioDO = new usuarioDO(); // return MyUsuarioDO.Delete(objUsuario); //} /// <summary> /// <Documentacion>Guarda o Actualiza un Registro.</Documentacion> /// </summary> /// <param name="Cliente">Objeto de Negocios.</param> /// <returns>Guarda o actualiza.</returns> //public string Save( usuario objUsuario ) //{ // usuarioDO UsuarioDO = new usuarioDO(); // return UsuarioDO.Save(objUsuario); //} /// <summary> /// <Documentacion>Devuelve todos los registros.</Documentacion> /// </summary> /// <param name="Cliente">Objeto de Negocio.</param> /// <returns>Devuelve Registros.</returns> //public DataTable BuscaUsuario(usuario objUsuario) //{ // usuarioDO UsuarioDO =new usuarioDO(); // return UsuarioDO.BuscaUsuario(objUsuario); //} //public DataTable BuscaUsuarioXidEmpleado(usuario objUsuario) //{ // usuarioDO UsuarioDO = new usuarioDO(); // return UsuarioDO.BuscaUsuarioXidEmpleado(objUsuario); //} //public int EsValido(usuario objUsuario) //{ // usuarioDO UsuarioDO = new usuarioDO(); // return UsuarioDO.EsValido(objUsuario); //} //public usuario Retrieve(usuario objUsuario) //{ // usuarioDO UsuarioDO = new usuarioDO(); // return UsuarioDO.Retrieve(objUsuario); //} //public usuario RetrievexIdEmpleado(usuario objUsuario) //{ // usuarioDO UsuarioDO = new usuarioDO(); // return UsuarioDO.RetrievexIdEmpleado(objUsuario); //} public string Save(solSolicitudes objsolSolicitudes) { solSolicitudesDO MysolSolicitudesDO = new solSolicitudesDO(); return MysolSolicitudesDO.Save(objsolSolicitudes); }
public string Update(solSolicitudes objsolSolicitudes) { solSolicitudesDO MysolSolicitudesDO = new solSolicitudesDO(); return MysolSolicitudesDO.Update(objsolSolicitudes); }
public string graba(solSolicitudes objsolSolicitudes) { //secuSolBO MysecuSolBO = new secuSolBO(); //secuSol MysecuSol = new secuSol(); //MysecuSol = MysecuSolBO.RetrieveViaticos(MysecuSol); //MysecuSol.n_secuencia = MysecuSol.n_secuencia + 1; solSolicitudesDO MysolSolicitudesDO = new solSolicitudesDO(); //objsolSolicitudes.N_solicitud = MysecuSol.n_secuencia; MysolSolicitudesDO.Save(objsolSolicitudes); //MysecuSolBO.Save(MysecuSol); return "true"; }
public solSolicitudes Retrieve(solSolicitudes objsolSolicitudes) { solSolicitudesDO MysolSolicitudesDO = new solSolicitudesDO(); return MysolSolicitudesDO.Retrieve(objsolSolicitudes); }
public String grabarFinal(solSolicitudes objsolSolicitudes) { solSolicitudesDO MysolSolicitudesDO = new solSolicitudesDO(); return MysolSolicitudesDO.grabarFinal(objsolSolicitudes); }
// **** 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.."); } }
public string Save(solSolicitudes objsolSolicitudes) { try { String _c_tipo = objsolSolicitudes.C_tipo; int _n_solicitud = objsolSolicitudes.N_solicitud; String _c_unidadNeg = objsolSolicitudes.C_unidadNeg; String _d_solicitud = objsolSolicitudes.D_solicitud; String _c_estado_sol = objsolSolicitudes.C_estado_sol; String _c_user_captura = objsolSolicitudes.C_user_captura; String _f_solicitud = objsolSolicitudes.F_solicitud; String _c_emp_solicita_JDE = objsolSolicitudes.C_emp_solicita_JDE; String _f_autoriza_sol = objsolSolicitudes.F_autoriza_sol; String _c_emp_autoriza_JDE = objsolSolicitudes.C_emp_autoriza_JDE; float _i_importe_total = objsolSolicitudes.I_importe_total; String _f_inicio_via = objsolSolicitudes.F_inicio_via; String _f_fin_via = objsolSolicitudes.F_fin_via; String _d_lugar_via = objsolSolicitudes.D_lugar_via; String _c_req_vehi = objsolSolicitudes.C_req_vehi; String _c_num_unidad = objsolSolicitudes.C_num_unidad; String _c_idcompania_JDE = objsolSolicitudes.C_idcompania; String _d_unidadNeg = objsolSolicitudes.D_unidadNeg; String _d_emp_solicita_JDE = objsolSolicitudes.D_emp_solicita_JDE; String _d_emp_autoriza_JDE = objsolSolicitudes.D_emp_autoriza_JDE; String strQuery = "INSERT INTO SOL_SOLICITUDES(C_TIPO " + " ,N_SOLICITUD " + " ,C_UNIDADNEG " + " ,D_SOLICITUD " + " ,C_ESTADO_SOL " + " ,C_USER_CAPTURA " + " ,F_SOLICITUD " + " ,C_EMP_SOLICITA_JDE " + " ,F_AUTORIZA_SOL " + " ,C_EMP_AUTORIZA_JDE " + " ,I_IMPORTE_TOTAL " + " ,F_INICIO_VIA " + " ,F_FIN_VIA " + " ,D_LUGAR_VIA " + " ,C_REQ_VEHI " + " ,C_NUM_UNIDAD " + " ,d_unidadNeg " + " ,d_emp_solicita_JDE " + " ,d_emp_autoriza_JDE " + " ,c_compania_JDE " + " ,n_finalCaptura )" + " VALUES(" + " '" + _c_tipo + "'," + " " + _n_solicitud + "," + " '" + _c_unidadNeg + "'," + " '" + _d_solicitud + "'," + " '" + _c_estado_sol + "'," + " '" + _c_user_captura + "'," + " '" + _f_solicitud + "'," + " '" + _c_emp_solicita_JDE + "'," + " '" + _f_autoriza_sol + "'," + " '" + _c_emp_autoriza_JDE + "'," + " " + _i_importe_total + "," + " '" + _f_inicio_via + "'," + " '" + _f_fin_via + "'," + " '" + _d_lugar_via + "'," + " '" + _c_req_vehi + "'," + " '" + _c_num_unidad + "', " + " '" + _d_unidadNeg + "', " + " '" + _d_emp_solicita_JDE + "', " + " '" + _d_emp_autoriza_JDE + "' , " + " '" + _c_idcompania_JDE + "' , " + " 0 )"; ActionQuery(strQuery); return "true"; } catch (Exception e) { throw e; } }
protected void Seleted_ListEmpleados(object sender, EventArgs e) { empleadosBO MyEmpleado = new empleadosBO(); String idEmpleadoJDE = list_empleados.SelectedValue.ToString(); //empleadosBO MyEmpleado = new empleadosBO(); empleado MyEmpleadoE = new empleado(); MyEmpleadoE.IdlibretaDir = int.Parse(idEmpleadoJDE); MyEmpleadoE = MyEmpleado.Retrievex_idlibretaDir(MyEmpleadoE); lbl_d_gerencia.Text = MyEmpleadoE.Gerencia; lbl_d_autorizador.Text = MyEmpleadoE.Autorizador; lbl_id_empAutoriza.Text = MyEmpleadoE.IdAutorizador.ToString(); lbl_idgerencia.Text = MyEmpleadoE.IdGerencia; //********** para buscar que compania tiene asignada ********** NegocioCapitalHumano negocio = new NegocioCapitalHumano(); List<Employee> listaEmpleados = negocio.ListaEmpleados(idEmpleadoJDE, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999")); string nombrecompania = ""; if (listaEmpleados == null) { nombrecompania = "No tiene asignada Compania / o este es Ex-Empleado "; } else { nombrecompania = listaEmpleados[0].CompañiaJde.ToString(); if (nombrecompania == "") { nombrecompania = "No tiene asignada Compania / o este es Ex-Empleado"; } } TextNombreEmpresa.Text = nombrecompania; solSolicitudes objsolSolicitudes = new solSolicitudes(); objsolSolicitudes.C_compania = TextNombreEmpresa.Text; unidadNegBO MyCompaniaDO = new unidadNegBO(); solSolicitudes MySol = new solSolicitudes(); MySol = MyCompaniaDO.BuscaCompania(objsolSolicitudes); TextRFC.Text = MySol.C_companiaRFC; TextDireccion.Text = MySol.C_companiaDir; TextIdEmpresa.Text = MySol.C_idcompania; //solSolicitudesBO MySolicitud = new solSolicitudesBO(); //solSolicitudes MySol = new solSolicitudes(); //MySol = MySolicitud.CompaniaDatos(objsolSolicitudes); //TextRFC.Text = MySol.C_companiaRFC; //TextDireccion.Text = MySol.C_companiaDir; }
public bool Delete(solSolicitudes objsolSolicitudes) { try { String _c_tipo = objsolSolicitudes.C_tipo; int _n_solicitud = objsolSolicitudes.N_solicitud; String _c_unidadNeg = objsolSolicitudes.C_unidadNeg; ActionQuery("DELETE FROM SOL_SOLICITUDES WHERE C_TIPO = '" + _c_tipo + "' AND N_SOLICITUD= " + _n_solicitud + " AND C_UNIDADNEG='" + _c_unidadNeg + "'"); return true; } catch (Exception e) { throw e; } }
protected void botonFinalizar_Click1(object sender, EventArgs e) { int bandera = 1; if ((etiquetaNoSolicitud.Text == "") || (etiquetaNoSolicitud.Text.Trim() == "0")) { MensajeErrorPartidas("Grabe el encabezado de la Solicitud, Verifique!"); bandera = 0; } if ((bandera == 1) && (GView_Detalle.Rows.Count < 1)) { MensajeErrorPartidas("No se ha capturado ninguna partida de viaticos, favor de capturar al menos un partida para finalizar al Solicitud"); bandera = 0; } if (bandera == 1) { solSolicitudesBO MysolSolicitudesBO = new solSolicitudesBO(); solSolicitudes MysolSolicitudes = new solSolicitudes(); MysolSolicitudes.N_solicitud = int.Parse(etiquetaNoSolicitud.Text); MysolSolicitudes.C_tipo = "VIA"; MysolSolicitudes.C_unidadNeg = List_UniNeg.SelectedValue.ToString(); MysolSolicitudesBO.grabarFinal(MysolSolicitudes); //Busco si tiene una partida o 2 si tiene 1 busco que tenga hospedaje o vuelo, si tiene 2 que los dos tenga hospedaje y vuelo para poner //estatus de autorizado int nolineas = 0; viaticos = new GastosViaje(); LineaSolicitud Myp = new LineaSolicitud(); Myp.Clave = int.Parse(etiquetaNoSolicitud.Text); List<LineaSolicitud> listaPartidas = viaticos.ObtenerPartidas(Myp); if (listaPartidas != null) { nolineas = listaPartidas[0].Partida; } //Busco si tiene partida con Hospedaje para mandar correo a su AUTORIZADOR y [email protected] viaticos = new GastosViaje(); var tipolinea = "0"; var tipolineaConc = "0"; var tipolineaVuelo = "0"; var mensaje_correo = ""; LineaSolicitud Mylinea = new LineaSolicitud(); Mylinea.Clave = int.Parse(etiquetaNoSolicitud.Text); //Busco que tenga Hospedaje List<LineaSolicitud> listaSolicitudes = viaticos.ObtenerLineasHospedaje(Mylinea); if (listaSolicitudes != null) { tipolinea = listaSolicitudes[0].ConceptoDescripcion; } // Busco que tenga Alimentos List<LineaSolicitud> listaLineaSolicitud = viaticos.ObtenerLineasAlimentos(Mylinea); if (listaLineaSolicitud != null) { tipolineaConc = listaLineaSolicitud[0].ConceptoDescripcion; } // Busco que tenga Vuelos List<LineaSolicitud> listaLineaSolicitudV = viaticos.ObtenerLineasVuelos(Mylinea); if (listaLineaSolicitudV != null) { tipolineaVuelo = listaLineaSolicitudV[0].ConceptoDescripcion; } if (nolineas == 1) { if (tipolinea == "Hospedaje" || tipolineaConc == "ALIMENTOS POR VIATICOS" || tipolineaVuelo == "PASAJES AEREOS") { string connectionString1 = ConfigurationManager.ConnectionStrings["conexionAPPS"].ConnectionString; //actualizo el estatus autorizado para que no pase autorizacion using (SqlConnection cnx = new SqlConnection(connectionString1)) { cnx.Open(); string query = " update Sol_solicitudes set " + " c_estado_sol = 'AUT', " + " f_autoriza_sol = GETDATE() " + " where n_solicitud = '" + etiquetaNoSolicitud.Text + "' and c_tipo='VIA' "; SqlCommand cmd = new SqlCommand(query, cnx); SqlDataReader dr = cmd.ExecuteReader(); } } //if (tipolinea != "Hospedaje" && tipolineaConc != "ALIMENTOS POR VIATICOS" && tipolineaVuelo != "PASAJES AEREOS") //{ // Response.Redirect("frmViaticos.aspx"); //} } if (nolineas == 2) { if (tipolinea == "Hospedaje" && tipolineaConc == "ALIMENTOS POR VIATICOS" && tipolineaVuelo == "PASAJES AEREOS") { //actualizo el estatus autorizado para que no pase autorizacion string connectionString2 = ConfigurationManager.ConnectionStrings["conexionAPPS"].ConnectionString; using (SqlConnection cnx = new SqlConnection(connectionString2)) { cnx.Open(); string query = " update Sol_solicitudes set " + " c_estado_sol = 'AUT', " + " f_autoriza_sol = GETDATE() " + " where n_solicitud = '" + etiquetaNoSolicitud.Text + "' and c_tipo='VIA' "; SqlCommand cmd = new SqlCommand(query, cnx); SqlDataReader dr = cmd.ExecuteReader(); } } } //if (tipolinea != "Hospedaje" && tipolineaConc != "ALIMENTOS POR VIATICOS" && tipolineaVuelo != "PASAJES AEREOS") //{ // Response.Redirect("frmViaticos.aspx"); //} //if (tipolinea == "Hospedaje" || tipolineaConc == "ALIMENTOS POR VIATICOS" || tipolineaVuelo == "PASAJES AEREOS") //{ string connectionString3 = ConfigurationManager.ConnectionStrings["conexionAPPS"].ConnectionString; //-==================================== ENVIA CORREO AUTORIZADOR y GESTOR ============================== string mensaje1 = " <table class=style1 font-family=calibri> " + " <tr><td colspan=8 align=center><strong> SOLICITUD DE VIATICOS </strong></td></tr> " + " <tr> " + " <td style=background-color: #C0C0C0 > " + " <strong>NO VIATICO</strong></td> " + " <td style=background-color: #C0C0C0> " + " <strong>FECHA DE PARTIDA</strong></td> " + " <td style=background-color: #C0C0C0> " + " <strong>FECHA DE REGRESO</strong></td> " + " <td style=background-color: #C0C0C0> " + " <strong>SOLICITANTE</strong></td> " + " <td style=background-color: #C0C0C0> " + " <strong>DESTINO</strong></td> " + " <td style=background-color: #C0C0C0> " + " <strong>UNIDAD NEGOCIO</strong></td> " + " <td style=background-color: #C0C0C0> " + " </tr> " + " <tr> " + " <td> " + MysolSolicitudes.N_solicitud + " </td> " + " <td> " + txt_f_inicio_sol.Text + " </td> " + " <td> " + txt_f_fin_sol.Text + " </td> " + " <td> " + list_empleados.SelectedItem.Text.Trim() + " </td> " + " <td> " + txt_d_referencias_sugeridas.Text + " </td> " + " <td> " + List_UniNeg.SelectedItem.Text.Trim() + " </td> " + //MysolSolicitudes.C_unidadNeg " </tr> </table>"; string mensaje_enc_detalle = "<br> <table class=style1 font-family='calibri'> " + " <tr><td colspan='5' align='center'><strong> DETALLE </strong></td></tr> " + " <tr> " + " <td style=background-color: #C0C0C0> " + " <strong>SOLICITUD</strong></td> " + " <td style=background-color: #C0C0C0> " + " <strong>PARTIDA</strong></td> " + " <td style=background-color: #C0C0C0> " + " <strong>TOTAL</strong></td> " + " <td style=background-color: #C0C0C0> " + " <strong>DESCRIPCION </strong></td> " + //" <td style=background-color: #C0C0C0> " + // " <strong>CONCEPTO </strong></td> " + " <td style=background-color: #C0C0C0> " + " <strong>ESTATUS</strong></td> " + " </tr> "; string mensaje_detalle_partidas = ""; using (SqlConnection cnxdet = new SqlConnection(connectionString3)) { cnxdet.Open(); string query = " SELECT c_tipo, n_solicitud, n_partida, n_total, d_concepto_via, c_unidadNeg, f_autoriza, " + " CASE WHEN dSol_solicitudes.n_concepto_via = 'GPA' then 'PASAJES AEREOS' " + " WHEN dSol_solicitudes.n_concepto_via = 'ALMV' then 'ALIMENTOS POR VIATICOS' " + " WHEN dSol_solicitudes.n_concepto_via = 'HTL' then 'Hospedaje' " + " ELSE n_concepto_via " + " END as conceptoDescripcion, " + " CASE WHEN dSol_solicitudes.n_concepto_via = 'GPA' then 'PRE-AUTORIZADOS' " + " WHEN dSol_solicitudes.n_concepto_via = 'HTL' then 'PRE-AUTORIZADOS' " + " ELSE 'POR AUTORIZAR' " + " END as estatus " + " FROM dSol_solicitudes " + " WHERE c_tipo = 'VIA' and n_solicitud = '" + etiquetaNoSolicitud.Text + "' and c_tipo='VIA' "; SqlCommand cmd = new SqlCommand(query, cnxdet); SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { // mensaje_detalle_partidas = dr["c_tipo"].ToString(); mensaje_detalle_partidas = mensaje_detalle_partidas + " <tr> <td> " + dr["n_solicitud"].ToString() + " </td> " + " <td> " + dr["n_partida"].ToString() + " </td> " + " <td> " + dr["n_total"].ToString() + " </td> " + " <td> " + dr["d_concepto_via"].ToString() + " </td> " + //" <td> " + dr["conceptoDescripcion"].ToString() + " </td> " + " <td> " + dr["estatus"].ToString() + " </td> "; //" <td align='center'> " + dr["c_unidadNeg"].ToString() + " </td> </tr>"; } } } if (tipolinea == "Hospedaje" || tipolineaConc == "ALIMENTOS POR VIATICOS" || tipolineaVuelo == "PASAJES AEREOS") { var nota = "Si no esta de acuerdo con los gastos pre-autorizados, favor de de comunicarse inmediatamente con el gestor de viajes [email protected] </p>"; mensaje_correo = mensaje1 + mensaje_enc_detalle + mensaje_detalle_partidas + " </table> <br> <p>" + nota; } else { mensaje_correo = mensaje1 + mensaje_enc_detalle + mensaje_detalle_partidas + " </table> <br> <p>"; } string noempleado_solicitante = list_empleados.SelectedValue.ToString(); var JefeInmediato_nombre = "0"; var JefeInmediato_no = "0"; //List<Employee> listaEmpleados3 = capitalHumano.ListaPersonaName(noempleado_solicitante); this.capitalHumano = new RecursosHumanos(); List<Employee> listaEmpleados2 = capitalHumano.ListaPersona(noempleado_solicitante); if (listaEmpleados2 != null) { // JefeInmediato_nombre = listaEmpleados2[0].SupervisorName.ToString(); JefeInmediato_no = listaEmpleados2[0].Supervisor.ToString(); } else { JefeInmediato_no = "0"; etiquetaMensajeError.Text = capitalHumano.Log + " / o No se encuentra actualizado su Jefe en BD, consulte con Capital Humano"; } if (JefeInmediato_no != "0") { List<Employee> listaEmpleados3 = capitalHumano.ListaPersonaName(JefeInmediato_no); if (listaEmpleados3 != null) { JefeInmediato_nombre = listaEmpleados3[0].SupervisorName.ToString(); JefeInmediato_no = listaEmpleados3[0].SupervisorNoemp.ToString(); } else { // MensajeError(capitalHumano.Log + " / o No se encuentra actualizado su Jefe en BD, consulte con Capital Humano"); etiquetaMensajeError.Text = capitalHumano.Log + " / o No se encuentra actualizado su Jefe en BD, consulte con Capital Humano"; return; } } if (tipolineaConc == "ALIMENTOS POR VIATICOS") //autorizador { JefeInmediato_no = lbl_id_empAutoriza.Text; } string email1 = ""; string email_aut = ""; usuario myUsuario = new usuario(); usuarioBO myUsuarioBO = new usuarioBO(); // para obtener correo de Jefe inmediato if (JefeInmediato_no != "0") { myUsuario.Usr_id_JDE_AB = JefeInmediato_no; myUsuario = myUsuarioBO.RetrievexJDE_AD(myUsuario); email1 = myUsuario.Correo; } // para obtener correo de Autorizdor if (lbl_id_empAutoriza.Text != "") { myUsuario.Usr_id_JDE_AB = lbl_id_empAutoriza.Text; myUsuario = myUsuarioBO.RetrievexJDE_AD(myUsuario); email_aut = myUsuario.Correo; } //string email1 = ""; //using (SqlConnection cnx = new SqlConnection(connectionString3)) //{ // 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_id_JDE_AB = '" + JefeInmediato_no + "') "; // SqlCommand cmd = new SqlCommand(query, cnx); // SqlDataReader dr = cmd.ExecuteReader(); // if (dr.HasRows) // { // while (dr.Read()) // { // email1 = dr["usr_email"].ToString(); // } // } //} string listaemail = ""; if (tipolinea == "Hospedaje" || tipolineaVuelo == "PASAJES AEREOS") { if (email1 == "") { listaemail = "[email protected], [email protected]"; // listaemail = "*****@*****.**"; } listaemail = email1 + ", [email protected], [email protected]"; //listaemail = "*****@*****.**"; } if (tipolineaConc == "ALIMENTOS POR VIATICOS") { if (email1 == "") { listaemail = " [email protected]"; } listaemail = email1 + ", [email protected]"; //listaemail = "*****@*****.**"; } if (tipolinea != "Hospedaje" && tipolineaConc != "ALIMENTOS POR VIATICOS" && tipolineaVuelo != "PASAJES AEREOS") { if (email1 == "") { listaemail = " [email protected]"; } listaemail = email1 + ", [email protected]"; //listaemail = "*****@*****.**"; } //envio el correo dependiendo si es hospedaje a jefe inmediato y gestor de viajes / alimentos solo autorizador correoDO enviarCorreo = new correoDO(); // enviarCorreo.EnviaMail("ALTA DE SOLICITUD DE VIATICOS", mensaje1, listaemail); // mensaje_correo = mensaje_correo + " <br> Correo a enviar: " + email1 + " Autorizador: " + lbl_id_empAutoriza.Text + "Nombre: " + lbl_d_autorizador.Text + "correo autorizador:" + email_aut; enviarCorreo.EnviaMail("ALTA DE SOLICITUD DE VIATICOS", mensaje_correo, listaemail); Response.Redirect("frmViaticos.aspx"); //} //else //{ // Response.Redirect("frmViaticos.aspx"); //} } }
public DataTable BuscaSolicitud(solSolicitudes objsolSolicitudes) { try { String _c_tipo = objsolSolicitudes.C_tipo; String _n_solicitud; String strfiltron_solici = ""; if (objsolSolicitudes.N_solicitud > 0) { _n_solicitud = objsolSolicitudes.N_solicitud.ToString(); strfiltron_solici = " n_solicitud = '" + _n_solicitud + "' and "; } else { _n_solicitud = ""; strfiltron_solici = ""; } String _c_unidadNeg; if (objsolSolicitudes.C_unidadNeg == "00") _c_unidadNeg = ""; else _c_unidadNeg = objsolSolicitudes.C_unidadNeg; String c_estado_sol = objsolSolicitudes.C_estado_sol; String c_emp_autoriza_JDE = objsolSolicitudes.C_emp_autoriza_JDE; String d_solicitud; if (objsolSolicitudes.D_solicitud != null) d_solicitud = objsolSolicitudes.D_solicitud; else d_solicitud = ""; DataTable mytabla = new DataTable(); String strQuery = " SELECT * " + " FROM Sol_solicitudes " + " WHERE " + strfiltron_solici + " c_unidadNeg like '%" + _c_unidadNeg + "%' and " + " c_estado_sol like '%" + c_estado_sol + "%' and " + " c_tipo like '%" + _c_tipo + "%' and " + " d_solicitud like '%" + d_solicitud + "%' and " + " c_emp_autoriza_JDE = '" + c_emp_autoriza_JDE + "' and " + " n_finalCaptura = 1 "; mytabla = QueryDS(strQuery).Tables[0]; return mytabla; //SELECT * //FROM [APPSDB].[dbo].[Sol_solicitudes] //WHERE n_solicitud LIKE '%%' and // c_unidadNeg like '%%' and // c_estado_sol like '%%' and // c_tipo like '%%' and // c_emp_autoriza_JDE like '%%' } catch (Exception e) { throw new Exception("Encabezado Solicitudes.", e); } }
protected void Page_Load(object sender, EventArgs e) { String n_solicitud = Request.QueryString["n_solicitud"]; String c_uniNeg = Request.QueryString["c_unidadNeg"]; lbl_n_requisicion.Text = n_solicitud; solSolicitudesBO objsolSolicitudesBO = new solSolicitudesBO(); solSolicitudes objsolSolicitudes = new solSolicitudes(); objsolSolicitudes.N_solicitud = int.Parse(n_solicitud); objsolSolicitudes.C_tipo = "VIA"; objsolSolicitudes.C_unidadNeg = c_uniNeg; objsolSolicitudes = objsolSolicitudesBO.Retrieve(objsolSolicitudes); list_empleados.Text = objsolSolicitudes.D_emp_solicita_JDE; txt_f_inicio_sol.Text = objsolSolicitudes.F_inicio_via; txt_f_fin_sol.Text = objsolSolicitudes.F_fin_via; txt_d_referencias_sugeridas.Text = objsolSolicitudes.D_lugar_via; txt_objeto.Text = objsolSolicitudes.D_solicitud; TxtNumeroUnidad.Text = objsolSolicitudes.C_num_unidad; List_vehiculos.SelectedValue = objsolSolicitudes.C_req_vehi; List_UniNeg.Text = objsolSolicitudes.D_unidadNeg; String idEmpleadoJDE = objsolSolicitudes.C_emp_solicita_JDE; empleadosBO MyEmpleado = new empleadosBO(); empleado MyEmpleadoE = new empleado(); MyEmpleadoE.IdlibretaDir = int.Parse(idEmpleadoJDE); MyEmpleadoE = MyEmpleado.Retrievex_idlibretaDir(MyEmpleadoE); lbl_d_gerencia.Text = MyEmpleadoE.Gerencia; lbl_d_autorizador.Text = MyEmpleadoE.Autorizador; lbl_id_empAutoriza.Text = MyEmpleadoE.IdAutorizador.ToString(); lbl_idgerencia.Text = MyEmpleadoE.IdGerencia; //********** para buscar que compania tiene asignada ********** NegocioCapitalHumano negocio = new NegocioCapitalHumano(); List<Employee> listaEmpleados = negocio.ListaEmpleados(idEmpleadoJDE, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999")); string nombrecompania = ""; if (listaEmpleados == null) { nombrecompania = "No tiene asignada Compania / o este es Ex-Empleado "; } else { nombrecompania = listaEmpleados[0].CompañiaJde.ToString(); if (nombrecompania == "") { nombrecompania = "No tiene asignada Compania / o este es Ex-Empleado"; } } TextNombreEmpresa.Text = nombrecompania; // solSolicitudes objsolSolicitudes = new solSolicitudes(); objsolSolicitudes.C_compania = TextNombreEmpresa.Text; unidadNegBO MyCompaniaDO = new unidadNegBO(); solSolicitudes MySol = new solSolicitudes(); MySol = MyCompaniaDO.BuscaCompania(objsolSolicitudes); TextRFC.Text = MySol.C_companiaRFC; TextDireccion.Text = MySol.C_companiaDir; TextIdEmpresa.Text = MySol.C_idcompania; //empleadosBO MyEmpleado = new empleadosBO(); //Request.QueryString //Request.QueryString("n_contrato") //String Cadena = Request.QueryString["n_requisicion"]; ////String Cadena = lbl_n_requisicion.Text; //if (Cadena == null || Cadena == "") //{ // Cadena = "0"; //} //lbl_n_requisicion.Text = Cadena; //empleadosBO MyEmpleado = new empleadosBO(); //if (IsCallback) //{ //} if (!this.IsPostBack) { //String strEmpleado = list_empleados.SelectedValue.ToString(); //usuarioOracleDO MyUsuarioDO = new usuarioOracleDO(); //list_empleados.DataSource = MyEmpleado.BuscaEmpleados(); //list_empleados.DataValueField = "ABAN8"; //list_empleados.DataTextField = "ABALPH"; //list_empleados.DataBind(); //unidadNegBO MyUnidadNegDO = new unidadNegBO(); //List_UniNeg.DataSource = MyUnidadNegDO.BuscaUnidadNeg(); //List_UniNeg.DataValueField = "MCMCU"; //List_UniNeg.DataTextField = "MCDC"; //List_UniNeg.DataBind(); ////int i = 0; ////i++; //// MyUsuarioDO.testConexion("Hola mundo"); //DataSet conjunto = new DataSet(); //dSolicitudesBO mydSolicitudesBO = new dSolicitudesBO(); ////conjunto = (DataSet)mydSolicitudesBO.BuscaSolicitudes(); ////adapter.Fill(set,"NombreTabla"); //GView_Detalle.DataSourceID = null; //GView_Detalle.DataSource = mydSolicitudesBO.BuscaSolicitudes(); //String[] valores = { "n_contrato", "n_requisicion", "n_partida" }; //GView_Detalle.DataKeyNames = valores; ////GView_Detalle.DataMember = "NombreTabla"; //GView_Detalle.DataBind(); ////DataKeyNames="n_contrato,n_requisicion,n_partida" ////DataSourceID="Data_Drequisicion" ////GView_Detalle.Refresh(); } else { //if (lbl_n_requisicion.Text == "0" ) //{ // String idEmpleadoJDE = list_empleados.SelectedValue.ToString(); // //empleadosBO MyEmpleado = new empleadosBO(); // empleado MyEmpleadoE = new empleado(); // MyEmpleadoE.IdlibretaDir = int.Parse(idEmpleadoJDE); // MyEmpleadoE = MyEmpleado.Retrievex_idlibretaDir(MyEmpleadoE); // lbl_d_gerencia.Text = MyEmpleadoE.Gerencia; // lbl_d_autorizador.Text = MyEmpleadoE.Autorizador; // lbl_id_empAutoriza.Text = MyEmpleadoE.IdAutorizador.ToString(); // lbl_idgerencia.Text = MyEmpleadoE.IdGerencia; //} //DataSet conjunto = new DataSet(); //dSolicitudesBO mydSolicitudesBO = new dSolicitudesBO(); ////conjunto = (DataSet)mydSolicitudesBO.BuscaSolicitudes(); ////adapter.Fill(set,"NombreTabla"); //GView_Detalle.DataSourceID = null; //GView_Detalle.DataSource = mydSolicitudesBO.BuscaSolicitudes(int.Parse(lbl_n_requisicion.Text)); ////String[] valores = { "n_contrato", "n_requisicion", "n_partida" }; ////GView_Detalle.DataKeyNames = valores; ////GView_Detalle.DataMember = "NombreTabla"; //GView_Detalle.DataBind(); ////DataKeyNames="n_contrato,n_requisicion,n_partida" ////DataSourceID="Data_Drequisicion" ////GView_Detalle.Refresh(); } }
//public DataTable BuscaSolicitudes() //{ // solSolicitudesDO MysolSolicitudesDO = new solSolicitudesDO(); // return MysolSolicitudesDO.BuscaSolicitudes(); //} public DataTable BuscaSolicitud(solSolicitudes objsolSolicitudes) { solSolicitudesDO MysolSolicitudesDO = new solSolicitudesDO(); return MysolSolicitudesDO.BuscaSolicitud(objsolSolicitudes); }