コード例 #1
0
        public CathedraViewModel(IUserInterop userInterop, IControllerInterop controllerInterop, Dispatcher dispatcher, CathedraDTO cathedra)
            : base(userInterop, controllerInterop, dispatcher)
        {
            faculties = new List<FacultyDTO>();

            originalEntity = cathedra;
        }
コード例 #2
0
ファイル: GroupModel.cs プロジェクト: ZuTa/StudyingController
 public GroupModel(GroupDTO group)
     : base(group)
 {
     this.cathedra = group.Cathedra;
     this.specialization = group.Specialization;
     this.cathedraId = group.CathedraID;
     this.specializationId = group.SpecializationID;
 }
コード例 #3
0
        public async Task <IActionResult> AddNewCathedra(AddCathedraModel model)
        {
            CathedraDTO newItem = new CathedraDTO()
            {
                cathedraName = model.nameCathedra,
                facultyName  = model.nameFaculty,
            };

            await cathedra.Create(newItem);

            return(RedirectToAction("GetCathedra", "EducationalDepartment"));
        }
コード例 #4
0
        public async Task <OperationDetails> Create(CathedraDTO itemDTO)
        {
            Cathedra newItem = new Cathedra()
            {
                cathedraName = itemDTO.cathedraName,
                ID_faculty   = Database.RFaculties.Get(itemDTO.facultyName).IdFaculty
            };

            Database.RCathedra.Create(newItem);
            await Database.Save();

            return(new OperationDetails(true, "Registration success", ""));
        }
コード例 #5
0
        public CathedraDTO FindCathedra(string name)
        {
            Cathedra    item    = Database.RCathedra.Get(name);
            CathedraDTO itemDTO = null;

            if (item != null)
            {
                itemDTO = new CathedraDTO();

                itemDTO.Id_Cathedra  = item.IdCathedra;
                itemDTO.cathedraName = item.cathedraName;
                itemDTO.facultyName  = Database.RCathedra.GetAll().Where(x => x.IdCathedra == item.IdCathedra).SingleOrDefault().cathedraName;
            }

            return(itemDTO);
        }