public Estructuras.Planilla ObtenerPlanilla(int id) { PlanillaCl oPlanillaCl = new PlanillaCl(); var data = oPlanillaCl.ObtenerPlanilla(id); Estructuras.Planilla oPlanilla = new Estructuras.Planilla(); oPlanilla.ID = Convert.ToInt32(data.Tables[0].Rows[0]["id"]); oPlanilla.Nombre = data.Tables[0].Rows[0]["nombre"].ToString(); oPlanilla.Fecha=Convert.ToDateTime(data.Tables[0].Rows[0]["fecha"]); return oPlanilla; }
public string EditarPlanilla(Estructuras.Planilla planilla, int id) { PlanillaCl oPlanillaCl = new PlanillaCl(); oPlanillaCl.ModificarPlanilla(id, planilla.Nombre, planilla.Fecha); if (oPlanillaCl.IsError) { return "Error " + oPlanillaCl.ErrorDescripcion; } else { return "Planilla editada correctamente"; } }
public string InsertarPlanillaEmpleado(IEnumerable<Estructuras.PlanillaEmpleado> planillaempleado) { PlanillaCl oPlanillaCl = new PlanillaCl(); oPlanillaCl.InsertarPlanillaEmpleado(planillaempleado); if (oPlanillaCl.IsError) { return "Error " + oPlanillaCl.ErrorDescripcion; } else { return "Planilla editada correctamente"; } }
public string AgregarPlanilla(Estructuras.Planilla planilla) { PlanillaCl oPlanillaCl = new PlanillaCl(); oPlanillaCl.InsertarPlanilla(planilla.Nombre, planilla.Fecha); if (oPlanillaCl.IsError) { return "Error " + oPlanillaCl.ErrorDescripcion; } else { return "Planilla agregada correctamente"; } }
public IEnumerable<Estructuras.Planilla> TraerPlanillas(string filtro) { List<Estructuras.Planilla> planillas = new List<Estructuras.Planilla>(); PlanillaCl oPlanillaCl = new PlanillaCl(); var data = oPlanillaCl.TraerPlanillas(filtro); if (oPlanillaCl.IsError) { return null; } foreach (DataRow item in data.Tables[0].Rows) { planillas.Add(new Estructuras.Planilla() { ID=Convert.ToInt32(item["id"]), Nombre=item["nombre"].ToString(), Fecha=Convert.ToDateTime(item["fecha"]) }); } return planillas; }