string ISingletonGeneric <Sector> .Erase(Sector Data) { IC.CreateCommand("Sectores_Delete"); IC.ParameterAddInt("ID", Data.ID); IC.Update("Error: No se pudo eliminar este sector"); ISingletonSector ISS = this; return(ISS.ListToJson(Data)); }
string ISingletonGeneric <Sector> .Find(Sector Data) { IC.CreateCommand("Sectores_Find"); IC.ParameterAddInt("ID", Data.ID); DataRow DR = IC.Find("Error: No se pudo encontrar este sector"); ISingletonSector ISS = this; ISS.MakeData(DR, Data); IID IID = Data; return(IID.RowToJson(DR)); }
List <Sector> ISingletonGeneric <Sector> .List(Sector Data) { List <Sector> Sectores = new List <Sector>(); IC.CreateCommand("Sectores_List"); DataTable DT = IC.List("Error: No se pudo listar sectores"); ISingletonSector ISS = this; foreach (DataRow DR in DT.Rows) { Sector Sector = new Sector(); ISS.MakeData(DR, Sector); Sectores.Add(Sector); } return(Sectores); }