コード例 #1
0
        public List <EligibilityDepartment> GetAll()
        {
            EligibilityDepartmentDAC _eligibilityDepartmentComponent = new EligibilityDepartmentDAC();
            IDataReader reader = _eligibilityDepartmentComponent.GetAllEligibilityDepartment().CreateDataReader();
            List <EligibilityDepartment> _eligibilityDepartmentList = new List <EligibilityDepartment>();

            while (reader.Read())
            {
                if (_eligibilityDepartmentList == null)
                {
                    _eligibilityDepartmentList = new List <EligibilityDepartment>();
                }
                EligibilityDepartment _eligibilityDepartment = new EligibilityDepartment();
                if (reader["EligibilityDepartmentId"] != DBNull.Value)
                {
                    _eligibilityDepartment.EligibilityDepartmentId = Convert.ToInt32(reader["EligibilityDepartmentId"]);
                }
                if (reader["DepartmentName"] != DBNull.Value)
                {
                    _eligibilityDepartment.DepartmentName = Convert.ToString(reader["DepartmentName"]);
                }
                _eligibilityDepartment.NewRecord = false;
                _eligibilityDepartmentList.Add(_eligibilityDepartment);
            }
            reader.Close();
            return(_eligibilityDepartmentList);
        }
コード例 #2
0
        public bool Insert(EligibilityDepartment eligibilitydepartment)
        {
            int autonumber = 0;
            EligibilityDepartmentDAC eligibilitydepartmentComponent = new EligibilityDepartmentDAC();
            bool endedSuccessfuly = eligibilitydepartmentComponent.InsertNewEligibilityDepartment(ref autonumber, eligibilitydepartment.DepartmentName);

            if (endedSuccessfuly)
            {
                eligibilitydepartment.EligibilityDepartmentId = autonumber;
            }
            return(endedSuccessfuly);
        }
コード例 #3
0
        public EligibilityDepartment GetByID(int _eligibilityDepartmentId)
        {
            EligibilityDepartmentDAC _eligibilityDepartmentComponent = new EligibilityDepartmentDAC();
            IDataReader           reader = _eligibilityDepartmentComponent.GetByIDEligibilityDepartment(_eligibilityDepartmentId);
            EligibilityDepartment _eligibilityDepartment = null;

            while (reader.Read())
            {
                _eligibilityDepartment = new EligibilityDepartment();
                if (reader["EligibilityDepartmentId"] != DBNull.Value)
                {
                    _eligibilityDepartment.EligibilityDepartmentId = Convert.ToInt32(reader["EligibilityDepartmentId"]);
                }
                if (reader["DepartmentName"] != DBNull.Value)
                {
                    _eligibilityDepartment.DepartmentName = Convert.ToString(reader["DepartmentName"]);
                }
                _eligibilityDepartment.NewRecord = false;
            }
            reader.Close();
            return(_eligibilityDepartment);
        }
コード例 #4
0
        public bool Update(EligibilityDepartment eligibilitydepartment, int old_eligibilityDepartmentId)
        {
            EligibilityDepartmentDAC eligibilitydepartmentComponent = new EligibilityDepartmentDAC();

            return(eligibilitydepartmentComponent.UpdateEligibilityDepartment(eligibilitydepartment.DepartmentName, old_eligibilityDepartmentId));
        }