private void btnClassSave_Click(object sender, RoutedEventArgs e)
        {
            if (FormMode == FormModes.View)
            {
                this.ActualParent.Close();
                return;
            }

            var parent = (ucClassListView)this.ParentContainer;

            ClassDetail.created_by = ClassDetail.updated_by = Utilities.UserSession.UserID;

            if (FormMode == FormModes.New)
            {
                _classid = ClassRepo.Insert(ClassDetail);
                parent.AddToClassList(ClassDetail);
            }
            else
            {
                ClassRepo.Update(ClassDetail);
                parent.Refreshlist();
            }
            ClassSubjectRepo.SaveSubjects(SelectedSubjectList, _classid, Utilities.UserSession.UserID);
            this.ActualParent.Close();
        }
Exemple #2
0
        public IHttpActionResult Post(ClassDto classDto)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            classRepo.Insert(Mapper.Map <Class>(classDto));

            return(CreatedAtRoute("AddClass", new { id = classDto.ClassId }, classDto));
        }