private InstrumentBaseViewModel getInstBaseVM(string typeStr)
        {
            InstrumentBaseViewModel instBaseVM;

            Uri instIUri  = new Uri(PrototypeUri_.LocalPath + "prototype_" + typeStr + ".xml");
            Uri resultUri = new Uri(PrototypeUri_.LocalPath + "00000000_prototype_" + typeStr + ".xml");

            if (typeStr == "stepDownKI" || typeStr == "multiNameCDS")
            {
                InstUriInfo   instUriInfo   = new InstUriInfo("", "", instIUri);
                ResultUriInfo resultUriInfo = new ResultUriInfo("", "", resultUri);

                instBaseVM = new StandardInstBaseViewModel(instUriInfo);
                instBaseVM.ReferenceDate_ = PositionSingletonManger.referenceDate();
                instBaseVM.ResultUri_     = resultUriInfo;

                return(instBaseVM);
            }
            else
            {
                InstUriInfo instUriInfo = new InstUriInfo("", "", new Uri(""));
                instBaseVM = new NoExistInstrumentBaseViewModel(instUriInfo);
                return(instBaseVM);
            }
        }
Ejemplo n.º 2
0
        private void hirachyLoop(FpmlSerializedCSharp.InstHirachyInfo serial_Hirachy,
                                 HirachyInstrumentVM roop_ExploreHirachyInstWrapper)
        {
            foreach (var item in serial_Hirachy.InstHirachyInfo_)
            {
                string itemCode = item.Code_.ValueStr;
                string itemType = item.Type_.ValueStr;

                InstUriInfo instUri = bookInfoVM_.InstUri(item);
                //ResultUriInfo resultUri = bookInfoVM_.resultUri(item);

                //FileInfo fileInfo = new FileInfo(itemCode + "_" + itemType + ".xml");

                InstrumentBaseViewModel instBaseVM = InstrumentBaseViewModel.CreateInstBaseVM(instUri);

                //ExploreHirachyInstrumentVMWrapper hirachyInstVMWrapper
                //    = new ExploreHirachyInstrumentVMWrapper(itemCode, itemType, instBaseVM);

                //ExploreHirachyVMWrapper hirachyInstVMWrapper = ExploreHirachyVMWrapper.CreateExploreHirachyWrapper(instUri, resultUri, instBaseVM);
                ExploreHirachyVMWrapper hirachyInstVMWrapper = ExploreHirachyVMWrapper.CreateExploreHirachyWrapper(instBaseVM);

                this.hirachyLoop(item, hirachyInstVMWrapper);

                roop_ExploreHirachyInstWrapper.addHirachInstrumentVM(hirachyInstVMWrapper);
            }
        }
Ejemplo n.º 3
0
        public void loadDBPosition(string position)
        {
            this.instPositionWrapperVMList_ = new ObservableCollection <InstPositionWrapperVM>();

            RiskMonitor.PositionSingletonManger.setReferenceDate(this.ReferenceDate_);

            //db 만들어서 관리 해야함?  ㅇㅇ 그래야함 ㅡ.ㅡㅋ
            instPositionWrapperVMList_.Clear();

            DataBaseManager loader = new DataBaseManager();

            loader.PositionHostInfo_ = new PositionHostInfo(position);

            List <InstPositionInfo> instDataList = loader.loadPositionData();

            foreach (InstPositionInfo item in instDataList)
            {
                InstUriInfo instUri = PositionSingletonManger.CreateInstUriInfo(item.InstCode_, item.InstType_);
                //ResultUriInfo resultUri = CreateResultUriInfo(item.InstCode_, item.InstType_);
                //InstrumentBaseViewModel instBaseVM = InstrumentBaseViewModel.CreateInstBaseVM(instUri, resultUri);
                InstrumentBaseViewModel instBaseVM = InstrumentBaseViewModel.CreateInstBaseVM(instUri);
                instBaseVM.ReferenceDate_ = PositionSingletonManger.referenceDate();

                InstPositionWrapperVM viewModel = new InstPositionWrapperVM(item, instBaseVM);
                instPositionWrapperVMList_.Add(viewModel);
            }
        }
        private InstrumentBaseViewModel getInstBaseVM(string typeStr)
        { 
            InstrumentBaseViewModel instBaseVM;

            Uri instIUri = new Uri(PrototypeUri_.LocalPath + "prototype_" + typeStr + ".xml");
            Uri resultUri = new Uri(PrototypeUri_.LocalPath + "00000000_prototype_" + typeStr + ".xml");

            if (typeStr == "stepDownKI" || typeStr == "multiNameCDS")
            {
                InstUriInfo instUriInfo = new InstUriInfo("", "", instIUri);
                ResultUriInfo resultUriInfo = new ResultUriInfo("", "", resultUri);

                instBaseVM = new StandardInstBaseViewModel(instUriInfo);
                instBaseVM.ReferenceDate_ = PositionSingletonManger.referenceDate();
                instBaseVM.ResultUri_ = resultUriInfo;

                return instBaseVM;
            }
            else
            {
                InstUriInfo instUriInfo = new InstUriInfo("", "", new Uri(""));
                instBaseVM = new NoExistInstrumentBaseViewModel(instUriInfo);
                return instBaseVM;
            }
        }
Ejemplo n.º 5
0
        private void loadBookInfo()
        {
            this.batchInstVMWrapperList_ = new ObservableCollection <BatchInstrumentVMWrapper>();

            FpmlSerializedCSharp.BookInformation serial_bookInfo = new FpmlSerializedCSharp.BookInformation(this.bookInfoVM_.BookInfoXml_);

            this.PathURLInfo_ = this.bookInfoVM_.PathURLInfo_;

            //serial_bookInfo.PathInfo_.Url_.ValueStr;

            DirectoryInfo directoryInfo = new DirectoryInfo(this.PathURLInfo_);

            foreach (var item in serial_bookInfo.InstrumentList_.InstHirachyInfo_)
            {
                string itemCode = item.Code_.ValueStr;
                string itemType = item.Type_.ValueStr;

                InstUriInfo instUri = bookInfoVM_.InstUri(item);
                //ResultUriInfo resultUri = bookInfoVM_.resultUri(item);

                FileInfo fileInfo = new FileInfo(directoryInfo.FullName + itemCode + "_" + itemType + ".xml");

                InstrumentBaseViewModel instBaseVM = InstrumentBaseViewModel.CreateInstBaseVM(instUri);

                //ExploreHirachyInstrumentVMWrapper hirachyInstVMWrapper
                //    = new ExploreHirachyInstrumentVMWrapper(itemCode, itemType, instBaseVM);

                BatchInstrumentVMWrapper batchInstVMWrapper = new BatchInstrumentVMWrapper(instBaseVM);

                batchInstVMWrapper.setFromSerial(item);

                this.batchInstVMWrapperList_.Add(batchInstVMWrapper);
            }
        }
Ejemplo n.º 6
0
 //public static InstrumentBaseViewModel CreateInstBaseVM(string itemCode, string itemType, MyURI instUri, MyURI resultURI)
 public static InstrumentBaseViewModel CreateInstBaseVM(InstUriInfo instUri)
 {
     if (!instUri.isExist())
     {
         return(new NoExistInstrumentBaseViewModel(instUri));
     }
     else
     {
         if (instUri.itemType_ == "Group")
         {
             return(new GroupBaseViewModel(instUri));
         }
         else
         {
             return(new StandardInstBaseViewModel(instUri));
         }
         //else if (itemType == "")
         //{
         //    //return new Cre(itemCode, itemType, fileInfo);
         //}
         //else
         //{
         //    throw new Exception();
         //}
     }
 }
        public static InstUriInfo CreateInstUriInfo(string itemCode, string itemType)
        {
            Uri uri = new Uri(PositionUri_.LocalPath + itemCode + "_" + itemType + ".xml");

            InstUriInfo instUri = new InstUriInfo(itemCode, itemType, uri);

            return(instUri);
        }
Ejemplo n.º 8
0
        public InstrumentBaseViewModel(InstUriInfo instUri)
        {
            this.InstUri_ = instUri;
            //this.ResultUri_ = resultUri;

            this.itemCode_ = this.InstUri_.itemCode_;
            this.itemType_ = this.InstUri_.itemType_;

            InstXml_       = new XmlDocument();
            ParaResultXml_ = new XmlDocument();
        }
Ejemplo n.º 9
0
        public InstUriInfo InstUri(FpmlSerializedCSharp.InstHirachyInfo serial_Class)
        {
            string itemCode = serial_Class.Code_.ValueStr;
            string itemType = serial_Class.Type_.ValueStr;

            Uri uri = new Uri(pathURLInfo_ + itemCode + "_" + itemType + ".xml");

            InstUriInfo instUri = new InstUriInfo(itemCode, itemType, uri);

            return(instUri);
        }
        public InstrumentBaseViewModel(InstUriInfo instUri) 
        {
            this.InstUri_ = instUri;
            //this.ResultUri_ = resultUri;

            this.itemCode_ = this.InstUri_.itemCode_;
            this.itemType_ = this.InstUri_.itemType_;

            InstXml_ = new XmlDocument();
            ParaResultXml_ = new XmlDocument();

        }
        public static InstUriInfo CreateInstUriInfo(FileInfo instFileInfo)
        {
            string fileName = instFileInfo.Name;
            string exeptExtensionfileName = fileName.Replace(".xml", "");

            string itemCode = exeptExtensionfileName.Substring(0, 11);
            string itemType = exeptExtensionfileName.Substring(13);

            Uri uri = new Uri(instFileInfo.FullName);

            InstUriInfo instUri = new InstUriInfo(itemCode, itemType, uri);

            return(instUri);
        }
Ejemplo n.º 12
0
        public void loadBookInfo()
        {
            //FileInfo file = bookInfoVM_.BookFile_;

            //XmlDocument xmlDoc = new XmlDocument();
            //xmlDoc.Load(file.FullName);

            XmlNode node = this.bookInfoVM_.BookInfoXml_;

            XmlNode bookInfoNode = node.SelectSingleNode("/bookInformation");

            FpmlSerializedCSharp.BookInformation serial_bookInfo = new FpmlSerializedCSharp.BookInformation(bookInfoNode);

            this.instHierarchyList_ = new ObservableCollection <ExploreHirachyVMWrapper>();

            //this.PathURLInfo_ = this.bookInfoVM_.PathURLInfo_;

            //DirectoryInfo directoryInfo = new DirectoryInfo(this.PathURLInfo_);

            foreach (var item in serial_bookInfo.InstrumentList_.InstHirachyInfo_)
            {
                //FileInfo fileInfo = new FileInfo(directoryInfo.FullName + itemCode + "_" + itemType + ".xml");

                InstUriInfo instUri = this.bookInfoVM_.InstUri(item);
                //ResultUriInfo resultUri = this.bookInfoVM_.resultUri(item);

                InstrumentBaseViewModel instBaseVM = InstrumentBaseViewModel.CreateInstBaseVM(instUri);

                //ExploreHirachyInstrumentVMWrapper hirachyInstVMWrapper
                //    = new ExploreHirachyInstrumentVMWrapper(itemCode, itemType, instBaseVM);

                //ExploreHirachyVMWrapper hirachyInstVMWrapper = ExploreHirachyVMWrapper.CreateExploreHirachyWrapper(instUri, resultUri, instBaseVM);
                ExploreHirachyVMWrapper hirachyInstVMWrapper = ExploreHirachyVMWrapper.CreateExploreHirachyWrapper(instBaseVM);

                hirachyInstVMWrapper.setFromSerial(item);

                this.hirachyLoop(item, hirachyInstVMWrapper);

                this.instHierarchyList_.Add(hirachyInstVMWrapper);
            }
        }
        public void loadDBResult(string referenceDate)
        {
            this.instResultMasterWrapperVMList = new ObservableCollection <InstResultMasterWrapperVM>();

            string positionName = PositionSingletonManger.positionName();

            this.Loader_ = new ResultMasterLoader();
            this.Loader_.PositionHostInfo_ = new PositionHostInfo(positionName);

            List <ResultMasterInfo> resultMasterInfoList = this.Loader_.loadResultData();



            foreach (ResultMasterInfo item in resultMasterInfoList)
            {
                InstUriInfo             instUri    = PositionSingletonManger.CreateInstUriInfo(item.InstCode_, item.InstType_);
                InstrumentBaseViewModel instBaseVM = InstrumentBaseViewModel.CreateInstBaseVM(instUri);

                InstResultMasterWrapperVM viewModel = new InstResultMasterWrapperVM(instBaseVM, item);
                this.instResultMasterWrapperVMList.Add(viewModel);
            }
        }
Ejemplo n.º 14
0
 public GroupBaseViewModel(InstUriInfo instUri)
     : base(instUri)
 {
 }
Ejemplo n.º 15
0
 public NoExistInstrumentBaseViewModel(InstUriInfo instUri)
     : base(instUri)
 {
 }
 public StandardInstBaseViewModel(InstUriInfo instUri)
     : base(instUri)
 {
     this.view_ = new StandardInstBaseView();
     //this.view_.DataContext = this;
 }
        public static InstUriInfo CreateInstUriInfo(string itemCode, string itemType)
        {
            Uri uri = new Uri(PositionUri_.LocalPath + itemCode + "_" + itemType + ".xml");

            InstUriInfo instUri = new InstUriInfo(itemCode, itemType, uri);

            return instUri;
        }
        public static InstUriInfo CreateInstUriInfo(FileInfo instFileInfo)
        {
            string fileName = instFileInfo.Name;
            string exeptExtensionfileName = fileName.Replace(".xml", "");

            string itemCode = exeptExtensionfileName.Substring(0, 11);
            string itemType = exeptExtensionfileName.Substring(13);

            Uri uri = new Uri(instFileInfo.FullName);

            InstUriInfo instUri = new InstUriInfo(itemCode, itemType, uri);

            return instUri;
        }
        public InstUriInfo InstUri(FpmlSerializedCSharp.InstHirachyInfo serial_Class)
        {
            string itemCode = serial_Class.Code_.ValueStr;
            string itemType = serial_Class.Type_.ValueStr;

            Uri uri = new Uri(pathURLInfo_ + itemCode + "_" + itemType + ".xml");

            InstUriInfo instUri = new InstUriInfo(itemCode, itemType, uri);

            return instUri;
        }
 public StandardInstBaseViewModel(InstUriInfo instUri) 
     : base(instUri)
 {
     this.view_ = new StandardInstBaseView();
     //this.view_.DataContext = this;
 }
 //public static InstrumentBaseViewModel CreateInstBaseVM(string itemCode, string itemType, MyURI instUri, MyURI resultURI) 
 public static InstrumentBaseViewModel CreateInstBaseVM(InstUriInfo instUri) 
 {
     if ( !instUri.isExist() )
     {
         return new NoExistInstrumentBaseViewModel(instUri);
     }
     else 
     {
         if (instUri.itemType_ == "Group")
         {
             return new GroupBaseViewModel(instUri);
         }
         else 
         {
             return new StandardInstBaseViewModel(instUri);
         }
         //else if (itemType == "")
         //{
         //    //return new Cre(itemCode, itemType, fileInfo);
         //}
         //else 
         //{
         //    throw new Exception();
         //}
     }
     
 }
 public GroupBaseViewModel(InstUriInfo instUri)
 : base(instUri)
 {
 }
 public NoExistInstrumentBaseViewModel(InstUriInfo instUri)
  : base(instUri)
 {
 }