コード例 #1
0
        //private void DeleteSecId(DataContext dataContext)
        //{
        //    string secId = "F00000OZKG";
        //    FundClassBasicGroup fundClassBasicGroup = new FundClassBasicGroup(dataContext, secId);

        //    FundClassBasicGroup.FundClassBasic fundClassBasic = fundClassBasicGroup.BasicData;
        //    fundClassBasicGroup.Records.Remove(fundClassBasic);
        //    new OperationDataGroupContainer(fundClassBasicGroup).Save();
        //}

        //private void TestConnectToMSAccess()
        //{
        //    Dictionary<string,string> productionDict = new Dictionary<string, string>();

        //    try
        //    {
        //        productionDict = GetAvailableProducts();
        //        if(productionDict != null && productionDict.Count > 0)
        //        {
        //            foreach (KeyValuePair<string, string> production in productionDict)
        //            {
        //                _log.Info(String.Format("{0},{1}", production.Key, production.Value));
        //            }
        //        }
        //    }
        //    catch (Exception ex)
        //    {
                
        //        _log.Warn(ex.Message);
        //    }
        //}

        //private void TestClassCategory(DataContext dataContext)
        //{
        //    string SecId = "F00000OP1Z";
        //     SecurityTable.FundInfo fundInfo = SecurityTable.GetFundBySecId(SecId);
        //     if (fundInfo != null)
        //     {
        //         //Get categoryId from the most recent category record
        //         PeerGroupMembershipGroup.PeerGroupMembership mostRecentCategoryPeerGroupMembership =
        //             PeerGroupMembershipGroup.GetMostRecentCategory(dataContext,
        //                                                            fundInfo.FundId,
        //                                                            InvestmentType.DataType.Fund,
        //                                                            Types.ClassificationMethod.Category);

        //         string classCategoryId = "";
        //         DateTime effectiveDate = DateTime.Today;

        //         PeerGroupMembershipGroup peerGroupForClassCategory =
        //             new PeerGroupMembershipGroup(dataContext,
        //                                          SecId,
        //                                          (int) InvestmentType.DataType.Security,
        //                                          DateTime_.NULL);

        //         if (mostRecentCategoryPeerGroupMembership != null)
        //         {
        //             classCategoryId =
        //                 PeerGroupMembershipGroup.GetClassCategoryId(mostRecentCategoryPeerGroupMembership.Value,
        //                                                             "CU$$$$$CHF");
        //             effectiveDate = effectiveDate > mostRecentCategoryPeerGroupMembership.StartDate
        //                                 ? effectiveDate
        //                                 : mostRecentCategoryPeerGroupMembership.StartDate;
        //         }
        //         PeerGroupMembershipGroup.PeerGroupMembership record =
        //             peerGroupForClassCategory.CreateOrGetPeerGroupMembership(SecId,
        //                                                                      (int)
        //                                                                      Types.ClassificationMethod.ClassCategory,
        //                                                                      effectiveDate);
        //         record.Value = classCategoryId;
        //         new OperationDataGroupContainer(peerGroupForClassCategory).Save();
        //     }
        //}

        private void HandlePurchaseConstraintFeeRemove(DataContext dataContext, string excelFile, FundclassEntity.FeeType feeType)
        {
            _log.Info("Handle PurchaseConstraintFee Remove Begin");
            _log.Info(String.Format("Fee type: {0}", feeType.ToString()));
            DataSet data = GetPurchaseConstraintFeeRemoveData(excelFile);

            if (data.Tables.Count > 0
                && data.Tables[0].Rows != null
                && data.Tables[0].Rows.Count > 0)
            {
                _log.Info(String.Format("Need import {0} records", data.Tables[0].Rows.Count));
                DataRowCollection rows = data.Tables[0].Rows;
                for (int i = 0; i < rows.Count; i++)
                {
                    int sequence = i + 1;
                    _log.Info(String.Format("Handle the {0} record begin", sequence.ToString()));
                    ImportPurchaseConstraintFeeRemove(rows[i], dataContext, feeType);
                    _log.Info(String.Format("Handle the {0} record end", sequence.ToString()));
                }
            }
            _log.Info("Handle PurchaseConstraintFee Remove End");
        }