public void UpdateLOG(string value, string assetGroup, int adviserId, DateTime valuationDate) { int cnt = 0; int LogId = 0; int notNullcnt = 0; List <int> customerList = new List <int>(); List <CustomerPortfolioVo> customerPortfolioList = new List <CustomerPortfolioVo>(); List <EQPortfolioVo> eqPortfolioList = null; List <MFPortfolioVo> mfPortfolioList = null; string status = string.Empty; try { if (value == "1" && assetGroup == "EQ") { if (rbtnEquity.Checked) { if (ddTradeMonth.SelectedValue != "" && ddTradeYear.SelectedValue != "") { customerPortfolioBo.DeleteAdviserEODLog(adviserId, "EQ", valuationDate, 0); if (DateTime.Compare(valuationDate, DateTime.Today) <= 1) { customerList = customerPortfolioBo.GetAdviserCustomerList_EQ(adviserId); if (customerList != null) { notNullcnt = notNullcnt + 1; LogId = CreateAdviserEODLog("EQ", valuationDate, adviserId); if (LogId != 0) { cnt = 0; for (int j = 0; j < customerList.Count; j++) { customerPortfolioList = portfolioBo.GetCustomerPortfolios(customerList[j]); customerPortfolioBo.DeleteEquityNetPosition(customerList[j], valuationDate); if (customerPortfolioList != null) { for (int k = 0; k < customerPortfolioList.Count; k++) { eqPortfolioList = customerPortfolioBo.GetCustomerEquityPortfolio(customerList[j], customerPortfolioList[k].PortfolioId, valuationDate, string.Empty, string.Empty); if (eqPortfolioList != null) { customerPortfolioBo.AddEquityNetPosition(eqPortfolioList, userVo.UserId); } } } cnt = cnt + 1; } } if (cnt == customerList.Count) { UpdateAdviserEODLog("EQ", 1, LogId); if (Cache[adviserId.ToString()] != null && valuationDate == DateTime.Today) { Cache.Remove(adviserId.ToString()); } ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Equity Valuation done...!');", true); } else { UpdateAdviserEODLog("EQ", 0, LogId); ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Equity Valuation not done...!');", true); } // BindAdviserGrid("EQ", valuationDate); } } if (notNullcnt == 0) { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('No Customers With Equity Transactions....');", true); } } } } else if (value == "1" && assetGroup == "MF") { customerPortfolioBo.DeleteAdviserEODLog(adviserId, "MF", valuationDate, 0); if (DateTime.Compare(valuationDate, DateTime.Today) <= 1) { MFEngineBo mfEngineBo = new MFEngineBo(); //mfEngineBo.MFBalanceCreation(adviserId, 0, valuationFor); advisorBo.InsertHistoricalValuationInQueue(valuationDate, adviserId, userVo.UserId, int.Parse(hfIsCurrentValuation.Value)); ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Request successfully sent !!...Please wait for another 30 mints');", true); BindAdviserGrid("MF", valuationDate); } } //if (notNullcnt == 0) //{ // ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('No Customers With MF Transactions....');", true); //} //GetTradeDate(); btnRunValuation.Visible = true; } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "DailyValuation.ascx.cs:UpdateLOG()"); object[] objects = new object[2]; objects[0] = value; objects[1] = assetGroup; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
public void ProcessMFTransactionBalance(int commonId1, int commonId2, ValuationLevel Level) { try { switch (Level.ToString()) { case "AllAdviser": { mfEngineBo = new MFEngineBo(); List <AdvisorVo> adviserVoList = new List <AdvisorVo>(); adviserVoList = adviserMaintenanceBo.GetAdviserList(); BoValuation.MFEngineBo.ValuationLabel valuationFor = BoValuation.MFEngineBo.ValuationLabel.Advisor; for (int i = 0; i < adviserVoList.Count; i++) { try { int logId = 0; logId = CreateAdviserEODLog("MF_Balance", DateTime.Now, adviserVoList[i].advisorId); mfEngineBo.MFBalanceCreation(commonId1, 0, valuationFor); UpdateAdviserEODLog("MF_Balance", 1, logId); } catch { } } break; } case "Adviser": { try { mfEngineBo = new MFEngineBo(); BoValuation.MFEngineBo.ValuationLabel valuationFor = BoValuation.MFEngineBo.ValuationLabel.Advisor; int logId = 0; logId = CreateAdviserEODLog("MF_Balance", DateTime.Now, commonId1); mfEngineBo.MFBalanceCreation(commonId1, 0, valuationFor); UpdateAdviserEODLog("MF_Balance", 1, logId); } catch { } break; } case "Customer": { try { mfEngineBo = new MFEngineBo(); mfEngineBo = new MFEngineBo(); BoValuation.MFEngineBo.ValuationLabel valuationFor = BoValuation.MFEngineBo.ValuationLabel.Customer; mfEngineBo.MFBalanceCreation(commonId1, 0, valuationFor); } catch { } break; } case "Account": { try { mfEngineBo = new MFEngineBo(); BoValuation.MFEngineBo.ValuationLabel valuationFor = BoValuation.MFEngineBo.ValuationLabel.AccountScheme; mfEngineBo.MFBalanceCreation(commonId1, commonId2, valuationFor); } catch { } break; } } } catch (BaseApplicationException Ex) { //emailSMSBo.SendErrorExceptionMail(commonId, startFrom.ToString(),schemePlanCode, Ex.Message, "MFEngineBo.cs_MFBalanceCreation"); throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "MFEngineBo.cs:MFBalanceCreation()"); object[] objects = new object[3]; objects[0] = commonId1; objects[1] = commonId1; objects[2] = Level; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }