예제 #1
0
파일: Coverage.cs 프로젝트: ssjda-ddi/EDO
        public void CheckTopics(List <string> labels)
        {
            //use it to read from DDI(process to put a check in the checkbox)
            List <string> otherLabels = new List <string>();

            foreach (string label in labels)
            {
                CheckOption option = CheckOption.FindByLabel <CheckOption>(Topics, label);
                if (option != null)
                {
                    option.IsChecked = true;
                }
                else
                {
                    otherLabels.Add(label);
                }
            }

            if (otherLabels.Count > 0)
            {
                //If labels that do not match exists, take only the first one
                CheckOption option = CheckOption.FindMemoOption(Topics);
                option.IsChecked = true;
                option.Memo      = otherLabels.First();
            }
        }
예제 #2
0
파일: Coverage.cs 프로젝트: ssjda-ddi/EDO
 public void CheckAreas(List <string> labels)
 {
     foreach (string label in labels)
     {
         CheckOption option = CheckOption.FindByLabel <CheckOption>(Areas, label);
         if (option != null)
         {
             option.IsChecked = true;
         }
     }
 }
예제 #3
0
 public static void Merge(List <CheckOption> fromOptions, List <CheckOption> toOptions)
 {
     foreach (CheckOption toOption in toOptions)
     {
         CheckOption fromOption = Option.FindByLabel <CheckOption>(fromOptions, toOption.Label);
         if (fromOption != null)
         {
             toOption.IsChecked = fromOption.IsChecked;
             toOption.Memo      = fromOption.Memo;
         }
     }
 }
예제 #4
0
파일: Coverage.cs 프로젝트: ssjda-ddi/EDO
        public static Coverage CreateDefault()
        {
            Coverage coverage = new Coverage();

            foreach (Option option in Options.CoverageTopics)
            {
                CheckOption checkOption = new CheckOption(option.Code, option.Label);
                if (option.Code == Options.COVERAGE_TOPIC_OTHER_CODE)
                {
                    checkOption.HasMemo = true;
                }
                coverage.Topics.Add(checkOption);
            }
            foreach (Option option in Options.CoverageAreas)
            {
                CheckOption checkOption = new CheckOption(option.Code, option.Label);
                coverage.Areas.Add(checkOption);
            }
            return(coverage);
        }
예제 #5
0
파일: Coverage.cs 프로젝트: ssjda-ddi/EDO
 public string GetGeographicId(CheckOption areaOption)
 {
     return(IDUtils.ToId(areaOption.Code, GeographicIdSuffix));
 }
예제 #6
0
 public CheckOptionVM(BaseVM parent, CheckOption checkOption)
     : base(parent)
 {
     this.checkOption = checkOption;
 }
예제 #7
0
 public string GetGeographicStructureId(CheckOption areaOption)
 {
     return IDUtils.ToId(areaOption.Code, GeographicStructureIdSuffix);
 }
예제 #8
0
 public static Coverage CreateDefault()
 {
     Coverage coverage = new Coverage();
     foreach (Option option in Options.CoverageTopics)
     {
         CheckOption checkOption = new CheckOption(option.Code, option.Label);
         if (option.Code == Options.COVERAGE_TOPIC_OTHER_CODE)
         {
             checkOption.HasMemo = true;
         }
         coverage.Topics.Add(checkOption);
     }
     foreach (Option option in Options.CoverageAreas)
     {
         CheckOption checkOption = new CheckOption(option.Code, option.Label);
         coverage.Areas.Add(checkOption);
     }
     return coverage;
 }