public PartialViewResult GetEmploeeSelector(R2Model m) //, String SessionId) { //NskdSessionLite session = NskdSessionLite.GetById(SessionId); m.Emploee.FillManagerData(); m.Emploee.ManagerSelector = "-1"; return(PartialView("EmploeeSelector", m)); }
private void PopulateBaseModelColumn(R2Model baseModel) { modelsDataGridView.Columns[COLUMN_BASE_MODEL].HeaderText = baseModel.Name; modelsDataGridView.Columns[COLUMN_BASE_MODEL].Tag = baseModel; int rowNumber = 0; foreach (R2ModelElement element in baseModel.children) { DataGridViewCell cell = modelsDataGridView.Rows[rowNumber].Cells[COLUMN_BASE_MODEL]; cell.Style = new DataGridViewCellStyle { BackColor = R2Config.config.getSectionColor(element.GetExtId(), Color.White) }; cell.Tag = element; cell.Value = element.GetExtId(); if (element is R2Criterion) { R2Criterion criterion = (R2Criterion)element; cell.ToolTipText = criterion.Text; } else if (element is R2Function) { R2Function function = (R2Function)element; cell.ToolTipText = function.Name + "\n" + function.Description; } else if (element is R2Section) { R2Section section = (R2Section)element; cell.ToolTipText = section.Name; } rowNumber++; } }
/** * Load a HL7 Model from a MAX file. * The MAX file contains a HL7-FM or a HL7-Profile */ public static Base.R2Model LoadModel(string maxFileName, bool ReadOnly) { XmlSerializer serializer = new XmlSerializer(typeof(ModelType)); StreamReader stream = new StreamReader(maxFileName); ModelType sourceModel; using (stream) { sourceModel = (ModelType)serializer.Deserialize(stream); } ObjectType modelObjectType = sourceModel.objects.Single( o => R2Const.ST_FM.Equals(o.stereotype) || R2Const.ST_FM_PROFILE.Equals(o.stereotype)); R2Model model = new R2Model(modelObjectType); model.IsReadOnly = ReadOnly; foreach (ObjectType objectType in sourceModel.objects) { R2ModelElement modelElement = Create(objectType); // modelElement can be null when it is a not supported object if (modelElement != null && !(modelElement is R2RootElement)) { modelElement.IsReadOnly = ReadOnly; model.children.Add(modelElement); } } return(model); }
private void LoadBaseModelAndNewMergedProfile() { baseModel = R2ModelV2.MAX.Factory.LoadModel(fileNameBaseModel, true); modelsDataGridView.Rows.Clear(); modelsDataGridView.Rows.Add(baseModel.children.Count); // Create initial Profile Definition Object R2ProfileDefinition profileDef = new R2ModelV2.MAX.R2ProfileDefinition { Name = "Merged Profile", Type = "Merged", Version = "1.0", LanguageTag = "en-EN", Rationale = "", Scope = "", PrioDef = "", ConfClause = "", LastModified = Util.FormatLastModified(DateTime.Now), BaseModelName = baseModel.Name }; profileDef.SaveToSource(); modelsDataGridView.Columns[COLUMN_MERGED_PROFILE].HeaderText = profileDef.Name; modelsDataGridView.Columns[COLUMN_MERGED_PROFILE].Tag = profileDef; PopulateBaseModelColumn(baseModel); // Enable buttons now loadButton.Enabled = true; saveButton.Enabled = true; selectButton.Enabled = true; clearButton.Enabled = true; }
public Object Index() { Object v = null; var m = new R2Model(); if (ControllerContext.HttpContext.IsDebuggingEnabled) { v = View("~/Views/R2/Index.cshtml", m); // _ViewStart.cshtml } else { v = PartialView("~/Views/R2/Index.cshtml", m); } return(v); }
/** * Factory method to create correct model class based on the EA.Element */ public static R2ModelElement Create(ObjectType objectType) { R2ModelElement modelElement = null; switch (objectType.stereotype) { case R2Const.ST_FM: modelElement = new R2Model(objectType); break; case R2Const.ST_FM_PROFILEDEFINITION: case R2Const.ST_FM_PROFILE: modelElement = new R2ProfileDefinition(objectType); break; case R2Const.ST_SECTION: modelElement = new R2Section(objectType); break; case R2Const.ST_HEADER: case R2Const.ST_FUNCTION: modelElement = new R2Function(objectType); break; case R2Const.ST_CRITERION: modelElement = new R2Criterion(objectType); break; case R2Const.ST_COMPILERINSTRUCTION: // TODO: baseElement comes from BaseModel, mock to Criterion for now Console.Write("!! R2ModelV2MAX.Create ST_COMPILERINSTRUCTION mocked to Criterion"); modelElement = new R2Criterion(objectType); //modelElement.IsCompilerInstruction = true; break; } return(modelElement); }
private void LoadProfile(int columnNumber, string maxFileName, DataGridViewCellStyle cellStyle) { R2Model model = R2ModelV2.MAX.Factory.LoadModel(maxFileName, true); modelsDataGridView.Columns[columnNumber].HeaderText = model.Name; modelsDataGridView.Columns[columnNumber].Tag = model; foreach (R2ModelElement element in model.children) { int rowNumber = getBaseModelRowNumber(element.GetAlignId()); if (rowNumber == -1) { // Base Model doesnot have this row, add Row at end rowNumber = modelsDataGridView.Rows.Add(); } DataGridViewCell cell = modelsDataGridView.Rows[rowNumber].Cells[columnNumber]; cell.Style = cellStyle; cell.Tag = element; cell.Value = element.GetExtId(); if (element is R2Criterion) { R2Criterion criterion = (R2Criterion)element; cell.ToolTipText = criterion.Text; } else if (element is R2Function) { R2Function function = (R2Function)element; cell.ToolTipText = function.Name + "\n" + function.Description; } else if (element is R2Section) { R2Section section = (R2Section)element; cell.ToolTipText = section.Name; } } }
public PartialViewResult GetReport(R2Model m) { m.GetReport(); return(PartialView("Report", m)); }
public ActionResult Index() { R2Model m = new R2Model(); return(View(m)); }
public Object GetReport(R2Model m) { m.GetReport(); return(PartialView("Report", m)); }
private void LoadDummyProfile(int columnNumber, DataGridViewCellStyle cellStyle) { R2Model model = new R2Model { Name = "Dummy" }; modelsDataGridView.Columns[columnNumber].HeaderText = model.Name; modelsDataGridView.Columns[columnNumber].Tag = model; R2Section section = new R2Section { SectionId = "CP", IsReadOnly = true }; model.children.Add(section); int rowNumber = getBaseModelRowNumber(section.GetAlignId()); DataGridViewCell sectionCell = modelsDataGridView.Rows[rowNumber].Cells[columnNumber]; sectionCell.Tag = section; sectionCell.Value = string.Format("{0}", section.SectionId); sectionCell.Style = cellStyle; for (int h = 1; h < 3; h++) { R2Function header = new R2Function { FunctionId = string.Format("CP.{0}", h), IsReadOnly = true }; model.children.Add(header); rowNumber = getBaseModelRowNumber(header.GetAlignId()); if (rowNumber == -1) { // Base Model doesnot have this row, add Row at end rowNumber = modelsDataGridView.Rows.Add(); } DataGridViewCell headerCell = modelsDataGridView.Rows[rowNumber].Cells[columnNumber]; headerCell.Tag = header; headerCell.Value = header.FunctionId; headerCell.Style = cellStyle; for (int f = 1; f < 3; f++) { R2Function function = new R2Function { FunctionId = string.Format("CP.{0}.{1}", h, f), IsReadOnly = true }; model.children.Add(function); rowNumber = getBaseModelRowNumber(function.GetAlignId()); if (rowNumber == -1) { // Base Model doesnot have this row, add Row at end rowNumber = modelsDataGridView.Rows.Add(); } DataGridViewCell functionCell = modelsDataGridView.Rows[rowNumber].Cells[columnNumber]; functionCell.Tag = function; functionCell.Value = function.FunctionId; functionCell.Style = cellStyle; for (int c = 1; c < 4; c++) { R2Criterion criterion = new R2Criterion { FunctionId = string.Format("CP.{0}.{1}", h, f), CriterionSeqNo = c, Text = "The system SHALL xyz", Optionality = "SHALL", IsReadOnly = true }; model.children.Add(criterion); criterion.SetRefId(null, string.Format("CP.{0}.{1}", h, f), string.Format("{0}", c + 1)); rowNumber = getBaseModelRowNumber(criterion.GetAlignId()); if (rowNumber == -1) { // Base Model doesnot have this row, add Row at end rowNumber = modelsDataGridView.Rows.Add(); } DataGridViewCell criterionCell = modelsDataGridView.Rows[rowNumber].Cells[columnNumber]; criterionCell.Tag = criterion; criterionCell.Value = string.Format("! {0}", criterion.Name); criterionCell.ToolTipText = criterion.Text; criterionCell.Style = cellStyle; } } } }