Пример #1
0
        public ActionResult ControlDeleteRow(int Id, string sourceForm, string sourceFormId)
        {
            dataModel = OAPServiceSystem.GetServiceModel(OAPServiceSystem.OAPDataModelType.Comment);
            CommentModel comment = dataModel.GetItem(string.Format("Id={0}", Id), "Id");

            if (comment != null)
            {
                dataModel.Delete(comment);
            }
            return(Control(sourceForm, sourceFormId));
        }
Пример #2
0
        public ActionResult InlineControlDelete(int Id, string SourceForm, string SourceFormId, string QuestionId, string QuestionText)
        {
            dataModel = OAPServiceSystem.GetServiceModel(OAPServiceSystem.OAPDataModelType.Comment);
            CommentModel comment = dataModel.GetItem(string.Format("Id={0}", Id), "Id");

            if (comment != null)
            {
                dataModel.Delete(comment);
            }

            return(InlineControl(SourceForm, SourceFormId, QuestionId, QuestionText));
        }
Пример #3
0
        public ActionResult LessonsLearnedDeleteOriginatorsPartial(int Id)
        {
            dataModel = OAPServiceSystem.GetServiceModel(OAPServiceSystem.OAPDataModelType.LessonLearnedOriginator);
            var originator = (LessonLearnedOriginatorModel)dataModel.GetItem(string.Format("Id={0}", Id), "Id");

            if (originator != null)
            {
                dataModel.Delete(originator);
                var lessonLearnedModel = (LessonLearnedModel)Session["LessonLearnedModel"];
                lessonLearnedModel.Originators.RemoveAll(o => o.Id == originator.Id);
            }

            return(LessonsLearnedOriginatorsPartial());
        }