コード例 #1
0
ファイル: DlgLayerCatalog.cs プロジェクト: zfc317/mscd
 private void btn_Add_Click(object sender, System.EventArgs e)
 {
     var checkItems = listBox_Unclassified.CheckedItems;
     var typeId = Convert.ToInt32(lookUpEdit_LayerType.EditValue);
     foreach (LayerInfo checkItem in checkItems)
     {
         if(checkItem!=null)
         {
             var layerCatalog = new Model.LayerCatalog { typeId = typeId, layerName = checkItem.LayerName, layerCaption = checkItem.LayerCaption };
             var layerCatalogId = _bll.Add(layerCatalog);
             layerCatalog.id = layerCatalogId;
             if (layerCatalogId > 0)
             {
                 (listBox_Classified.DataSource as List<Model.LayerCatalog>).Add(layerCatalog);
                 (listBox_Unclassified.DataSource as List<LayerInfo>).Remove(checkItem);
             }
         }
     }
     listBox_Classified.UnCheckAll();
     listBox_Unclassified.UnCheckAll();
 }
コード例 #2
0
ファイル: DlgLayerCatalog.cs プロジェクト: zfc317/mscd
        private void btn_Add_Click(object sender, System.EventArgs e)
        {
            var checkItems = listBox_Unclassified.CheckedItems;
            var typeId     = Convert.ToInt32(lookUpEdit_LayerType.EditValue);

            foreach (LayerInfo checkItem in checkItems)
            {
                if (checkItem != null)
                {
                    var layerCatalog = new Model.LayerCatalog {
                        typeId = typeId, layerName = checkItem.LayerName, layerCaption = checkItem.LayerCaption
                    };
                    var layerCatalogId = _bll.Add(layerCatalog);
                    layerCatalog.id = layerCatalogId;
                    if (layerCatalogId > 0)
                    {
                        (listBox_Classified.DataSource as List <Model.LayerCatalog>).Add(layerCatalog);
                        (listBox_Unclassified.DataSource as List <LayerInfo>).Remove(checkItem);
                    }
                }
            }
            listBox_Classified.UnCheckAll();
            listBox_Unclassified.UnCheckAll();
        }