private void GetLatestValuationDate() { PortfolioBo portfolioBo = null; try { portfolioBo = new PortfolioBo(); if (portfolioBo.GetLatestValuationDate(advisorVo.advisorId, "EQ") != null) { EQValuationDate = DateTime.Parse(portfolioBo.GetLatestValuationDate(advisorVo.advisorId, "EQ").ToString()); } if (portfolioBo.GetLatestValuationDate(advisorVo.advisorId, "MF") != null) { MFValuationDate = DateTime.Parse(portfolioBo.GetLatestValuationDate(advisorVo.advisorId, "MF").ToString()); } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "PortfolioDashboard.ascx.cs:GetLatestValuationDate()"); object[] objects = new object[2]; objects[0] = EQValuationDate; objects[1] = MFValuationDate; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
private void GetLatestValuationDate() { DateTime EQValuationDate = new DateTime(); DateTime MFValuationDate = new DateTime(); PortfolioBo portfolioBo = null; Dictionary <string, DateTime> genDict = new Dictionary <string, DateTime>(); AdvisorVo advisorVo = new AdvisorVo(); int adviserId = 0; advisorVo = (AdvisorVo)Session["advisorVo"]; adviserId = advisorVo.advisorId; try { portfolioBo = new PortfolioBo(); if (userVo.UserType == "Advisor") { advisorVo = (AdvisorVo)Session["advisorVo"]; adviserId = advisorVo.advisorId; } else if (userVo.UserType == "RM") { adviserId = int.Parse(Session["adviserId"].ToString()); } if (portfolioBo.GetLatestValuationDate(adviserId, "EQ") != null) { EQValuationDate = DateTime.Parse(portfolioBo.GetLatestValuationDate(adviserId, "EQ").ToString()); } if (portfolioBo.GetLatestValuationDate(adviserId, "MF") != null) { MFValuationDate = DateTime.Parse(portfolioBo.GetLatestValuationDate(adviserId, "MF").ToString()); } genDict.Add("EQDate", EQValuationDate); genDict.Add("MFDate", MFValuationDate); Session["ValuationDate"] = genDict; } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "PortfolioDashboard.ascx.cs:GetLatestValuationDate()"); object[] objects = new object[3]; objects[0] = EQValuationDate; objects[1] = adviserId; objects[2] = MFValuationDate; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
private void GetLatestValuationDate() { DateTime EQValuationDate = new DateTime(); DateTime MFValuationDate = new DateTime(); PortfolioBo portfolioBo = null; genDict = new Dictionary <string, DateTime>(); AdvisorVo advisorVo = new AdvisorVo(); int adviserId = 0; try { portfolioBo = new PortfolioBo(); advisorVo = (AdvisorVo)Session[SessionContents.AdvisorVo]; adviserId = advisorVo.advisorId; if (portfolioBo.GetLatestValuationDate(adviserId, Constants.MF.ToString()) != null) { MFValuationDate = DateTime.Parse(portfolioBo.GetLatestValuationDate(adviserId, Constants.MF.ToString()).ToString()); } genDict.Add(Constants.MFDate.ToString(), MFValuationDate); Session[SessionContents.ValuationDate] = genDict; } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "PortfolioDashboard.ascx.cs:GetLatestValuationDate()"); object[] objects = new object[3]; objects[0] = EQValuationDate; objects[1] = adviserId; objects[2] = MFValuationDate; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
protected void Page_Load(object sender, EventArgs e) { SessionBo.CheckSession(); advisorVo = (AdvisorVo)Session["advisorVo"]; userType = Session["UserType"].ToString().ToLower(); rmVo = (RMVo)Session[SessionContents.RmVo]; rmid = rmVo.RMId; trMessage.Visible = false; schemeplanid = 0; //trModalPopup.Visible = false; //ValuationDate = DateTime.Now.Date; SessionBo.CheckSession(); userVo = (UserVo)Session["userVo"]; rmVo = advisorStaffBo.GetAdvisorStaff(userVo.UserId); bmID = rmVo.RMId; AdviserID = advisorVo.advisorId; if (!IsPostBack) { PortfolioBo portfoliobo = new PortfolioBo(); string valuedate = Convert.ToString(portfoliobo.GetLatestValuationDate(advisorVo.advisorId, "MF")); hdnValuationDate.Value = valuedate.ToString(); if (hdnValuationDate.Value == string.Empty) { ValuationNotDoneErrorMsg.Visible = true; if (userType == "adviser") { BindBranchDropDown(); BindRMDropDown(); } else if (userType == "rm") { spnBranch.Visible = false; spnRM.Visible = false; } else if (userType == "bm") { BindBranchForBMDropDown(); BindRMforBranchDropdown(0, bmID, 1); } } else { ValuationNotDoneErrorMsg.Visible = false; if (userType == "rm") { spnBranch.Visible = false; spnRM.Visible = false; } if (userType == "adviser") { BindBranchDropDown(); BindRMDropDown(); } if (userType == "bm") { if (!IsPostBack) { BindBranchForBMDropDown(); BindRMforBranchDropdown(0, bmID, 1); } hdnbranchId.Value = "0"; hdnbranchHeadId.Value = ddlBranch.SelectedValue; hdnAll.Value = "2"; hdnXWise.Value = "2"; hdnrmId.Value = "0"; } } if (Request.QueryString["schemeplanid"] != null) { schemeplanid = int.Parse(Request.QueryString["schemeplanid"].ToString()); LatestValuationdate = DateTime.Parse(Request.QueryString["latestValuationdate"].ToString()); } else { valuedate = Convert.ToString(portfoliobo.GetLatestValuationDate(advisorVo.advisorId, "MF")); if (valuedate != "") { LatestValuationdate = Convert.ToDateTime(portfoliobo.GetLatestValuationDate(advisorVo.advisorId, "MF")); //Valuation date storing in Hiddenfield For all page Export hdnValuationDate.Value = LatestValuationdate.ToString(); } } if (LatestValuationdate != DateTime.MinValue) { txtDate.Text = LatestValuationdate.Date.ToShortDateString(); bindgrid(LatestValuationdate, schemeplanid); } //else //{ // trMessage.Visible = true; // lblMessage.Text = "No valuation done"; //} } }
protected void Page_Load(object sender, EventArgs e) { SessionBo.CheckSession(); advisorVo = (AdvisorVo)Session["advisorVo"]; userType = Session["UserType"].ToString().ToLower(); rmVo = (RMVo)Session[SessionContents.RmVo]; rmid = rmVo.RMId; trMessage.Visible = false; SessionBo.CheckSession(); userVo = (UserVo)Session["userVo"]; rmVo = advisorStaffBo.GetAdvisorStaff(userVo.UserId); bmID = rmVo.RMId; AdviserID = advisorVo.advisorId; if (!IsPostBack) { PortfolioBo portfoliobo = new PortfolioBo(); string valuedate = Convert.ToString(portfoliobo.GetLatestValuationDate(advisorVo.advisorId, "MF")); hdnValuationDate.Value = valuedate.ToString(); if (hdnValuationDate.Value == string.Empty) { ValuationNotDoneErrorMsg.Visible = true; if (userType == "adviser") { BindBranchDropDown(); BindRMDropDown(); } else if (userType == "rm") { spnBranch.Visible = false; spnRM.Visible = false; } else if (userType == "bm") { BindBranchForBMDropDown(); BindRMforBranchDropdown(0, bmID, 1); } } else { ValuationNotDoneErrorMsg.Visible = false; if (userType == "rm") { spnBranch.Visible = false; spnRM.Visible = false; } if (userType == "adviser") { hdnbranchId.Value = "0"; hdnbranchHeadId.Value = AdviserID.ToString(); hdnAll.Value = "2"; //hdnXWise.Value = "0"; hdnrmId.Value = ddlRM.SelectedValue; BindBranchDropDown(); BindRMDropDown(); bindgrid(LatestValuationdate); } if (userType == "bm") { if (!IsPostBack) { BindBranchForBMDropDown(); BindRMforBranchDropdown(0, bmID, 1); } hdnbranchId.Value = "0"; hdnbranchHeadId.Value = ddlBranch.SelectedValue; hdnAll.Value = "2"; hdnrmId.Value = "0"; hdnXWise.Value = "0"; dsMISReport = adviserMISBo.GetMISForBM(int.Parse(hdnrmId.Value.ToString()), int.Parse(hdnbranchId.Value.ToString()), int.Parse(hdnbranchHeadId.Value.ToString()), int.Parse(hdnXWise.Value.ToString()), int.Parse(hdnAll.Value.ToString()), DateTime.Parse(hdnValuationDate.Value.ToString()), 0, 0, 1, hdnAMCSearchVal.Value.ToString(), string.Empty, string.Empty, string.Empty, string.Empty, out count, 0); } } if (valuedate != "") { LatestValuationdate = Convert.ToDateTime(portfoliobo.GetLatestValuationDate(advisorVo.advisorId, "MF")); hdnValuationDate.Value = LatestValuationdate.ToString(); } if (LatestValuationdate != DateTime.MinValue) { txtDate.Text = LatestValuationdate.Date.ToShortDateString(); bindgrid(LatestValuationdate); } //else //{ // lblMessage.Text = "No valuation done"; // trMessage.Visible = true; //} if (ddlBranch.SelectedValue == "") { } } }
protected void Page_Load(object sender, EventArgs e) { SessionBo.CheckSession(); this.Page.Culture = "en-GB"; advisorVo = (AdvisorVo)Session["advisorVo"]; userType = Session["UserType"].ToString().ToLower(); rmVo = (RMVo)Session[SessionContents.RmVo]; rmid = rmVo.RMId; trMessage.Visible = false; amcCode = 0; SessionBo.CheckSession(); userVo = (UserVo)Session["userVo"]; rmVo = advisorStaffBo.GetAdvisorStaff(userVo.UserId); bmID = rmVo.RMId; AdviserID = advisorVo.advisorId; if (!IsPostBack) { PortfolioBo portfoliobo = new PortfolioBo(); string valuedate = Convert.ToString(portfoliobo.GetLatestValuationDate(advisorVo.advisorId, "MF")); hdnValuationDate.Value = valuedate.ToString(); if (hdnValuationDate.Value == string.Empty) { ValuationNotDoneErrorMsg.Visible = true; if (userType == "adviser") { BindBranchDropDown(); BindRMDropDown(); } else if (userType == "rm") { spnBranch.Visible = false; spnRM.Visible = false; } else if (userType == "bm") { BindBranchForBMDropDown(); BindRMforBranchDropdown(0, bmID, 1); } } else { ValuationNotDoneErrorMsg.Visible = false; if (userType == "rm") { spnBranch.Visible = false; spnRM.Visible = false; } if (userType == "adviser") { BindBranchDropDown(); BindRMDropDown(); } if (userType == "bm") { if (!IsPostBack) { BindBranchForBMDropDown(); BindRMforBranchDropdown(0, bmID, 1); } hdnbranchId.Value = "0"; hdnbranchHeadId.Value = ddlBranch.SelectedValue; hdnAll.Value = "2"; hdnrmId.Value = "0"; hdnXWise.Value = "1"; if (hdnValuationDate.Value.ToString() != "") { dsMISReport = adviserMISBo.GetMISForBM(int.Parse(hdnrmId.Value.ToString()), int.Parse(hdnbranchId.Value.ToString()), int.Parse(hdnbranchHeadId.Value.ToString()), int.Parse(hdnXWise.Value.ToString()), int.Parse(hdnAll.Value.ToString()), DateTime.Parse(hdnValuationDate.Value.ToString()), amcCode, 0, 1, hdnAMCSearchVal.Value.ToString(), hdnSchemeSearchVal.Value.ToString(), string.Empty, string.Empty, hdnCategoryFilter.Value.ToString(), out count, 0); } } } if (Request.QueryString["amcCode"] != null) { amcCode = int.Parse(Request.QueryString["amcCode"].ToString()); LatestValuationdate = DateTime.Parse(Request.QueryString["latestValuationdate"].ToString()); } else { valuedate = Convert.ToString(portfoliobo.GetLatestValuationDate(advisorVo.advisorId, "MF")); hdnValuationDate.Value = valuedate.ToString(); if (valuedate != "") { LatestValuationdate = Convert.ToDateTime(valuedate); //Valuation date storing in Hiddenfield For all page Export ValuationDate.Value = LatestValuationdate.ToString(); } } if (LatestValuationdate != DateTime.MinValue) { txtDate.Text = LatestValuationdate.Date.ToShortDateString(); //txtDate.Text = LatestValuationdate.Date.ToShortDateString(); bindgrid(LatestValuationdate, amcCode); } //else //{ // lblMessage.Text = "No valuation done"; // trMessage.Visible = true; //} hdnDownloadPageType.Value = "single"; } if (hdnDownloadPageType.Value != "" || hdnDownloadPageType.Value != string.Empty) { hdnDownloadPageType.Value = "single"; } }
protected void Page_Load(object sender, EventArgs e) { SessionBo.CheckSession(); advisorVo = (AdvisorVo)Session["advisorVo"]; path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString()); if (Session[SessionContents.CurrentUserRole].ToString().ToLower() == "admin" || Session[SessionContents.CurrentUserRole].ToString().ToLower() == "ops") { userType = "advisor"; } else { userType = Session[SessionContents.CurrentUserRole].ToString().ToLower(); } advisorId = advisorVo.advisorId; PortfolioBo portfoliobo = new PortfolioBo(); string valuedate = Convert.ToString(portfoliobo.GetLatestValuationDate(advisorId, "EQ")); hdnValuationDate.Value = valuedate.ToString(); if (hdnValuationDate.Value == string.Empty) { if (userType == "advisor") { BindBranchDropDown(); BindRMDropDown(); } else if (userType == "rm") { trBranchRmDpRow.Visible = false; } else if (userType == "bm") { BindBranchForBMDropDown(); BindRMforBranchDropdown(0, bmID, 1); trComSecWiseOptions.Visible = true; } } else { try { /* For UserType */ advisorVo = (AdvisorVo)Session["advisorVo"]; path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString()); if (Session[SessionContents.CurrentUserRole].ToString().ToLower() == "admin" || Session[SessionContents.CurrentUserRole].ToString().ToLower() == "ops") { userType = "advisor"; } else { userType = Session[SessionContents.CurrentUserRole].ToString().ToLower(); } SessionBo.CheckSession(); userVo = (UserVo)Session["userVo"]; rmVo = advisorStaffBo.GetAdvisorStaff(userVo.UserId); bmID = rmVo.RMId; gvEQMIS.Visible = false; if (!IsPostBack) { if (valuedate != "") { LatestValuationdate = Convert.ToDateTime(portfoliobo.GetLatestValuationDate(advisorVo.advisorId, "EQ")); hdnValuationDate.Value = LatestValuationdate.ToString(); } if (LatestValuationdate != DateTime.MinValue) { txtEQDate.Text = LatestValuationdate.Date.ToShortDateString(); } BindMISTypeDropDown(); } dsGetLastTradeDate = customertransactionbo.GetLastTradeDate(); DateTime dtLastTradeDate; if (valuedate != "") { LatestValuationdate = Convert.ToDateTime(portfoliobo.GetLatestValuationDate(advisorVo.advisorId, "EQ")); hdnValuationDate.Value = LatestValuationdate.ToString(); } if (LatestValuationdate != DateTime.MinValue) { txtEQDate.Text = LatestValuationdate.Date.ToShortDateString(); } if (dsGetLastTradeDate.Tables[0].Rows.Count != 0) { dtLastTradeDate = (DateTime)dsGetLastTradeDate.Tables[0].Rows[0]["WTD_Date"]; } //to hide the dropdown selection for mis type for adviser and bm } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AddBranch.ascx:PageLoad()"); object[] objects = new object[2]; objects[0] = advisorVo; objects[1] = path; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } } }