Exemple #1
0
 // GET: Information
 public InformationController()
 {
     studentInformation           = new StudentInformation();
     roomInformation              = new RoomInformation();
     districtInformation          = new DistrictInformation();
     addressInformation           = new AddressInformation();
     departmentInformation        = new DepartmentInformation();
     studentDepartmentInformation = new StudentDepartmentInformation();
     mealInformation              = new MealInformation();
     accountInformation           = new AccountInformation();
 }
        public async Task <IActionResult> Update(DepartmentInformation departmentInformation)
        {
            try
            {
                var department = await _repository.Update(departmentInformation);

                return(Ok(department));
            }
            catch (Exception)
            {
                throw;
            }
        }
        public async Task <IActionResult> GetById(DepartmentInformation departmentInformation)
        {
            try
            {
                var department = await _repository.GetById(departmentInformation.Id);

                return(Ok(department));
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #4
0
        public async Task <DepartmentInformation> Insert(DepartmentInformation departmentInformation)
        {
            try
            {
                _context.DepartmentInformations.Add(departmentInformation);
                await _context.SaveChangesAsync();

                return(departmentInformation);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #5
0
        public async Task <DepartmentInformation> Update(DepartmentInformation departmentInformation)
        {
            try
            {
                var classRoom = _context.DepartmentInformations.Attach(departmentInformation);
                classRoom.State = EntityState.Modified;
                await _context.SaveChangesAsync();

                return(departmentInformation);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #6
0
        //部门信息管理
        private void mniDepartmentInfoMana_ItemClick(object sender, ItemClickEventArgs e)
        {
            var di = new DepartmentInformation();

            di.ShowDialog();
        }