Exemple #1
0
        public async Task <IActionResult> Edit(decimal id, [Bind("ID,VERSION,CHANGEDATE,NAME,REVISIONCOMMENTS")] RevisionHistory revisionHistory)
        {
            if (id != revisionHistory.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(revisionHistory);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RevisionHistoryExists(revisionHistory.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(revisionHistory));
        }
Exemple #2
0
        public int SaveRevisionHistory(RevisionHistory pOCO)
        {
            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["TCCCMSDBConnectionString"].ConnectionString);

            con.Open();
            SqlCommand cmd = new SqlCommand("stpSaveRevisionHistory", con);

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("@Chapter", pOCO.Chapter.ToString());
            cmd.Parameters.AddWithValue("@Section", pOCO.Section.ToString());
            cmd.Parameters.AddWithValue("@ChangeComment", pOCO.ChangeComment.ToString());
            cmd.Parameters.AddWithValue("@ModificationDate", pOCO.ModificationDate);
            cmd.Parameters.AddWithValue("@HeaderId", pOCO.HeaderId);

            if (pOCO.ID > 0)
            {
                cmd.Parameters.AddWithValue("@RevisionHistoryId", pOCO.ID);
            }
            else
            {
                cmd.Parameters.AddWithValue("@RevisionHistoryId ", DBNull.Value);
            }

            int recordsAffected = cmd.ExecuteNonQuery();

            con.Close();

            return(recordsAffected);
        }
        public JsonResult SaveRevisionHistory(RevisionHistory pOCO)
        {
            RevisionHistoryBL bL = new RevisionHistoryBL();
            RevisionHistory   pC = new RevisionHistory();

            return(Json(bL.SaveRevisionHistory(pOCO), JsonRequestBehavior.AllowGet));
        }
Exemple #4
0
 public string GetCurrentRevision()
 {
     if (!IsControlled | RevisionHistory == null)
     {
         return(string.Empty);
     }
     return(RevisionHistory.GetMostRecentVersion());
 }
        public JsonResult GetFormIdForModifiedSection()
        {
            RevisionHistoryBL bL = new RevisionHistoryBL();

            RevisionHistory pC = new RevisionHistory();

            pC.FormId = pC.FormId;

            return(Json(bL.GetFormIdForModifiedSection(), JsonRequestBehavior.AllowGet));
        }
Exemple #6
0
        public async Task <IActionResult> Create([Bind("ID,VERSION,CHANGEDATE,NAME,REVISIONCOMMENTS")] RevisionHistory revisionHistory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(revisionHistory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(revisionHistory));
        }
Exemple #7
0
        public RevisionHeaderHistoryViewModel GetAllRevisionDetails()
        {
            RevisionHeaderHistoryViewModel rhhVM = new RevisionHeaderHistoryViewModel();

            using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["TCCCMSDBConnectionString"].ConnectionString))
            {
                using (SqlCommand cmd = new SqlCommand("GetRevisionDetails", con))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    con.Open();

                    DataSet        ds = new DataSet();
                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    da.Fill(ds);
                    List <RevisionHeader> rHeaderList = new List <RevisionHeader>();
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        RevisionHeader rHeader = new RevisionHeader();
                        rHeader.Id           = Convert.ToInt32(dr["Id"]);
                        rHeader.RevisionNo   = Convert.ToString(dr["RevisionNo"]);
                        rHeader.RevisionDate = Convert.ToString(dr["RevisionDate"]);

                        var histRows = ds.Tables[1].Rows
                                       .Cast <DataRow>()
                                       .Where(x => x.Field <int>(5) == rHeader.Id).ToList();

                        List <RevisionHistory> rhList = new List <RevisionHistory>();
                        foreach (DataRow drh in histRows)
                        {
                            RevisionHistory rh = new RevisionHistory();
                            rh.ID               = Convert.ToInt32(drh["RevisionHistoryId"]);
                            rh.Chapter          = Convert.ToString(drh["Chapter"]);
                            rh.Section          = Convert.ToString(drh["Section"]);
                            rh.ChangeComment    = Convert.ToString(drh["ChangeComment"]);
                            rh.ModificationDate = Convert.ToString(drh["ModificationDate"]);
                            rh.HeaderId         = Convert.ToInt32(drh["HeaderId"]);

                            rhList.Add(rh);
                        }
                        rHeader.RevisionHistoryList = rhList;


                        rHeaderList.Add(rHeader);
                    }
                    rhhVM.RevisionHeaderList = rHeaderList;
                }
            }


            return(rhhVM);
        }
        public JsonResult LoadData()
        {
            int draw, start, length;
            int pageIndex = 0;

            if (null != Request.Form.GetValues("draw"))
            {
                draw   = int.Parse(Request.Form.GetValues("draw").FirstOrDefault().ToString());
                start  = int.Parse(Request.Form.GetValues("start").FirstOrDefault().ToString());
                length = int.Parse(Request.Form.GetValues("length").FirstOrDefault().ToString());
            }
            else
            {
                draw   = 1;
                start  = 0;
                length = 500;
            }

            if (start == 0)
            {
                pageIndex = 1;
            }
            else
            {
                pageIndex = (start / length) + 1;
            }

            RevisionHistoryBL bL = new RevisionHistoryBL();
            int totalrecords     = 0;

            List <RevisionHistory> pocoList = new List <RevisionHistory>();

            pocoList = bL.GetRevisionHistoryPageWise(pageIndex, ref totalrecords, length /*, int.Parse(Session["VesselID"].ToString())*/);
            List <RevisionHistory> pList = new List <RevisionHistory>();

            foreach (RevisionHistory pC in pocoList)
            {
                RevisionHistory pOCO = new RevisionHistory();
                pOCO.ID              = pC.ID;
                pOCO.FormName        = pC.FormName;
                pOCO.ModifiedSection = pC.ModifiedSection;
                pOCO.UpdatedOn1      = pC.UpdatedOn1;
                pOCO.Version         = pC.Version;

                pList.Add(pOCO);
            }

            var data = pList;

            return(Json(new { draw = draw, recordsFiltered = totalrecords, recordsTotal = totalrecords, data = data }, JsonRequestBehavior.AllowGet));
        }
Exemple #9
0
        public Archetype(ArchetypeId archetypeId, string concept, CComplexObject definition,
                         ArchetypeOntology ontology, CodePhrase originalLanguage, RevisionHistory revisionHistory,
                         bool isControlled)
            : base(originalLanguage, revisionHistory, isControlled)
        {
            Check.Require(archetypeId != null, string.Format(CommonStrings.XMustNotBeNull, "archetypeId"));
            Check.Require(!string.IsNullOrEmpty(concept) != null, string.Format(CommonStrings.XMustNotBeNullOrEmpty, "concept"));
            Check.Require(definition != null, string.Format(CommonStrings.XMustNotBeNull, "definition"));
            Check.Require(ontology != null, string.Format(CommonStrings.XMustNotBeNull, "ontology"));

            this.archetypeId = archetypeId;
            this.definition  = definition;
            this.ontology    = ontology;
        }
Exemple #10
0
    public void Edit(IPrincipal user, SetValue setValue)
    {
        setValue.Value = valuestring;
        var  original = db.SetValue.Find(setValue.SetValueID);
        bool modified = original.Value != setValue.Value;

        if (modified)
        {
            var rev = new RevisionHistory();
            rev.CreatedOn  = original.ModifiedOn;
            rev.ModifiedBy = User.Identity.Name;         //If modified exception on this line
            db.Entry(original).CurrentValues.SetValues(setValue);
            db.RevisionHistory.Add(rev);
        }
        original.ModifiedOn      = DateTime.Now;
        original.ModifiedBy      = User.Identity.Name;    //if not modified exception on this line
        db.Entry(original).State = EntityState.Modified;
        db.SaveChanges();
    }
        public int SaveRevisionHistory(RevisionHistory pOCO /*,int VesselID*/)
        {
            RevisionHistoryDAL dAL = new RevisionHistoryDAL();

            return(dAL.SaveRevisionHistory(pOCO /*, VesselID*/));
        }
        public void ReadOperationalTemplate(XmlReader reader, OperationalTemplate template)
        {
            Check.Require(reader != null, string.Format(CommonStrings.XMustNotBeNull, "reader"));
            Check.Require(template != null, string.Format(CommonStrings.XMustNotBeNull, "template"));

            reader.ReadStartElement();  //template
            reader.MoveToContent();

            CodePhrase language = new CodePhrase();

            language.ReadXml(reader);
            template.Language = language;

            if (reader.LocalName == "is_controlled")
            {
                reader.ReadElementContentAsBoolean("is_controlled", RmXmlSerializer.OpenEhrNamespace);
                reader.MoveToContent();
            }

            if (reader.LocalName == "description")
            {
                ResourceDescription description = new ResourceDescription();
                description.ReadXml(reader);
                template.Description = description;
            }

            if (reader.LocalName == "revision_history")
            {
                RevisionHistory revisionHistory = new RevisionHistory();
                revisionHistory.ReadXml(reader);
                template.RevisionHistory = revisionHistory;
            }

            if (reader.LocalName == "uid")
            {
                HierObjectId uid = new HierObjectId();
                uid.ReadXml(reader);
                template.Uid = uid;
            }

            TemplateId templateId = new TemplateId();

            templateId.ReadXml(reader);
            template.TemplateId = templateId;

            template.Concept = reader.ReadElementContentAsString("concept", RmXmlSerializer.OpenEhrNamespace);
            reader.MoveToContent();

            CArchetypeRoot definition = new CArchetypeRoot();

            ReadCArchetypeRoot(reader, definition);
            template.Definition = definition;

            // LMT added 12 May 2010 for TMP-1252
            if (reader.LocalName == "annotations")
            {
                template.Annotations =
                    new List <OpenEhr.RM.Common.Resource.Annotation>();
                OpenEhr.RM.Common.Resource.Annotation currentAnnotation;
                while (reader.LocalName == "annotations")
                {
                    currentAnnotation = ReadAnnotation(reader);
                    template.Annotations.Add(currentAnnotation);
                    reader.MoveToContent();
                }
            }

            if (reader.LocalName == "constraints")
            {
                TConstraint constraints = new TConstraint();
                ReadTConstraint(reader, constraints);
                template.Constraints = constraints;
            }

            if (reader.LocalName == "view")
            {
                TView view = new TView();
                ReadTView(reader, view);
                template.View = view;
            }

            reader.ReadEndElement();    // template
            reader.MoveToContent();
        }
Exemple #13
0
 public void ShouldReturnCommittedTimeOfMostRecentVersion()
 {
     var history = new RevisionHistory();
     var result  = history.GetCommittedTimeOfMostRecentVersion();
 }
Exemple #14
0
 public void ShouldReturnMostRecentVersion()
 {
     var history = new RevisionHistory();
     var result  = history.GetMostRecentVersion();
 }