protected void Cargar_ENCABEZADO() { VT_Cuenta cta = new VT_Cuenta(); DB_VT_Planilla pl = new DB_VT_Planilla(); DB_VT_Solicitud sol = new DB_VT_Solicitud(); DataTable data = new DataTable(); data = sol.DB_Reporte_SOLICITUD_US(LblIdSolicitud.Text, "ENCABEZADO"); LblNombre.Text = data.Rows[0][12].ToString(); LblEstado.Text = data.Rows[0][10].ToString(); LblCargo.Text = data.Rows[0][4].ToString(); LblCategoria.Text = data.Rows[0][14].ToString(); LblIdUser.Text = data.Rows[0][1].ToString(); DB_VT_Categoria cat = new DB_VT_Categoria(); DataTable data1 = new DataTable(); data1 = cat.DB_Seleccionar_CATEGORIA(Convert.ToInt32(LblCategoria.Text), data.Rows[0][2].ToString()); LblMoneda.Text = data1.Rows[0][5].ToString(); LblPgoDiaUrbano.Text = data1.Rows[0][3].ToString(); LblPgoDiaRural.Text = data1.Rows[0][4].ToString(); data = sol.DB_Reporte_SOLICITUD_US(LblIdSolicitud.Text, "FECHAMAXMIN"); LblFechaSalida.Text = Convert.ToDateTime(data.Rows[0][0].ToString()).ToString("dd/MM/yyyy"); LblFechaRetorno.Text = Convert.ToDateTime(data.Rows[0][1].ToString()).ToString("dd/MM/yyyy"); if (LblEstado.Text == "APROBADO") { cta = pl.DB_Seleccionar_CUENTA(LblIdUser.Text); TxtNumCheque.Text = cta.Cuenta; } }
protected void Cargar_ENCABEZADO() { VT_Cuenta cta = new VT_Cuenta(); DB_VT_Planilla pl = new DB_VT_Planilla(); this.vaciadoaControles(); if (LblEstado.Text == "APROBADO") { cta = pl.DB_Seleccionar_CUENTA(LblIdUser.Text); TxtNumCheque.Text = cta.Cuenta; } }
protected void Registrar_CUENTA() { VT_Cuenta c = new VT_Cuenta(); c.Id_Usuario = LblIdUsuario.Text; c.Cuenta = TxtNumCuenta.Text; c.Banco = TxtBanco.Text; c.Estado = "ACTIVO"; DB_VT_Viaticos rc = new DB_VT_Viaticos(); rc.DB_Registrar_CUENTA(c); }
protected void Cargar_ENCABEZADO() { VT_Cuenta cta = new VT_Cuenta(); DB_VT_Planilla pl = new DB_VT_Planilla(); DB_VT_Solicitud sol = new DB_VT_Solicitud(); DataTable data = new DataTable(); data = sol.DB_Reporte_SOLICITUD_US(LblIdSolicitud.Text, "ENCABEZADO"); LblNombre.Text = data.Rows[0][12].ToString(); LblMotivo.Text = data.Rows[0][7].ToString(); LblIdUser.Text = data.Rows[0][1].ToString(); data = pl.DB_Reporte_DETALLE_PLANILLA(LblIdSolicitud.Text, "DESTINOS"); LblDestino.Text = data.Rows[0][0].ToString(); }
protected void DDLCuenta_SelectedIndexChanged(object sender, EventArgs e) { VT_Cuenta cta = new VT_Cuenta(); DB_VT_Planilla pl = new DB_VT_Planilla(); if (DDLCuenta.SelectedValue == "N° Cuenta") { cta = pl.DB_Seleccionar_CUENTA(LblIdUser.Text); TxtNumCheque.Text = cta.Cuenta; } else { TxtNumCheque.Text = string.Empty; } }
public VT_Cuenta DB_Seleccionar_CUENTA(string idUser) { DA_VT_Planilla data = new DA_VT_Planilla(); DataTable dt = new DataTable(); VT_Cuenta cta = new VT_Cuenta(); dt = data.DA_Seleccionar_CUENTA(idUser); //*ini* lrojas: 29/09/2016 validacion usario - cuenta if (dt.Rows.Count == 0) { throw new Exception("El usuario " + idUser + " no tiene una cuenta de banco asociada, Actualice al Usuario en 'Administrar Usuario'"); } else { cta.Cuenta = dt.Rows[0][0].ToString(); cta.Banco = dt.Rows[0][1].ToString(); cta.Estado = dt.Rows[0][2].ToString(); } //*fin* return(cta); }
/// <summary> /// Actualiza por Usuario, cuenta de banco /// </summary> /// <param name="c">Objeto</param> public void DA_Modificar_CUENTA(VT_Cuenta c) { try { using (SqlConnection conexion = new SqlConnection(conexionString)) { SqlCommand cmd = new SqlCommand("VT_CUENTA_UPDATE", conexion); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Id_Usuario", c.Id_Usuario); cmd.Parameters.AddWithValue("@Cuenta", c.Cuenta); cmd.Parameters.AddWithValue("@Banco", c.Banco); //cmd.Parameters.AddWithValue("@Estado", c.Estado); conexion.Open(); cmd.ExecuteNonQuery(); conexion.Close(); } } catch (Exception err) { throw (new Exception(err.ToString() + "-" + err.Source.ToString() + "-" + err.Message.ToString())); } }
/// <summary> /// Actualiza por Usuario, cuenta de banco /// </summary> /// <param name="c">Objeto</param> public void DB_Modificar_CUENTA(VT_Cuenta c) { DA_VT_Viaticos Inscripcion = new DA_VT_Viaticos(); Inscripcion.DA_Modificar_CUENTA(c); }
public void DB_Registrar_CUENTA(VT_Cuenta c) { DA_VT_Viaticos Inscripcion = new DA_VT_Viaticos(); Inscripcion.DA_Registrar_CUENTA(c); }
protected void BtnRegistrar_Click(object sender, EventArgs e) { try { if (validacion()) { if (string.IsNullOrEmpty(LblIdUsuario.Text)) { Registrar_PERSONA(); Registrar_USUARIO(); Registrar_USUARIO_ESTRUCTURA(); Registrar_CUENTA(); string script = @"<script type='text/javascript'>alert('{0}');</script>"; script = string.Format(script, "☻ GENERADO CORRECTAMENTE EL CODIGO DE USUARIO ► " + this.LblIdUsuario.Text + " CORRESPONDIENTE A " + this.TxtApPat.Text + " " + this.TxtApMat.Text + " " + this.TxtNombre.Text + " CON CI: " + this.TxtCedula.Text); ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, false); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "window.location ='frmAdminUsuario.aspx';", true); } else { string Id_Us = string.Empty; if (TxtApMat.Text != "") { //Id_Us = TxtApPat.Text[0].ToString() + TxtApMat.Text[0].ToString() + TxtNombre.Text[0].ToString() + "-" + TxtCedula.Text; Id_Us = this.GeneraCodigo(); } else { Id_Us = this.GeneraCodigo(); } //if (Id_Us != Id_Usuario_Aux)//validacion Codigo de Usuario if (string.Equals(this.LblEstado.Text, "Modificar"))//validacion Codigo de Usuario { string codus = @"<script type='text/javascript'>alert('{0}');</script>"; //codus = string.Format(codus, "- Se realizó la modificación" + Id_Usuario_Aux + " su Codigo_Actual:" + Id_Us + " Verifique Nombre y Apellidos."); codus = string.Format(codus, "☻ MODIFICACION CORRECTA PARA EL USUARIO CON C.I.: " + this.TxtCedula.Text + " CON CODIGO DE USUARIO ► " + this.LblIdUsuario.Text); ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", codus, false); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "window.location ='frmAdminUsuario.aspx';", true); //return; } //** VALIDAR LAS FUNCIONES - PERSONA - USUARIO Modificar_PERSONA(); Modificar_USUARIO(); DB_Usuario con = new DB_Usuario(); con.DB_Modificar_USUARIO_ESTRUCTURA(Convert.ToInt32(DDLSup.SelectedValue), Id_Us, TxtCiResp.Text); if (RBTNSI.Checked == true) { DB_VT_Viaticos cu = new DB_VT_Viaticos(); DataTable dt = new DataTable(); VT_Cuenta c = new VT_Cuenta(); DB_VT_Viaticos rc = new DB_VT_Viaticos(); dt = cu.DB_Seleccionar_CUENTA_USUARIO(Id_Us); if (dt.Rows.Count == 0) { c.Id_Usuario = Id_Us; c.Cuenta = TxtNumCuenta.Text; c.Banco = TxtBanco.Text; c.Estado = "ACTIVO"; rc.DB_Registrar_CUENTA(c); } else { c.Id_Usuario = Id_Us; c.Cuenta = TxtNumCuenta.Text; c.Banco = TxtBanco.Text; //c.Estado = "ACTIVO"; rc.DB_Modificar_CUENTA(c); } } // Buscar_PERSONA(TxtCedula.Text); RBTNNO.Checked = true; //object send = new object(); //EventArgs ea = new EventArgs(); //RBTNNO_CheckedChanged(send, ea); TxtNumCuenta.Enabled = false; TxtBanco.Enabled = false; } } } catch (Exception ex) { string script = @"<script type='text/javascript'>alert('{0}');</script>"; script = string.Format(script, ex.Message); ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, false); } }