public async Task <IActionResult> Edit(int id, [Bind("Id,Data")] ReleaseNote releaseNote)
        {
            if (id != releaseNote.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(releaseNote);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ReleaseNoteExists(releaseNote.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(releaseNote));
        }
Example #2
0
        public async Task <IActionResult> AddRelease([FromForm] AddReleaseNoteViewModel releaseNote)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var rn = new ReleaseNote
                    {
                        Name = releaseNote.Name,
                        Date = releaseNote.Date,
                    };

                    _context.ReleaseNotes.Add(rn);

                    await _context.SaveChangesAsync();


                    //return RedirectToAction(nameof(Details), new { releaseNoteId = rn.Id });
                    return(RedirectToAction(nameof(Index)));
                }
            }
            catch (DbUpdateException)
            {
                ModelState.AddModelError("", "unable to change changes");
            }

            return(View(releaseNote));
        }
 public bool DeleteReleaseNote( ReleaseNote entity)
 {
     if (entity == null) return false;
     _unitOfWork. ReleaseNoteRepository.Delete(entity);
     _unitOfWork.Save();
     return true;
 }
Example #4
0
        private ReleaseNote ImportReleaseNote(ReleaseNoteObject releaseNoteObj)
        {
            if (releaseNoteObj == null)
            {
                return(null);
            }

            bool        isNew       = false;
            ReleaseNote releaseNote = importRepo.ReleaseNoteRepo.Get(releaseNoteObj.Id);

            if (releaseNote == null)
            {
                releaseNote = new ReleaseNote();
                isNew       = true;
            }

            releaseNote.Id       = releaseNoteObj.Id;
            releaseNote.IsActive = releaseNoteObj.IsActive;
            releaseNote.Number   = releaseNoteObj.Number;
            releaseNote.Shipped  = releaseNoteObj.Shipped;
            releaseNote.Date     = releaseNoteObj.Date;


            if (isNew)
            {
                importRepo.ReleaseNoteRepo.Save(releaseNote);
            }
            else
            {
                importRepo.ReleaseNoteRepo.SaveOrUpdate(releaseNote);
            }

            return(releaseNote);
        }
 public bool IsExistingReleaseNote(ReleaseNote releaseNote)
 {
     using (var db = new ReleaseNotesContext())
     {
         return(db.ReleaseNotes.Any(x => x.Version == releaseNote.Version));
     }
 }
Example #6
0
        public HttpResponseMessage EditSoftwareReleaseNotes(SoftwareReleaseNote softwareReleaseNotes)
        {
            HttpResponseMessage response = Request.CreateResponse();

            try
            {
                ReleaseNote releaseNote = _dbEntities.ReleaseNotes.Where(a => a.ReleaseID == softwareReleaseNotes.SoftwareReleaseId &&
                                                                         a.ReleaseNoteTypeCode == softwareReleaseNotes.SoftwareReleaseNoteTypeCode
                                                                         ).FirstOrDefault();
                if (releaseNote != null)
                {
                    releaseNote.ReleaseNoteTypeCode  = softwareReleaseNotes.SoftwareReleaseNoteTypeCode;
                    releaseNote.LastModifiedDateTime = softwareReleaseNotes.LastModifiedDateTime;
                    releaseNote.LastModifiedUserName = softwareReleaseNotes.LastModifiedUserName;
                    releaseNote.CreatedDateTime      = softwareReleaseNotes.CreatedDateTime;
                    _dbEntities.SaveChanges();
                }
                int         LocaleID    = Convert.ToInt32(softwareReleaseNotes.Language);
                DialectText dialectText = _dbEntities.DialectTexts.Where(a => a.MicrosoftLocaleID == LocaleID && a.TextID == releaseNote.ReleaseNoteTextID).FirstOrDefault();
                if (dialectText != null)
                {
                    dialectText.LanguageText = softwareReleaseNotes.ReleaseNote;
                    _dbEntities.SaveChanges();
                }

                return(Request.CreateResponse(HttpStatusCode.OK, releaseNote.ReleaseID));
            }
            catch (Exception ex)
            {
                response.Content    = new StringContent("[]");
                response.StatusCode = HttpStatusCode.InternalServerError;
            }
            return(response);
        }
Example #7
0
 public ReleaseNote GetReleaseNoteRecord(int RecordID, string UserSNo)
 {
     try
     {
         ReleaseNote    ReleaseNote = new ReleaseNote();
         SqlParameter[] Parameters  = { new SqlParameter("@SNo", Convert.ToInt32(RecordID)) };
         DataSet        ds          = SqlHelper.ExecuteDataset(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "SpGetReleaseNoteRecord", Parameters);
         if (ds.Tables[0].Rows.Count > 0)
         {
             ReleaseNote.SNo         = Convert.ToInt32(ds.Tables[0].Rows[0]["SNo"]);
             ReleaseNote.Author      = Convert.ToString(ds.Tables[0].Rows[0]["Author"]).ToUpper();
             ReleaseNote.Major       = Convert.ToInt32(ds.Tables[0].Rows[0]["Major"]);
             ReleaseNote.Minor       = Convert.ToInt32(ds.Tables[0].Rows[0]["Minor"]);
             ReleaseNote.Build       = Convert.ToInt32(ds.Tables[0].Rows[0]["Build"]);
             ReleaseNote.Version     = Convert.ToString(ds.Tables[0].Rows[0]["Version"]);
             ReleaseNote.ReleaseDate = Convert.ToDateTime(ds.Tables[0].Rows[0]["ReleaseDate"]).ToString("dd-MMM-yyyy");
             ReleaseNote.Description = Convert.ToString(ds.Tables[0].Rows[0]["Description"]).ToUpper();
         }
         return(ReleaseNote);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #8
0
 public ReleaseNoteObject(ReleaseNote releaseNote)
 {
     this.Id       = releaseNote.Id;
     this.IsActive = releaseNote.IsActive;
     this.Number   = releaseNote.Number;
     this.Date     = releaseNote.Date;
     this.Shipped  = releaseNote.Shipped;
 }
 public void CreateRecord(ReleaseNote releaseNote)
 {
     using (var db = new ReleaseNotesContext())
     {
         db.ReleaseNotes.Add(releaseNote);
         db.SaveChanges();
     }
 }
Example #10
0
 public bool DeleteReleaseNote(ReleaseNote entity)
 {
     if (entity == null)
     {
         return(false);
     }
     _unitOfWork.ReleaseNoteRepository.Delete(entity);
     _unitOfWork.Save();
     return(true);
 }
        public async Task <IActionResult> Create([Bind("Id,Data")] ReleaseNote releaseNote)
        {
            if (ModelState.IsValid)
            {
                _context.Add(releaseNote);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(releaseNote));
        }
        private PartialViewResult ViewDeleteReleaseNote(ReleaseNote releaseNote, ConfirmDialogFormViewModel viewModel)
        {
            var canDelete      = !releaseNote.HasDependentObjects();
            var confirmMessage = canDelete
                ? "Are you sure you want to delete this Release Note?"
                : ConfirmDialogFormViewData.GetStandardCannotDeleteMessage("Release Note");

            var viewData = new ConfirmDialogFormViewData(confirmMessage, canDelete);

            return(RazorPartialView <ConfirmDialogForm, ConfirmDialogFormViewData, ConfirmDialogFormViewModel>(viewData, viewModel));
        }
        public void DeleteReleaseNote(ReleaseNote releaseNote)
        {
            using (var db = new ReleaseNotesContext())
            {
                db.Entry(new ReleaseNote {
                    Version = releaseNote.Version
                }).State = EntityState.Deleted;

                db.SaveChanges();
            }
        }
        public ActionResult New(EditReleaseNoteRtfContentViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(ViewEdit(viewModel));
            }
            var releaseNote = new ReleaseNote(String.Empty, CurrentPerson.PersonID, default(DateTime));

            viewModel.UpdateModel(releaseNote, CurrentFirmaSession);
            HttpRequestStorage.DatabaseEntities.ReleaseNotes.Add(releaseNote);
            return(new ModalDialogFormJsonResult());
        }
Example #15
0
        public static MvcHtmlString CTSVersion(this HtmlHelper htmlHelper)
        {
            ReleaseNoteService releaseNoteService = new ReleaseNoteService();
            ReleaseNote        rnote = releaseNoteService.GetAllReleaseNote().OrderBy(o => o.ReleaseNoteID).LastOrDefault();

            if (rnote != null)
            {
                string buildNumber = string.Format("<p>Build: {2} - {0}, Released on: {1:dd-MM-yyyy} click here to read <a href='/ReleaseNotes/'>the release notes</a></p>", rnote.BuildNumber, rnote.Date, rnote.ReleaseName);
                return(new MvcHtmlString(buildNumber));
            }
            return(new MvcHtmlString(string.Empty));
        }
        public static void Show(
            string appName,
            Assembly targetAssembly,
            ReleaseNote releaseNote)
        {
            instance = new UpdateCheckerView();

            instance.Owner = WPFHelper.MainWindow;
            instance.ViewModel.AppName.Value        = appName;
            instance.ViewModel.TargetAssembly.Value = targetAssembly;
            instance.ViewModel.Model.Value          = releaseNote;

            instance.Show();
        }
Example #17
0
        private ReleaseNote ImportReleaseNote(string tempDir, ReleaseNoteObject releaseNoteObj)
        {
            if (releaseNoteObj == null)
            {
                return(null);
            }

            bool        isNew       = false;
            ReleaseNote releaseNote = importRepo.ReleaseNoteRepo.Get(releaseNoteObj.Id);

            if (releaseNote == null)
            {
                releaseNote = new ReleaseNote();
                isNew       = true;
            }

            releaseNote.Id       = releaseNoteObj.Id;
            releaseNote.IsActive = releaseNoteObj.IsActive;
            releaseNote.Number   = releaseNoteObj.Number;
            releaseNote.Shipped  = releaseNoteObj.Shipped;
            releaseNote.Date     = releaseNoteObj.Date;

            if (releaseNoteObj.Attachments != null)
            {
                if (!Directory.Exists(Directories.TargetPath))
                {
                    Directory.CreateDirectory(Directories.TargetPath);
                    DirectoryInfo directoryInfo = new DirectoryInfo(Directories.TargetPath);
                    directoryInfo.Attributes |= FileAttributes.Hidden;
                }
                releaseNote.Attachments = new List <Prizm.Domain.Entity.File>();
                foreach (var fileObject in releaseNoteObj.Attachments)
                {
                    Prizm.Domain.Entity.File f = ImportFile(fileObject, releaseNote.Id);
                    CopyAttachment(tempDir, f);
                }
            }

            if (isNew)
            {
                importRepo.ReleaseNoteRepo.Save(releaseNote);
            }
            else
            {
                importRepo.ReleaseNoteRepo.SaveOrUpdate(releaseNote);
            }

            return(releaseNote);
        }
Example #18
0
 private void PlayNote(string note, int duration)
 {
     lock (amMelody) {
         foreach (BufferProvider bp in amMelody.BufferProviders)
         {
             if (bp.Frequency == 0)
             {
                 ReleaseNote rn = new ReleaseNote(note, duration);
                 bp.Note = note;
                 bp.Tag  = rn;
                 break;
             }
         }
     }
 }
Example #19
0
        public HttpResponseMessage AddSoftwareReleaseNotes(SoftwareReleaseNote softwareReleaseNotes)
        {
            HttpResponseMessage response = Request.CreateResponse();

            try
            {
                TextReference textReference = new TextReference();
                textReference.TextID = _dbEntities.TextReferences.Max(m => m.TextID) + 1;
                _dbEntities.TextReferences.Add(textReference);
                _dbEntities.SaveChanges();
                ReleaseNote releaseNoteTemp = _dbEntities.ReleaseNotes.Where(a => a.ReleaseID == softwareReleaseNotes.SoftwareReleaseId &&
                                                                             a.ReleaseNoteTypeCode == softwareReleaseNotes.SoftwareReleaseNoteTypeCode &&
                                                                             a.ReleaseNoteTextID == textReference.TextID
                                                                             ).FirstOrDefault();
                if (releaseNoteTemp == null)
                {
                    ReleaseNote releaseNote = new ReleaseNote()
                    {
                        ReleaseID            = softwareReleaseNotes.SoftwareReleaseId,
                        ReleaseNoteTypeCode  = softwareReleaseNotes.SoftwareReleaseNoteTypeCode,
                        ReleaseNoteTextID    = textReference.TextID,
                        LastModifiedUserName = softwareReleaseNotes.LastModifiedUserName,
                        CreatedDateTime      = softwareReleaseNotes.CreatedDateTime,
                        LastModifiedDateTime = softwareReleaseNotes.LastModifiedDateTime
                    };
                    _dbEntities.ReleaseNotes.Add(releaseNote);
                    _dbEntities.SaveChanges();
                    DialectText dialectText = new DialectText()
                    {
                        MicrosoftLocaleID           = Convert.ToInt32(softwareReleaseNotes.Language),
                        TextID                      = textReference.TextID,
                        LanguageText                = softwareReleaseNotes.ReleaseNote,
                        ModifiedbyDatabaseLoginName = softwareReleaseNotes.LastModifiedUserName,
                        ModificationDateTime        = softwareReleaseNotes.LastModifiedDateTime
                    };
                    _dbEntities.DialectTexts.Add(dialectText);
                    _dbEntities.SaveChanges();
                    return(Request.CreateResponse(HttpStatusCode.OK, softwareReleaseNotes.SoftwareReleaseId));
                }
                return(Request.CreateResponse(HttpStatusCode.Ambiguous, softwareReleaseNotes.SoftwareReleaseId));
            }
            catch (Exception ex)
            {
                response.Content    = new StringContent("[]");
                response.StatusCode = HttpStatusCode.InternalServerError;
            }
            return(response);
        }
        public void UpdateReleaseNote(ReleaseNote releaseNote)
        {
            using (var db = new ReleaseNotesContext())
            {
                var record = db.ReleaseNotes.SingleOrDefault(x => x.Version == releaseNote.Version);

                if (record != null)
                {
                    record.PreRelease   = releaseNote.PreRelease;
                    record.DateReleased = releaseNote.DateReleased;
                    record.PatchNote    = releaseNote.PatchNote;

                    db.SaveChanges();
                }
            }
        }
Example #21
0
        public ReleaseNoteObject(ReleaseNote releaseNote)
        {
            this.Id       = releaseNote.Id;
            this.IsActive = releaseNote.IsActive;
            this.Number   = releaseNote.Number;
            this.Date     = releaseNote.Date;
            this.Shipped  = releaseNote.Shipped;

            if (releaseNote.Attachments != null)
            {
                this.Attachments = new List <FileObject>();
                foreach (var attach in releaseNote.Attachments)
                {
                    this.Attachments.Add(new FileObject(attach));
                }
            }
        }
        /// <summary>Fills the release notes.</summary>
        internal void FillReleaseNotes()
        {
            ReleaseNotes.Clear();

            var releaseNotesXmlContent = Resources.ReleaseNotes;
            var xmlDocument            = new XmlDocument();

            xmlDocument.LoadXml(releaseNotesXmlContent);

            foreach (XmlElement noteNode in xmlDocument.DocumentElement.GetElementsByTagName("Note"))
            {
                var note = new ReleaseNote {
                    Version = noteNode.GetAttribute("Version"), Description = CleanWhiteSpace(noteNode.FirstChild.InnerText)
                };
                ReleaseNotes.Add(note);
            }
        }
        public async Task <IActionResult> DeleteReleaseNote([FromRoute] string keyName)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            ReleaseNote rDelete = await _context.ReleaseNote.SingleOrDefaultAsync(x => x.KeyName == keyName);


            if (rDelete != null)
            {
                _context.ReleaseNote.Remove(rDelete);
                await _context.SaveChangesAsync();
            }

            return(Ok());
        }
        public async Task <IActionResult> PutReleaseNote(ReleaseNoteParms rnp)
        {
            ReleaseNote existingReleaseNote = await _context.ReleaseNote.Where(x => x.Id == rnp.ReleaseNoteId).Include("CountryCodeReleaseNote").Include("EnvironmentReleaseNote").SingleAsync();

            _context.CountryCodeReleaseNote.RemoveRange(existingReleaseNote.CountryCodeReleaseNote);
            _context.EnvironmentReleaseNote.RemoveRange(existingReleaseNote.EnvironmentReleaseNote);

            foreach (int id in rnp.CountryCodeId)
            {
                existingReleaseNote.CountryCodeReleaseNote.Add(new CountryCodeReleaseNote {
                    CountryCodeId = id
                });
            }

            foreach (int id in rnp.EnvironmentId)
            {
                existingReleaseNote.EnvironmentReleaseNote.Add(new EnvironmentReleaseNote {
                    EnvironmentId = id
                });
            }

            existingReleaseNote.KeyName   = rnp.KeyName;
            existingReleaseNote.Value     = rnp.Value;
            existingReleaseNote.CleTypeId = rnp.CleTypeId; // The same key cannot occur in tech and func ?? yes !! maar waarschuwing !!!
            existingReleaseNote.CommentId = rnp.CommentId;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ReleaseNoteExists(rnp.ReleaseNoteId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Ok(existingReleaseNote));
        }
Example #25
0
        private void InitAudioService()
        {
            amMelody = new AudioMixerNAudio();
            amBeat   = new AudioMixerNAudio();

            for (int i = 1; i <= 6; i++)   // note polyphony
            // Multiple oscillators, panning and automation (SignalMixer)
            //amMelody.BufferProviders.Add(CreateInstrument2());

            {
                amMelody.BufferProviders.Add(CreateInstrument4());
            }
            amMelody.Volume = 0.1;

            amBeat.BufferProviders.Add(CreateInstrument3());
            amBeat.Volume = 0.1;

            Thread release = new Thread(() => {
                while (true)
                {
                    Thread.Sleep(5);

                    lock (amMelody) {
                        foreach (BufferProvider bp in amMelody.BufferProviders)
                        {
                            if (bp.Frequency != 0)
                            {
                                ReleaseNote rn = (ReleaseNote)bp.Tag;
                                if (DateTime.Now.Ticks >= rn.Tick)
                                {
                                    bp.Frequency = 0;
                                    break;
                                }
                            }
                        }
                    }
                }
            })
            {
                IsBackground = true
            };

            release.Start();
        }
Example #26
0
        public KeyValuePair <string, List <ReleaseNote> > GetReleaseNoteRecords(string recordID, int page, int pageSize, string whereCondition, string sort)
        {
            try
            {
                ReleaseNote    ReleaseNote = new ReleaseNote();
                SqlParameter[] Parameters  =
                {
                    new SqlParameter("@SNo", recordID),
                };
                DataSet ds = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "SpGetReleaseNoteExcelRecord", Parameters);

                if (ds.Tables[0].Rows.Count != 0)
                {
                    var ReleaseNoteList = ds.Tables[0].AsEnumerable().Select(e => new ReleaseNote
                    {
                        SNo               = Convert.ToInt32(e["SNo"]),
                        Author            = Convert.ToString(e["Author"]).ToUpper(),
                        Major             = Convert.ToInt32(e["Major"]),
                        Minor             = Convert.ToInt32(e["Minor"]),
                        Build             = Convert.ToInt32(e["Build"]),
                        Version           = Convert.ToString(e["Version"]),
                        ReleaseDate       = Convert.ToDateTime(e["ReleaseDate"]).ToString("dd-MMM-yyyy"),
                        Description       = Convert.ToString(e["Description"]).ToUpper(),
                        Module            = Convert.ToString(e["Module"]).ToUpper().Trim(),
                        ModuleDescription = Convert.ToString(e["ModuleDescription"]).ToUpper(),
                        TFSId             = Convert.ToInt32(e["TFSId"]),
                        ModuleOwner       = Convert.ToString(e["ModuleOwner"]).ToUpper(),
                    });
                    return(new KeyValuePair <string, List <ReleaseNote> >(ds.Tables[0].Rows[0][0].ToString(), ReleaseNoteList.AsQueryable().ToList()));
                }
                var abc = ds.Tables[0].AsEnumerable().Select(e => new ReleaseNote
                {
                    SNo = Convert.ToInt32(e["SNo"])
                });
                return(new KeyValuePair <string, List <ReleaseNote> >(ds.Tables[0].ToString(), abc.AsQueryable().ToList()));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        // adds the release to the database
        private void AddReleaseNote(Release release)
        {
            string version = release.TagName.TrimStart('v');

            ReleaseNote releaseNote = new ReleaseNote
            {
                DateReleased = release.PublishedAt.Value.DateTime,
                PatchNote    = ModifyReleaseBody(release.Body),
                PreRelease   = release.Prerelease,
                Version      = version,
            };

            if (Database.ReleaseNotesDb().ReleaseNotes.IsExistingReleaseNote(releaseNote))
            {
                Database.ReleaseNotesDb().ReleaseNotes.UpdateReleaseNote(releaseNote);
            }
            else
            {
                Database.ReleaseNotesDb().ReleaseNotes.CreateRecord(releaseNote);
            }
        }
        private void CreateHtmlFile(ReleaseNote releaseNote, string path)
        {
            XDocument result = new XDocument(
                new XElement("table", new XAttribute("border", 1),
                             new XElement("thead",
                                          new XElement("tr",
                                                       new XElement("td", "ar:Key"),
                                                       new XElement("td", "ItemId"),
                                                       new XElement("td", "Subject"),
                                                       new XElement("td", "Text"),
                                                       new XElement("td", "Release"),
                                                       new XElement("td", "Category"),
                                                       new XElement("td", "FixedAt"),
                                                       new XElement("td", "TicketId"),
                                                       new XElement("td", "Priority"),
                                                       new XElement("td", "CustomerId"),
                                                       new XElement("td", "Classification"))),
                             new XElement("tbody",
                                          new XElement("tr",
                                                       new XElement("td", releaseNote.Key),
                                                       new XElement("td", releaseNote.ItemId),
                                                       new XElement("td", releaseNote.Subject),
                                                       new XElement("td", releaseNote.Text),
                                                       new XElement("td", releaseNote.Release),
                                                       new XElement("td", releaseNote.Category),
                                                       new XElement("td", releaseNote.FixedAt),
                                                       new XElement("td", releaseNote.TicketId),
                                                       new XElement("td", releaseNote.Priority),
                                                       new XElement("td", releaseNote.CustomerId),
                                                       new XElement("td", releaseNote.Classification))
                                          )
                             )
                );

            path  = path.Replace(".xml", "");
            path += "_" + releaseNote.CustomerId + ".html";
            result.Save(path);
        }
        public async Task <IActionResult> PostReleaseNote(ReleaseNoteParms rnp)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            ReleaseNote releaseNote = new ReleaseNote();

            var rn = await _context.ReleaseNote.Where(x => x.KeyName == rnp.KeyName && x.ReleaseId == rnp.ReleaseId && rnp.CleTypeId == rnp.CleTypeId).Include("CountryCodeReleaseNote").Include("EnvironmentReleaseNote").SingleOrDefaultAsync();

            if (rn == null)
            {
                releaseNote = new ReleaseNote {
                    KeyName = rnp.KeyName, Value = rnp.Value, CleTypeId = rnp.CleTypeId, ReleaseId = rnp.ReleaseId, CommentId = rnp.CommentId
                };
                foreach (int id in rnp.CountryCodeId)
                {
                    releaseNote.CountryCodeReleaseNote.Add(new CountryCodeReleaseNote {
                        CountryCodeId = id
                    });
                }

                foreach (int id in rnp.EnvironmentId)
                {
                    releaseNote.EnvironmentReleaseNote.Add(new EnvironmentReleaseNote {
                        EnvironmentId = id
                    });
                }

                _context.ReleaseNote.Add(releaseNote);
            }

            await _context.SaveChangesAsync();

            return(Ok());
            //   return CreatedAtAction("GetReleaseNote", new { id = rn.Id }, rn);
        }
Example #30
0
 public bool EditReleaseNote(ReleaseNote entity)
 {
     _unitOfWork.ReleaseNoteRepository.Edit(entity);
     _unitOfWork.Save();
     return(true);
 }
Example #31
0
        private List <ReleaseNote> CreateReleaseNotes(ReleaseNotesGroup deserializedElements)
        {
            List <ReleaseNote> final = new List <ReleaseNote>();

            foreach (var note in deserializedElements.AllElements)
            {
                ReleaseNote releaseNote = new ReleaseNote();

                foreach (XmlAttribute attribute in note.Attributes)  // "Name" and "Value"
                {
                    if (attribute.Name == "ar:Key")
                    {
                        releaseNote.Key = attribute.Value;
                    }
                    else if (attribute.Name == "ItemId")
                    {
                        releaseNote.ItemId = attribute.Value;
                    }
                    else if (attribute.Name == "Subject")
                    {
                        releaseNote.Subject = attribute.Value;
                    }
                    else if (attribute.Name == "Text")
                    {
                        releaseNote.Text = attribute.Value;
                    }
                    else if (attribute.Name == "Release")
                    {
                        releaseNote.Release = attribute.Value;
                    }
                    else if (attribute.Name == "Category")
                    {
                        releaseNote.Category = attribute.Value;
                    }
                    else if (attribute.Name == "FixedAt")
                    {
                        releaseNote.FixedAt = attribute.Value;
                    }
                    else if (attribute.Name == "TicketId")
                    {
                        releaseNote.TicketId = attribute.Value;
                    }
                    else if (attribute.Name == "Priority")
                    {
                        releaseNote.Priority = attribute.Value;
                    }
                    else if (attribute.Name == "CustomerId")
                    {
                        releaseNote.CustomerId = attribute.Value;
                    }
                    else if (attribute.Name == "Classification")
                    {
                        releaseNote.Classification = attribute.Value;
                    }
                }

                final.Add(releaseNote);
            }

            return(final);
        }
 public bool EditReleaseNote( ReleaseNote entity)
 {
     _unitOfWork. ReleaseNoteRepository.Edit(entity);
     _unitOfWork.Save();
     return true;
 }