public Division GetByID(int _divisionID) { DivisionDAC _divisionComponent = new DivisionDAC(); IDataReader reader = _divisionComponent.GetByIDDivision(_divisionID); Division _division = null; while (reader.Read()) { _division = new Division(); if (reader["DivisionID"] != DBNull.Value) { _division.DivisionID = Convert.ToInt32(reader["DivisionID"]); } if (reader["DepartmentID"] != DBNull.Value) { _division.DepartmentID = Convert.ToInt32(reader["DepartmentID"]); } if (reader["Name"] != DBNull.Value) { _division.Name = Convert.ToString(reader["Name"]); } if (reader["SiteUrl"] != DBNull.Value) { _division.SiteUrl = Convert.ToString(reader["SiteUrl"]); } _division.NewRecord = false; } reader.Close(); return(_division); }
public List <Division> GetAll(int DepartmentID) { DivisionDAC _divisionComponent = new DivisionDAC(); IDataReader reader = _divisionComponent.GetAllDivision("DepartmentID = " + DepartmentID).CreateDataReader(); List <Division> _divisionList = new List <Division>(); while (reader.Read()) { if (_divisionList == null) { _divisionList = new List <Division>(); } Division _division = new Division(); if (reader["DivisionID"] != DBNull.Value) { _division.DivisionID = Convert.ToInt32(reader["DivisionID"]); } if (reader["DepartmentID"] != DBNull.Value) { _division.DepartmentID = Convert.ToInt32(reader["DepartmentID"]); } if (reader["Name"] != DBNull.Value) { _division.Name = Convert.ToString(reader["Name"]); } if (reader["SiteUrl"] != DBNull.Value) { _division.SiteUrl = Convert.ToString(reader["SiteUrl"]); } _division.NewRecord = false; _divisionList.Add(_division); } reader.Close(); return(_divisionList); }
public bool Insert(int DepartmentID, string Name, string SiteUrl) { DivisionDAC divisionComponent = new DivisionDAC(); int DivisionID = 0; return(divisionComponent.InsertNewDivision(ref DivisionID, DepartmentID, Name, SiteUrl)); }
public override void Update(Division objeto) { if (Verificar(objeto)) { DivisionDAC divisionDAC = new DivisionDAC(); divisionDAC.Update(objeto); } }
public override Division Create(Division objeto) { if (Verificar(objeto)) { DivisionDAC divisionDAC = new DivisionDAC(); return(divisionDAC.Create(objeto)); } else { return(null); } }
public bool Insert(Division division) { int autonumber = 0; DivisionDAC divisionComponent = new DivisionDAC(); bool endedSuccessfuly = divisionComponent.InsertNewDivision(ref autonumber, division.DepartmentID, division.Name, division.SiteUrl); if (endedSuccessfuly) { division.DivisionID = autonumber; } return(endedSuccessfuly); }
public override Division ReadBy(Division objeto) { DivisionDAC divisionDAC = new DivisionDAC(); return(divisionDAC.ReadBy(objeto)); }
public override Division ReadBy(int id) { DivisionDAC divisionDAC = new DivisionDAC(); return(divisionDAC.ReadBy(id)); }
public override List <Division> Read() { DivisionDAC divisionDAC = new DivisionDAC(); return(divisionDAC.Read()); }
public override void Delete(int id) { DivisionDAC divisionDAC = new DivisionDAC(); divisionDAC.Delete(id); }
public int UpdateDataset(System.Data.DataSet dataset) { DivisionDAC divisioncomponent = new DivisionDAC(); return(divisioncomponent.UpdateDataset(dataset)); }
public void Delete(int Original_DivisionID) { DivisionDAC divisionComponent = new DivisionDAC(); divisionComponent.DeleteDivision(Original_DivisionID); }
public bool Update(int DepartmentID, string Name, string SiteUrl, int Original_DivisionID) { DivisionDAC divisionComponent = new DivisionDAC(); return(divisionComponent.UpdateDivision(DepartmentID, Name, SiteUrl, Original_DivisionID)); }
public bool Update(Division division, int old_divisionID) { DivisionDAC divisionComponent = new DivisionDAC(); return(divisionComponent.UpdateDivision(division.DepartmentID, division.Name, division.SiteUrl, old_divisionID)); }