コード例 #1
0
 private void Guardar()
 {
     casoSevero _casoSevero = new casoSevero(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
     Decimal ID = _casoSevero.Adicionar(Convert.ToDecimal(TextBox_ID_EMPLEADO.Text), Convert.ToDateTime(TextBox_FECHA_R.Text),
         this.TextBox_OBS_REG.Text);
     if (ID == 0)
     {
         if (!String.IsNullOrEmpty(_casoSevero.MensajeError)) Informar(Label_MENSAJE, "Error: Consulte con el Administrador: " + _casoSevero.MensajeError, Proceso.Error);
     }
     else
     {
         Informar(Label_MENSAJE, "El registro fue creado correctamente y se le asignó el ID: " + ID.ToString() + ".", Proceso.Correcto);
         TextBox_ID.Text = ID.ToString();
     }
     Ocultar();
     Mostrar(Acciones.Guarda);
     Bloquear(Acciones.Guarda);
 }
コード例 #2
0
 private void Modificar()
 {
     casoSevero _casoSevero = new casoSevero(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
     if (_casoSevero.Actualizar(Convert.ToDecimal(TextBox_ID.Text), Convert.ToDecimal(TextBox_ID_EMPLEADO.Text),
         Convert.ToDateTime(TextBox_FECHA_R.Text), TextBox_OBS_REG.Text))
     {
         Informar(Label_MENSAJE, "El registro fue actualizada correctamente.", Proceso.Correcto);
         TextBox_ID.Text = ID.ToString();
     }
     else
     {
         if (!String.IsNullOrEmpty(_casoSevero.MensajeError)) Informar(Label_MENSAJE, "Error: Consulte con el Administrador: " + _casoSevero.MensajeError, Proceso.Error);
     }
     Ocultar();
     Mostrar(Acciones.Guarda);
     Bloquear(Acciones.Guarda);
 }
コード例 #3
0
    protected void GridView_RESULTADOS_BUSQUEDA_SelectedIndexChanged(object sender, EventArgs e)
    {
        Ocultar();
        casoSevero _casoSevero = new casoSevero(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        DataTable _dataTable = new DataTable();
        _dataTable = _casoSevero.ObtenerPorIdEmpleado(Convert.ToDecimal(this.GridView_RESULTADOS_BUSQUEDA.SelectedDataKey["ID_EMPLEADO"].ToString()));

        Cargar(this.GridView_RESULTADOS_BUSQUEDA);
        if (_dataTable.Rows.Count > 0)
        {
            GridView_RESULTADOS_BUSQUEDA_CASOS_SEVEROS.DataSource = _dataTable;
            GridView_RESULTADOS_BUSQUEDA_CASOS_SEVEROS.DataBind();
            Mostrar(Acciones.BusquedaEncontroCasosSeveros);
        }
        else
        {
            if (!String.IsNullOrEmpty(_casoSevero.MensajeError)) Informar(Label_MENSAJE, "Error: Consulte con el Administrador: " + _casoSevero.MensajeError, Proceso.Error);
            Adicionar();
        }
        _dataTable.Dispose();
    }