using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
/// <summary>
/// clace planilla
/// </summary>
public class Planilla_Clace : Cls_Conexion
{
string tabla = "Item_Planilla"; //Nombre de la tabla Item_Planilla
protected int Nro_planilla;
protected DateTime Fecha = new DateTime(2000,01,01);
// Constructor
public Planilla_Clace(int Nro_Planilla, DateTime Fecha)
{
this.Nro_planilla = Nro_Planilla;
this.Fecha = Fecha;
}
// Metodo para establecer y recuperar datos
public int NroPlanilla
{
set { Nro_planilla = value; }
get { return Nro_planilla; }
}
public DateTime Fech_a
{
set { Fecha = value; }
get { return Fecha; }
}
//Método de agregar registro planilla
public void agregar() // porque void?? porque noooo retorna nada
{
conectar(tabla); //Abre la conexion
DataRow fila; //Crea un nuevo registro
fila = Data.Tables[tabla].NewRow(); //Agregar un nuevo registro
fila["Nro_planilla"] = NroPlanilla;
fila["Fecha"] = Fecha;
Data.Tables[tabla].Rows.Add(fila); //Agregamos el regsitro cargado
AdaptadorDatos.Update(Data, tabla); //Actualiza registro
}
}
protected void Button_Agregar_Click(object sender, EventArgs e)
{
Planilla_Clace Pla = new Planilla_Clace(0,ERROR);
Pla.NroPlanilla=int.Parse(TextBox_Nro_Planilla);
Pla.Fech_a = TextBox_Fecha;
}