public static void SaveHistoryData(Excel_instrumentViewModel e_inst)
        {
            Excel_parameterViewModel e_paraVM = e_inst.Excel_parameterViewModel_;

            //DateTime tradeDate = e_inst.MasterInformationViewModel_.Trade_date_;

            DateTime effectiveDate = e_inst.Excel_interfaceViewModel_.Excel_issueInfoViewModel_.EffectiveDate_;

            //string historyUnderStr = e_paraVM.historyUnderData(effectiveDate);
            string historyUnderStr = e_inst.Excel_interfaceViewModel_.Excel_underlyingCalcInfoViewModel_.historyUnderData(effectiveDate, e_paraVM.ReferenceDate_);

            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.LoadXml(historyUnderStr);

            string itemCode   = e_paraVM.ItemCode_;
            string refDateStr = e_paraVM.ReferenceDate_.ToString("yyyyMMdd");

            bool exists = System.IO.Directory.Exists(path_ + refDateStr);

            if (!exists)
            {
                System.IO.Directory.CreateDirectory(path_ + refDateStr);
            }


            try
            {
                xmlDoc.Save(path_ + refDateStr + "\\" + itemCode + "_" + refDateStr + "_historyData.xml");
            }
            catch (Exception)
            {
                OutputLogViewModel.addResult("history Xml save fail!");
            }
        }
        public static void SaveParameter(Excel_parameterViewModel e_paraVM)
        {
            string parameterXmlStr = e_paraVM.paraXml();

            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.LoadXml(parameterXmlStr);

            string itemCode   = e_paraVM.ItemCode_;
            string refDateStr = e_paraVM.ReferenceDate_.ToString("yyyyMMdd");

            bool exists = System.IO.Directory.Exists(path_ + refDateStr);

            if (!exists)
            {
                System.IO.Directory.CreateDirectory(path_ + refDateStr);
            }


            try
            {
                xmlDoc.Save(path_ + refDateStr + "\\" + itemCode + "_" + refDateStr + ".xml");
            }
            catch (Exception)
            {
                OutputLogViewModel.addResult("parameter Xml save fail!");
            }
        }
Exemple #3
0
        public void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
        {
            FpmlSerializedCSharp.Pricing serial_Pricing = serial_Class as FpmlSerializedCSharp.Pricing;

            this.evaluationTime_ = serial_Pricing.EvaluationTime_.ValueStr;

            FpmlSerializedCSharp.Excel_parameter serial_excel_parameter = serial_Pricing.Excel_parameter_;
            string excel_parametertype = serial_excel_parameter.Excel_type_.ValueStr;

            this.excel_parameterViewModel_ = Excel_parameterViewModel.CreateExcel_parameter(excel_parametertype);
            this.excel_parameterViewModel_.setFromSerial(serial_excel_parameter);
        }
Exemple #4
0
        public virtual void buildParameterFromInstrumentWithOutData(DateTime refDate)
        {
            Excel_parameterViewModel e_pvm = Excel_parameterLoader.Load(this.booking_type_);

            e_pvm.IssueDate_ = this.excel_interfaceViewModel_.Excel_issueInfoViewModel_.EffectiveDate_;

            e_pvm.ItemCode_ = this.masterInformationViewModel_.Item_code_;

            //ParameterSettingManager parameterSettingManager = new ParameterSettingManager(refDate,this);
            ParameterSettingManager parameterSettingManager
                = ParameterSettingManagerBuilder.makeParaSettingManager("default", refDate, this);

            e_pvm.buildParaSetting(parameterSettingManager);

            this.excel_parameterViewModel_ = e_pvm;
        }
Exemple #5
0
        public void loadDetailContext()
        {
            //try
            //{
            string type = this.masterInformationViewModel_.Booking_type_;

            this.excel_interfaceViewModel_           = Excel_InterfaceLoader.Load(type);
            this.excel_interfaceViewModel_.ItemCode_ = this.masterInformationViewModel_.Item_code_;
            //this.excel_interfaceViewModel_.TradeID_ = this.masterInformationViewModel_.Trade_id_;

            this.excel_parameterViewModel_           = Excel_parameterLoader.Load(type);
            this.excel_parameterViewModel_.ItemCode_ = this.masterInformationViewModel_.Item_code_;
            //this.excel_parameterViewModel_.TradeID_ = this.masterInformationViewModel_.Trade_id_;
            this.excel_parameterViewModel_.ReferenceDate_ = RootBookViewModel.rootBookReferenceDate();

            //링크
            //this.linkEventPass();

            this.excel_profitLossViewModel_                 = new Excel_profitLossViewModel();
            this.excel_profitLossViewModel_.ItemCode_       = this.masterInformationViewModel_.Item_code_;
            this.excel_profitLossViewModel_.TradeID_        = this.masterInformationViewModel_.Trade_id_;
            this.excel_profitLossViewModel_.ExportItemCode_ = this.masterInformationViewModel_.Export_itemcode_;

            this.loadInterfaceVMFromXml();
            this.loadParameterFromXml();

            // xml이 로드된 후에 setting 함.. xml로드할때 class가 생성되므로..
            this.excel_interfaceViewModel_.setUnderlying();

            //d 나중에 클릭 대면 로드함 왜냐면 DB접속이니까... 느릴까바.. 흐앙
            this.excel_profitLossViewModel_.ReferenceDate_ = RootBookViewModel.rootBookReferenceDate();
            this.excel_profitLossViewModel_.loadBookingInfo();
            //this.excel_profitLossViewModel_.loadNPV();
            //this.excel_profitLossViewModel_.loadTradeEvent();

            this.excel_eventManagerViewModel_           = new Excel_eventManagerViewModel();
            this.excel_eventManagerViewModel_.ItemCode_ = this.masterInformationViewModel_.Item_code_;
            this.excel_eventManagerViewModel_.dbLoad();
            //}
            //catch (Exception e)
            //{
            //    e.Source += "\n" + this.Item_code_;

            //    throw e;
            //}
        }
 public  void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
 {
     FpmlSerializedCSharp.Pricing serial_Pricing = serial_Class as FpmlSerializedCSharp.Pricing;
 
     this.evaluationTime_ = serial_Pricing.EvaluationTime_.ValueStr;
     
     FpmlSerializedCSharp.Excel_parameter serial_excel_parameter = serial_Pricing.Excel_parameter_;
     string excel_parametertype = serial_excel_parameter.Excel_type_.ValueStr;
     this.excel_parameterViewModel_ = Excel_parameterViewModel.CreateExcel_parameter(excel_parametertype);
     this.excel_parameterViewModel_.setFromSerial(serial_excel_parameter);
     
 }
        public static void SaveParameter(Excel_parameterViewModel e_paraVM)
        {
            string parameterXmlStr = e_paraVM.paraXml();

            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.LoadXml(parameterXmlStr);

            string itemCode = e_paraVM.ItemCode_;
            string refDateStr = e_paraVM.ReferenceDate_.ToString("yyyyMMdd");

            bool exists = System.IO.Directory.Exists(path_ + refDateStr);

            if (!exists)
            {
                System.IO.Directory.CreateDirectory(path_ + refDateStr);
            }


            try
            {
                xmlDoc.Save(path_ + refDateStr + "\\" + itemCode + "_" + refDateStr + ".xml");
            }
            catch (Exception )
            {
                OutputLogViewModel.addResult("parameter Xml save fail!");
            }

        }
        public virtual void buildParameterFromInstrumentWithOutData(DateTime refDate)
        {
            Excel_parameterViewModel e_pvm = Excel_parameterLoader.Load(this.booking_type_);

            e_pvm.IssueDate_ = this.excel_interfaceViewModel_.Excel_issueInfoViewModel_.EffectiveDate_;

            e_pvm.ItemCode_ = this.masterInformationViewModel_.Item_code_;

            //ParameterSettingManager parameterSettingManager = new ParameterSettingManager(refDate,this);
            ParameterSettingManager parameterSettingManager 
                = ParameterSettingManagerBuilder.makeParaSettingManager ("default",refDate, this);

            e_pvm.buildParaSetting(parameterSettingManager);

            this.excel_parameterViewModel_ = e_pvm;
        }
        public void loadDetailContext()
        {
            //try
            //{
                string type = this.masterInformationViewModel_.Booking_type_;

                this.excel_interfaceViewModel_ = Excel_InterfaceLoader.Load(type);
                this.excel_interfaceViewModel_.ItemCode_ = this.masterInformationViewModel_.Item_code_;
                //this.excel_interfaceViewModel_.TradeID_ = this.masterInformationViewModel_.Trade_id_;

                this.excel_parameterViewModel_ = Excel_parameterLoader.Load(type);
                this.excel_parameterViewModel_.ItemCode_ = this.masterInformationViewModel_.Item_code_;
                //this.excel_parameterViewModel_.TradeID_ = this.masterInformationViewModel_.Trade_id_;
                this.excel_parameterViewModel_.ReferenceDate_ = RootBookViewModel.rootBookReferenceDate();

                //링크
                //this.linkEventPass();

                this.excel_profitLossViewModel_ = new Excel_profitLossViewModel();
                this.excel_profitLossViewModel_.ItemCode_ = this.masterInformationViewModel_.Item_code_;
                this.excel_profitLossViewModel_.TradeID_ = this.masterInformationViewModel_.Trade_id_;
                this.excel_profitLossViewModel_.ExportItemCode_ = this.masterInformationViewModel_.Export_itemcode_;

                this.loadInterfaceVMFromXml();
                this.loadParameterFromXml();

                // xml이 로드된 후에 setting 함.. xml로드할때 class가 생성되므로..
                this.excel_interfaceViewModel_.setUnderlying();

                //d 나중에 클릭 대면 로드함 왜냐면 DB접속이니까... 느릴까바.. 흐앙
                this.excel_profitLossViewModel_.ReferenceDate_ = RootBookViewModel.rootBookReferenceDate();
                this.excel_profitLossViewModel_.loadBookingInfo();
                //this.excel_profitLossViewModel_.loadNPV();
                //this.excel_profitLossViewModel_.loadTradeEvent();

                this.excel_eventManagerViewModel_ = new Excel_eventManagerViewModel();
                this.excel_eventManagerViewModel_.ItemCode_ = this.masterInformationViewModel_.Item_code_;
                this.excel_eventManagerViewModel_.dbLoad();
            //}
            //catch (Exception e)
            //{
            //    e.Source += "\n" + this.Item_code_;

            //    throw e;
            //}
            
        }