Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        public bool Insert(int DepartmentID, string Name, string SiteUrl)
        {
            DivisionDAC divisionComponent = new DivisionDAC();
            int         DivisionID        = 0;

            return(divisionComponent.InsertNewDivision(ref DivisionID, DepartmentID, Name, SiteUrl));
        }
Example #4
0
 public override void Update(Division objeto)
 {
     if (Verificar(objeto))
     {
         DivisionDAC divisionDAC = new DivisionDAC();
         divisionDAC.Update(objeto);
     }
 }
Example #5
0
 public override Division Create(Division objeto)
 {
     if (Verificar(objeto))
     {
         DivisionDAC divisionDAC = new DivisionDAC();
         return(divisionDAC.Create(objeto));
     }
     else
     {
         return(null);
     }
 }
Example #6
0
        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);
        }
Example #7
0
        public override Division ReadBy(Division objeto)
        {
            DivisionDAC divisionDAC = new DivisionDAC();

            return(divisionDAC.ReadBy(objeto));
        }
Example #8
0
        public override Division ReadBy(int id)
        {
            DivisionDAC divisionDAC = new DivisionDAC();

            return(divisionDAC.ReadBy(id));
        }
Example #9
0
        public override List <Division> Read()
        {
            DivisionDAC divisionDAC = new DivisionDAC();

            return(divisionDAC.Read());
        }
Example #10
0
        public override void Delete(int id)
        {
            DivisionDAC divisionDAC = new DivisionDAC();

            divisionDAC.Delete(id);
        }
Example #11
0
        public int UpdateDataset(System.Data.DataSet dataset)
        {
            DivisionDAC divisioncomponent = new DivisionDAC();

            return(divisioncomponent.UpdateDataset(dataset));
        }
Example #12
0
        public void Delete(int Original_DivisionID)
        {
            DivisionDAC divisionComponent = new DivisionDAC();

            divisionComponent.DeleteDivision(Original_DivisionID);
        }
Example #13
0
        public bool Update(int DepartmentID, string Name, string SiteUrl, int Original_DivisionID)
        {
            DivisionDAC divisionComponent = new DivisionDAC();

            return(divisionComponent.UpdateDivision(DepartmentID, Name, SiteUrl, Original_DivisionID));
        }
Example #14
0
        public bool Update(Division division, int old_divisionID)
        {
            DivisionDAC divisionComponent = new DivisionDAC();

            return(divisionComponent.UpdateDivision(division.DepartmentID, division.Name, division.SiteUrl, old_divisionID));
        }