public JsonResult AddLRSRecord(SegmentModel model)
        {
            try
            {
                XMLService xml = new XMLService(_rtpProjectRepository);
                if (!String.IsNullOrEmpty(model.LRSRecordRaw))
                {
                    string data = xml.GenerateXml(xml.GetScheme((int)SchemeName.LRSProjects), new LRSRecord() { Columns = model.LRSRecordRaw.ToDictionary(',') });
                    model.LRSxml = data;

                    _rtpProjectRepository.AddLRSRecord(model);
                }
                else return Json(new { message = "Changes were not found. Refresh your page and try again." });

            }
            catch (Exception ex)
            {
                return Json(new { message = "Changes could not be stored. An error has been logged." });
            }
            return Json(new { message = "Segment successfully updated." });
        }
        public JsonResult UpdateSegment(SegmentModel model)
        {
            try
            {
                XMLService xml = new XMLService(_surveyRepository);
                if (!String.IsNullOrEmpty(model.LRSRecord))
                {

                    string data = xml.GenerateXml(xml.GetScheme((int)SchemeName.LRSProjects), new LRSRecord() { Columns = model.LRSRecord.ToDictionary(',') });

                    model.LRSxml = data;
                }
                else model.LRSxml = xml.GenerateXml(null, null);

                _surveyRepository.UpdateSegment(model);
            }
            catch (Exception ex)
            {
                return Json(new { message = "Changes could not be stored. An error has been logged." });
            }
            return Json(new { message = "Segment successfully updated." });
        }