Exemple #1
0
        public int DeleteFaculty(string facultyCode)
        {
            int i = 0;

            using (MySqlCommand command = new MySqlCommand())
            {
                i = ExecuteNonQuery(FacultyStringsMySql.DeleteFaculty(facultyCode));
            }

            return(i);
        }
Exemple #2
0
        public FacultyModel UpdateFaculty(FacultyModel facultyModel)
        {
            DataTable dt = new DataTable();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(FacultyStringsMySql.UpdateFaculty(facultyModel));
            }
            foreach (DataRow ms in dt.Rows)
            {
                facultyModel = FacultyModel.ToObject(ms);
            }

            return(facultyModel);
        }
Exemple #3
0
        public List <FacultyModel> GetAllFaculties()
        {
            DataTable dt = new DataTable();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(FacultyStringsMySql.GetAllFaculties());
            }

            List <FacultyModel> arrFaculty = new List <FacultyModel>();

            foreach (DataRow ms in dt.Rows)
            {
                arrFaculty.Add(FacultyModel.ToObject(ms));
            }

            return(arrFaculty);
        }
Exemple #4
0
        public FacultyModel GetOneFacultyByCode(string facultyCode)
        {
            DataTable dt = new DataTable();

            if (facultyCode.Equals(string.Empty) || facultyCode.Equals(""))
            {
                throw new ArgumentOutOfRangeException();
            }
            FacultyModel facultyModel = new FacultyModel();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(FacultyStringsMySql.GetOneFacultyByCode(facultyCode));
            }

            foreach (DataRow ms in dt.Rows)
            {
                facultyModel = FacultyModel.ToObject(ms);
            }

            return(facultyModel);
        }