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);
            }
        }
Exemplo n.º 2
0
        public string instrumentPath()
        {
            //조건부 리턴.
            this.InstUri_ = PositionSingletonManger.CreateInstUriInfo(this.itemCode_, this.itemType_);

            return(this.InstUri_.Uri_.LocalPath);
        }
Exemplo 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);
            }
        }
Exemplo n.º 4
0
        private void SaveBtn_Click(object sender, RoutedEventArgs e)
        {
            this.viewModel_.buildInstrument();
            //this.viewModel_.buildParaResult();

            bool success = PositionSingletonManger.positionMasterVM().addInstrument(this.viewModel_);

            if (success)
            {
                this.viewModel_.saveInstrument();
            }

            //message 저장함.
        }
        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);
            }
        }
 private void SaveBtn_Click(object sender, RoutedEventArgs e)
 {
     PositionSingletonManger.positionMasterVM().addInstrument(viewModel_);
 }
Exemplo n.º 7
0
 public BatchManagerViewModel()
 {
     this.ReferenceDate_ = PositionSingletonManger.positionMasterVM().ReferenceDate_;
     this.initialize();
 }