コード例 #1
0
 protected void btnSaveChanges_Click(object sender, EventArgs e)
 {
     try
     {
         govtSavingsVo = GetValuesFromFields();
         //TODO : Check if the below two lines are needed.
         customerAccountsVo = customerAccountBo.GetGovtSavingsAccount(govtSavingsVo.AccountId);
         UpdateAccountDetails(customerAccountsVo);
         //UpdatePortfolioDetails(govtSavingsVo);
         govtSavingsBo.UpdateGovtSavingsNP(govtSavingsVo, userVo.UserId);
         ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('ViewGovtSavings','none');", true);
     }
     catch (BaseApplicationException Ex)
     {
         throw Ex;
     }
     catch (Exception Ex)
     {
         BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
         NameValueCollection      FunctionInfo = new NameValueCollection();
         FunctionInfo.Add("Method", "PortfolioGovtSavingsEntry.ascx:btnSaveChanges_Click()");
         object[] objects = new object[2];
         objects[0]   = govtSavingsVo;
         objects[1]   = customerAccountsVo;
         FunctionInfo = exBase.AddObject(FunctionInfo, objects);
         exBase.AdditionalInformation = FunctionInfo;
         ExceptionManager.Publish(exBase);
         throw exBase;
     }
 }
コード例 #2
0
        public bool CreateGovtSavingsNP(GovtSavingsVo govtSavingsVo, int userId)
        {
            bool           bResult        = false;
            GovtSavingsDao GovtSavingsDao = new GovtSavingsDao();

            try
            {
                bResult = GovtSavingsDao.CreateGovtSavingNetPosition(govtSavingsVo, userId);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "GovtSavingsBoBo.cs:CreateGovtSavingsNP");
                object[] objects = new object[2];
                objects[0]   = govtSavingsVo;
                objects[1]   = userId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }

            return(bResult);
        }
コード例 #3
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            govtSavingsVo = GetValuesFromFields();
            bool bResult = govtSavingsBo.CreateGovtSavingsNP(govtSavingsVo, userVo.UserId);

            //UpdateAccountDetails(customerAccountsVo);
            if (bResult)
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "loadcontrol('ViewGovtSavings','none');", true);
            }
        }
コード例 #4
0
        public void LoadGridview(int portfolioId)
        {
            List <GovtSavingsVo> govtSavingsList = new List <GovtSavingsVo>();
            int count = 0;

            try
            {
                govtSavingsList = govtSavingsBo.GetGovtSavingsNPList(portfolioId, mypager.CurrentPage, hdnSort.Value, out count);
                //if (count > 0)
                //{
                //    lblTotalRows.Text = hdnRecordCount.Value = count.ToString();
                //    tblPager.Visible = true;
                //}

                if (govtSavingsList != null)
                {
                    //lblMsg.Visible = false;
                    tblMessage.Visible            = false;
                    ErrorMessage.Visible          = false;
                    btnExportFilteredData.Visible = true;
                    ErrorMessage.InnerText        = "No Records Found...!";
                    GovtSavingsVo govtSavingsVo;

                    DataTable dtGovtSavings = new DataTable();
                    dtGovtSavings.Columns.Add("SI.No");
                    dtGovtSavings.Columns.Add("GovtSavingId");
                    dtGovtSavings.Columns.Add("Category");
                    dtGovtSavings.Columns.Add("Particulars");
                    dtGovtSavings.Columns.Add("Deposit Date", typeof(DateTime));
                    dtGovtSavings.Columns.Add("Maturity Date", typeof(DateTime));
                    dtGovtSavings.Columns.Add("Deposit Amount", typeof(double));
                    dtGovtSavings.Columns.Add("Rate Of Interest", typeof(double));
                    dtGovtSavings.Columns.Add("Current Value", typeof(double));
                    dtGovtSavings.Columns.Add("Maturity Value", typeof(double));
                    dtGovtSavings.Columns.Add("Amount", typeof(double));
                    dtGovtSavings.Columns.Add("ModeOfPayment");
                    dtGovtSavings.Columns.Add("PaymentInstrumentNumber");
                    dtGovtSavings.Columns.Add("PaymentInstrumentDate", typeof(DateTime));
                    dtGovtSavings.Columns.Add("BankName");
                    dtGovtSavings.Columns.Add("BankBranch");
                    dtGovtSavings.Columns.Add("Nomniee");
                    dtGovtSavings.Columns.Add("JointHolderName");

                    DataRow drGovtSavings;

                    for (int i = 0; i < govtSavingsList.Count; i++)
                    {
                        drGovtSavings    = dtGovtSavings.NewRow();
                        govtSavingsVo    = new GovtSavingsVo();
                        govtSavingsVo    = govtSavingsList[i];
                        drGovtSavings[0] = (i + 1).ToString();
                        drGovtSavings[1] = govtSavingsVo.GoveSavingsPortfolioId.ToString();
                        drGovtSavings[2] = govtSavingsVo.AssetInstrumentCategoryName.ToString();
                        drGovtSavings[3] = govtSavingsVo.Name.ToString();
                        if (govtSavingsVo.PurchaseDate != DateTime.MinValue)
                        {
                            drGovtSavings[4] = govtSavingsVo.PurchaseDate.ToShortDateString().ToString();
                        }
                        if (govtSavingsVo.MaturityDate != DateTime.MinValue)
                        {
                            drGovtSavings[5] = govtSavingsVo.MaturityDate.ToShortDateString().ToString();
                        }
                        //  if (govtSavingsVo.DepositAmt != null)
                        drGovtSavings[6] = govtSavingsVo.DepositAmt.ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"));
                        //if (govtSavingsVo.InterestRate != null)
                        drGovtSavings[7] = govtSavingsVo.InterestRate.ToString();
                        //if (govtSavingsVo.CurrentValue != null)
                        drGovtSavings[8] = govtSavingsVo.CurrentValue.ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"));
                        //if(govtSavingsVo.MaturityValue != null)
                        drGovtSavings[9]  = govtSavingsVo.MaturityValue.ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"));
                        drGovtSavings[10] = govtSavingsVo.Amount.ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"));
                        drGovtSavings[11] = govtSavingsVo.ModeOfPayment.ToString();
                        drGovtSavings[12] = govtSavingsVo.PaymentInstrumentNumber.ToString();
                        if (govtSavingsVo.PaymentInstrumentDate != DateTime.MinValue)
                        {
                            drGovtSavings[13] = govtSavingsVo.PaymentInstrumentDate.ToString();
                        }
                        drGovtSavings[14] = govtSavingsVo.BankName;
                        drGovtSavings[15] = govtSavingsVo.BankBranch;
                        drGovtSavings[16] = govtSavingsVo.Nomniee;
                        drGovtSavings[17] = govtSavingsVo.JontHolderName;
                        dtGovtSavings.Rows.Add(drGovtSavings);
                    }
                    if (dtGovtSavings.Rows.Count > 0)
                    {
                        if (Cache["gvGovtSavings" + customerVo.CustomerId] == null)
                        {
                            Cache.Insert("gvGovtSavings" + customerVo.CustomerId, dtGovtSavings);
                        }
                        else
                        {
                            Cache.Remove("gvGovtSavings" + customerVo.CustomerId);
                            Cache.Insert("gvGovtSavings" + customerVo.CustomerId, dtGovtSavings);
                        }
                        gvGovtSavings.DataSource = dtGovtSavings;
                        gvGovtSavings.DataBind();
                        gvGovtSavings.Visible = true;
                        // this.GetPageCount();
                    }
                }
                else
                {
                    //lblMsg.Visible = true;
                    tblMessage.Visible       = true;
                    ErrorMessage.Visible     = true;
                    ErrorMessage.InnerText   = "No Records Found...!";
                    gvGovtSavings.DataSource = null;
                    gvGovtSavings.DataBind();
                    gvGovtSavings.Visible = false;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "ViewGovtSavings.ascx.cs:LoadGridview()");
                object[] objects = new object[2];
                objects[0]   = govtSavingsList;
                objects[1]   = portfolioId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        protected void gvGovtSaving_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName == RadGrid.UpdateCommandName)
            {
                bool             isUpdated        = false;
                string           relationCode     = string.Empty;
                GridEditableItem gridEditableItem = (GridEditableItem)e.Item;
                e.Canceled = true;
                //gridEditableItem.OwnerTableView.IsItemInserted = false;

                GovtSavingNPId = int.Parse(gvGovtSaving.MasterTableView.DataKeyValues[e.Item.ItemIndex]["CGSNP_GovtSavingNPId"].ToString());
                Button btnGovtSubmit = (Button)e.Item.FindControl("btnGovtSubmit");

                DropDownList ddlDebtIssuerCode       = (DropDownList)e.Item.FindControl("ddlDebtIssuerCode");
                TextBox      txtCurrentValue         = (TextBox)e.Item.FindControl("txtCurrentValue");
                TextBox      txtDepositDate          = (TextBox)e.Item.FindControl("txtDepositDate");
                TextBox      txtMaturityValue        = (TextBox)e.Item.FindControl("txtMaturityValue");
                TextBox      txtMaturityDate         = (TextBox)e.Item.FindControl("txtMaturityDate");
                TextBox      txtDepositAmount        = (TextBox)e.Item.FindControl("txtDepositAmount");
                TextBox      txtInterstRate          = (TextBox)e.Item.FindControl("txtInterstRate");
                DropDownList ddlInterestBasis        = (DropDownList)e.Item.FindControl("ddlInterestBasis");
                DropDownList ddlSimpleInterestFC     = (DropDownList)e.Item.FindControl("ddlSimpleInterestFC");
                DropDownList ddlCompoundInterestFC   = (DropDownList)e.Item.FindControl("ddlCompoundInterestFC");
                TextBox      txtInterestAmtCredited  = (TextBox)e.Item.FindControl("txtInterestAmtCredited");
                TextBox      txtAssetParticulars     = (TextBox)e.Item.FindControl("txtAssetParticulars");
                RadioButton  rbtnAccumulated         = (RadioButton)e.Item.FindControl("rbtnAccumulated");
                TextBox      txtSubsqntDepositAmount = (TextBox)e.Item.FindControl("txtSubsqntDepositAmount");
                TextBox      txtSubsqntDepositDate   = (TextBox)e.Item.FindControl("txtSubsqntDepositDate");
                DropDownList ddlDepositFrequency     = (DropDownList)e.Item.FindControl("ddlDepositFrequency");
                TextBox      txtRemarks       = (TextBox)e.Item.FindControl("txtRemarks");
                TextBox      txtAccOpenDate   = (TextBox)e.Item.FindControl("txtAccOpenDate");
                TextBox      txtAccountWith   = (TextBox)e.Item.FindControl("txtAccountWith");
                TextBox      txtAccountNumber = (TextBox)e.Item.FindControl("txtAccountNumber");


                Button             btnAcctInsert = (Button)e.Item.FindControl("btnAcctInsert");
                CustomerAccountsVo newAccountVo  = new CustomerAccountsVo();
                if (btnGovtSubmit.Visible == true)
                {
                    customerAccountsVo        = (CustomerAccountsVo)Session["customerAccountVo"];
                    Session["govtSavingsVo"]  = govtSavingsBo.GetGovtSavingsDetails(GovtSavingNPId);
                    govtSavingsVo             = (GovtSavingsVo)Session["govtSavingsVo"];
                    govtSavingsVo.PortfolioId = govtSavingsVo.GoveSavingsPortfolioId;
                    if (ddlDebtIssuerCode != null && ddlDebtIssuerCode.SelectedItem.Value != string.Empty)
                    {
                        govtSavingsVo.DebtIssuerCode = ddlDebtIssuerCode.SelectedItem.Value.ToString();
                    }

                    govtSavingsVo.Name = txtAssetParticulars.Text;

                    if (txtCurrentValue != null && txtCurrentValue.Text != "")
                    {
                        govtSavingsVo.CurrentValue = float.Parse(txtCurrentValue.Text);
                    }



                    if (txtDepositDate != null && txtDepositDate.Text != "")
                    {
                        govtSavingsVo.PurchaseDate = DateTime.Parse(txtDepositDate.Text.ToString());
                    }

                    if (txtMaturityValue != null && txtMaturityValue.Text != "")
                    {
                        govtSavingsVo.MaturityValue = float.Parse(txtMaturityValue.Text);
                    }
                    if (txtMaturityDate != null && txtMaturityDate.Text != "")
                    {
                        govtSavingsVo.MaturityDate = DateTime.Parse(txtMaturityDate.Text.ToString());
                    }
                    if (txtDepositAmount != null && txtDepositAmount.Text != "")
                    {
                        govtSavingsVo.DepositAmt = float.Parse(txtDepositAmount.Text);
                    }
                    if (txtInterstRate != null && txtInterstRate.Text != "")
                    {
                        govtSavingsVo.InterestRate = float.Parse(txtInterstRate.Text);
                    }
                    if (ddlInterestBasis != null)
                    {
                        govtSavingsVo.InterestBasisCode = ddlInterestBasis.SelectedItem.Value.ToString();
                    }

                    if (govtSavingsVo.InterestBasisCode == "SI")
                    {
                        govtSavingsVo.InterestPayableFrequencyCode  = ddlSimpleInterestFC.SelectedItem.Value.ToString();
                        govtSavingsVo.CompoundInterestFrequencyCode = "NA";
                    }
                    else if (govtSavingsVo.InterestBasisCode == "CI")
                    {
                        govtSavingsVo.InterestPayableFrequencyCode  = "NA";
                        govtSavingsVo.CompoundInterestFrequencyCode = ddlCompoundInterestFC.SelectedItem.Value.ToString();
                    }
                    else
                    {
                        govtSavingsVo.InterestBasisCode = null;
                    }

                    if (rbtnAccumulated.Checked)
                    {
                        govtSavingsVo.IsInterestAccumalated = 1;
                        if (txtInterestAmtCredited != null && txtInterestAmtCredited.Text != string.Empty)
                        {
                            govtSavingsVo.InterestAmtAccumalated = float.Parse(txtInterestAmtCredited.Text);
                        }
                        govtSavingsVo.InterestAmtPaidOut = 0;
                    }
                    else
                    {
                        govtSavingsVo.IsInterestAccumalated = 0;
                        if (txtInterestAmtCredited != null && txtInterestAmtCredited.Text != string.Empty)
                        {
                            govtSavingsVo.InterestAmtPaidOut = float.Parse(txtInterestAmtCredited.Text);
                        }
                        govtSavingsVo.InterestAmtAccumalated = 0;
                    }

                    //Post Office Recurring Deposit Account- Subsequent deposit details
                    if (govtSavingsVo.AssetInstrumentCategoryCode != null && govtSavingsVo.AssetInstrumentCategoryCode.ToString().Trim() == "GSRD")
                    {
                        if (txtSubsqntDepositAmount != null && txtSubsqntDepositAmount.Text != string.Empty)
                        {
                            govtSavingsVo.SubsqntDepositAmount = float.Parse(txtSubsqntDepositAmount.Text.Trim());
                        }
                        if (txtSubsqntDepositDate != null && txtSubsqntDepositDate.Text != string.Empty)
                        {
                            govtSavingsVo.SubsqntDepositDate = Convert.ToDateTime(txtSubsqntDepositDate.Text);
                        }

                        if (ddlDepositFrequency != null && ddlDepositFrequency.SelectedValue != string.Empty)
                        {
                            govtSavingsVo.DepositFrequencyCode = ddlDepositFrequency.SelectedValue;
                        }
                    }

                    govtSavingsVo.Remarks = txtRemarks.Text;
                    govtSavingsBo.UpdateGovtSavingsNP(govtSavingsVo, userVo.UserId);
                }
                else if (btnAcctInsert.Visible == true)
                {
                }
            }
            if (e.CommandName == RadGrid.PerformInsertCommandName)
            {
                int              i                = 0;
                bool             blResult         = false;
                GridEditableItem gridEditableItem = (GridEditableItem)e.Item;

                Button btnAcctInsert = (Button)e.Item.FindControl("btnAcctInsert");

                //gridEditableItem.OwnerTableView.IsItemInserted = false;

                if (hdnCondition.Value != "1")
                {
                    gvGovtSaving.MasterTableView.IsItemInserted = true;
                    e.Item.Edit        = true;
                    e.Canceled         = true;
                    hdnCondition.Value = "1";
                }
                else
                {
                    gvGovtSaving.MasterTableView.IsItemInserted = false;
                    e.Item.Edit        = false;
                    e.Canceled         = false;
                    hdnCondition.Value = "0";
                }



                //Account details control defined........
                TextBox      txtAccountNumber      = (TextBox)e.Item.FindControl("txtAccountNumber");
                DropDownList ddlCategory           = (DropDownList)e.Item.FindControl("ddlCategory");
                RadioButton  rbtnNo                = (RadioButton)e.Item.FindControl("rbtnNo");
                RadioButton  rbtnYes               = (RadioButton)e.Item.FindControl("rbtnYes");
                DropDownList ddlModeOfHolding      = (DropDownList)e.Item.FindControl("ddlModeOfHolding");
                TextBox      txtAccountSource      = (TextBox)e.Item.FindControl("txtAccountSource");
                RadGrid      gvJointHoldersList    = (RadGrid)e.Item.FindControl("gvJointHoldersList");
                TextBox      txtAccOpenDate        = (TextBox)e.Item.FindControl("txtAccOpenDate");
                TextBox      txtAccountId          = (TextBox)e.Item.FindControl("txtAccountId");
                TextBox      txtAccountWith        = (TextBox)e.Item.FindControl("txtAccountWith");
                Label        lblInstrumentCategory = (Label)e.Item.FindControl("lblInstrumentCategory");


                //Govt saving control defined........


                Button             btnGovtSubmit           = (Button)e.Item.FindControl("btnGovtSubmit");
                DropDownList       ddlDebtIssuerCode       = (DropDownList)e.Item.FindControl("ddlDebtIssuerCode");
                TextBox            txtCurrentValue         = (TextBox)e.Item.FindControl("txtCurrentValue");
                TextBox            txtDepositDate          = (TextBox)e.Item.FindControl("txtDepositDate");
                TextBox            txtMaturityValue        = (TextBox)e.Item.FindControl("txtMaturityValue");
                TextBox            txtMaturityDate         = (TextBox)e.Item.FindControl("txtMaturityDate");
                TextBox            txtDepositAmount        = (TextBox)e.Item.FindControl("txtDepositAmount");
                TextBox            txtInterstRate          = (TextBox)e.Item.FindControl("txtInterstRate");
                DropDownList       ddlInterestBasis        = (DropDownList)e.Item.FindControl("ddlInterestBasis");
                DropDownList       ddlSimpleInterestFC     = (DropDownList)e.Item.FindControl("ddlSimpleInterestFC");
                DropDownList       ddlCompoundInterestFC   = (DropDownList)e.Item.FindControl("ddlCompoundInterestFC");
                TextBox            txtInterestAmtCredited  = (TextBox)e.Item.FindControl("txtInterestAmtCredited");
                TextBox            txtAssetParticulars     = (TextBox)e.Item.FindControl("txtAssetParticulars");
                RadioButton        rbtnAccumulated         = (RadioButton)e.Item.FindControl("rbtnAccumulated");
                TextBox            txtSubsqntDepositAmount = (TextBox)e.Item.FindControl("txtSubsqntDepositAmount");
                TextBox            txtSubsqntDepositDate   = (TextBox)e.Item.FindControl("txtSubsqntDepositDate");
                DropDownList       ddlDepositFrequency     = (DropDownList)e.Item.FindControl("ddlDepositFrequency");
                TextBox            txtRemarks            = (TextBox)e.Item.FindControl("txtRemarks");
                HtmlGenericControl divGovtSavings        = (HtmlGenericControl)e.Item.FindControl("divGovtSavings");
                DropDownList       ddlgovtModeofHoldings = (DropDownList)e.Item.FindControl("ddlgovtModeofHoldings");

                CustomerAccountsVo customerAccountsVo = new CustomerAccountsVo();
                //divGovtSavings.Visible = true;
                HtmlGenericControl divAccout = (HtmlGenericControl)e.Item.FindControl("divAccout");


                if (btnAcctInsert.Visible == true)
                {
                    customerAccountsVo.AssetClass    = "GS";
                    customerAccountsVo.AccountNum    = txtAccountNumber.Text;
                    customerAccountsVo.AssetCategory = ddlCategory.SelectedItem.Value.ToString();
                    customerAccountsVo.CustomerId    = customerVo.CustomerId;
                    customerAccountsVo.PortfolioId   = int.Parse(ddlPortfolio.SelectedItem.Value.ToString());;
                    if (rbtnNo.Checked)
                    {
                        customerAccountsVo.IsJointHolding = 0;
                    }
                    if (rbtnYes.Checked)
                    {
                        customerAccountsVo.IsJointHolding = 1;
                    }
                    customerAccountsVo.ModeOfHolding = ddlModeOfHolding.SelectedItem.Value.ToString();
                    customerAccountsVo.AccountSource = txtAccountSource.Text;
                    accountId = customerAccountBo.CreateCustomerGovtSavingAccount(customerAccountsVo, userVo.UserId);
                    customerAccountsVo.AccountId = accountId;

                    customerAccountAssociationVo.AccountId  = accountId;
                    customerAccountAssociationVo.CustomerId = customerVo.CustomerId;
                    foreach (GridDataItem gvRow in gvJointHoldersList.Items)
                    {
                        CheckBox chk = (CheckBox)gvRow.FindControl("cbRecons");
                        if (chk.Checked)
                        {
                            i++;
                        }
                    }
                    if (i != 0)
                    {
                        //    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Please select a record!');", true);
                        //}
                        //else
                        //{
                        foreach (GridDataItem gdi in gvJointHoldersList.Items)
                        {
                            if (((CheckBox)gdi.FindControl("cbRecons")).Checked == true)
                            {
                                int selectedRow = gdi.ItemIndex + 1;
                                customerAccountAssociationVo.AssociationId   = Convert.ToInt32(gvJointHoldersList.MasterTableView.DataKeyValues[selectedRow - 1]["AssociationId"].ToString());
                                customerAccountAssociationVo.AssociationType = "Joint Holder";
                                customerAccountBo.CreateGovtSavingsAccountAssociation(customerAccountAssociationVo, userVo.UserId);
                            }
                        }
                    }

                    if (blResult)
                    {
                        Session["customerAccountVo"] = customerAccountsVo;
                    }
                    if (customerAccountsVo.AccountOpeningDate != DateTime.MinValue)
                    {
                        txtAccOpenDate.Text = customerAccountsVo.AccountOpeningDate.ToShortDateString();
                    }
                    txtAccountId.Text = customerAccountsVo.AccountNum.ToString();
                    if (customerAccountsVo.AccountSource != null)
                    {
                        txtAccountWith.Text = customerAccountsVo.AccountSource.ToString();
                    }
                    if (customerAccountsVo.AssetCategory != null)
                    {
                        lblInstrumentCategory.Text = customerAccountsVo.AssetCategory.ToString();
                    }
                    ddlModeOfHolding.SelectedValue      = customerAccountsVo.ModeOfHolding.Trim();
                    ddlgovtModeofHoldings.SelectedValue = customerAccountsVo.ModeOfHolding.Trim();
                    Session["customerAccountVo"]        = customerAccountsVo;
                    divGovtSavings.Visible = true;
                    btnAcctInsert.Visible  = false;
                    btnGovtSubmit.Visible  = true;
                }
                else if (btnGovtSubmit.Visible == true)
                {
                    customerAccountsVo           = (CustomerAccountsVo)Session["customerAccountVo"];
                    customerAccountsVo.AccountId = customerAccountsVo.AccountId;//Convert.ToInt32(txtAccountId.Text);
                    if (txtAccOpenDate != null && txtAccOpenDate.Text != string.Empty)
                    {
                        customerAccountsVo.AccountOpeningDate = Convert.ToDateTime(txtAccOpenDate.Text);
                    }

                    customerAccountsVo.AccountSource = txtAccountWith.Text;
                    govtSavingsVo.PortfolioId        = customerAccountsVo.PortfolioId;
                    govtSavingsVo.AccountId          = customerAccountsVo.AccountId;
                    govtSavingsVo.AssetGroupCode     = customerAccountsVo.AssetClass;

                    govtSavingsVo.AssetInstrumentCategoryCode = customerAccountsVo.AssetCategory;

                    if (ddlDebtIssuerCode != null && ddlDebtIssuerCode.SelectedItem.Value != string.Empty)
                    {
                        govtSavingsVo.DebtIssuerCode = ddlDebtIssuerCode.SelectedItem.Value.ToString();
                    }

                    govtSavingsVo.Name = txtAssetParticulars.Text;

                    if (txtCurrentValue != null && txtCurrentValue.Text != "")
                    {
                        govtSavingsVo.CurrentValue = float.Parse(txtCurrentValue.Text);
                    }



                    if (txtDepositDate != null && txtDepositDate.Text != "")
                    {
                        govtSavingsVo.PurchaseDate = DateTime.Parse(txtDepositDate.Text.ToString());
                    }

                    if (txtMaturityValue != null && txtMaturityValue.Text != "")
                    {
                        govtSavingsVo.MaturityValue = float.Parse(txtMaturityValue.Text);
                    }
                    if (txtMaturityDate != null && txtMaturityDate.Text != "")
                    {
                        govtSavingsVo.MaturityDate = DateTime.Parse(txtMaturityDate.Text.ToString());
                    }
                    if (txtDepositAmount != null && txtDepositAmount.Text != "")
                    {
                        govtSavingsVo.DepositAmt = float.Parse(txtDepositAmount.Text);
                    }
                    if (txtInterstRate != null && txtInterstRate.Text != "")
                    {
                        govtSavingsVo.InterestRate = float.Parse(txtInterstRate.Text);
                    }
                    if (ddlInterestBasis != null)
                    {
                        govtSavingsVo.InterestBasisCode = ddlInterestBasis.SelectedItem.Value.ToString();
                    }

                    if (govtSavingsVo.InterestBasisCode == "SI")
                    {
                        govtSavingsVo.InterestPayableFrequencyCode  = ddlSimpleInterestFC.SelectedItem.Value.ToString();
                        govtSavingsVo.CompoundInterestFrequencyCode = "NA";
                    }
                    else if (govtSavingsVo.InterestBasisCode == "CI")
                    {
                        govtSavingsVo.InterestPayableFrequencyCode  = "NA";
                        govtSavingsVo.CompoundInterestFrequencyCode = ddlCompoundInterestFC.SelectedItem.Value.ToString();
                    }
                    else
                    {
                        govtSavingsVo.InterestBasisCode = null;
                    }

                    if (rbtnAccumulated.Checked)
                    {
                        govtSavingsVo.IsInterestAccumalated = 1;
                        if (txtInterestAmtCredited != null && txtInterestAmtCredited.Text != string.Empty)
                        {
                            govtSavingsVo.InterestAmtAccumalated = float.Parse(txtInterestAmtCredited.Text);
                        }
                        govtSavingsVo.InterestAmtPaidOut = 0;
                    }
                    else
                    {
                        govtSavingsVo.IsInterestAccumalated = 0;
                        if (txtInterestAmtCredited != null && txtInterestAmtCredited.Text != string.Empty)
                        {
                            govtSavingsVo.InterestAmtPaidOut = float.Parse(txtInterestAmtCredited.Text);
                        }
                        govtSavingsVo.InterestAmtAccumalated = 0;
                    }

                    //Post Office Recurring Deposit Account- Subsequent deposit details
                    if (customerAccountsVo.AssetCategory != null && customerAccountsVo.AssetCategory.ToString().Trim() == "GSRD")
                    {
                        if (txtSubsqntDepositAmount != null && txtSubsqntDepositAmount.Text != string.Empty)
                        {
                            govtSavingsVo.SubsqntDepositAmount = float.Parse(txtSubsqntDepositAmount.Text.Trim());
                        }
                        if (txtSubsqntDepositDate != null && txtSubsqntDepositDate.Text != string.Empty)
                        {
                            govtSavingsVo.SubsqntDepositDate = Convert.ToDateTime(txtSubsqntDepositDate.Text);
                        }

                        if (ddlDepositFrequency != null && ddlDepositFrequency.SelectedValue != string.Empty)
                        {
                            govtSavingsVo.DepositFrequencyCode = ddlDepositFrequency.SelectedValue;
                        }
                    }

                    govtSavingsVo.Remarks = txtRemarks.Text;
                    bool bResult = govtSavingsBo.CreateGovtSavingsNP(govtSavingsVo, userVo.UserId);
                    //btnAcctInsert.Visible = true;
                    //btnGovtSubmit.Visible = false;
                    BindGovtSavingGrid();
                }
                divAccout.Visible = false;
                //gridEditableItem.OwnerTableView.IsItemInserted = false;
                divGovtSavings.Visible = true;
            }
            if (e.CommandName == "Delete")
            {
                GovtSavingNPId = int.Parse(gvGovtSaving.MasterTableView.DataKeyValues[e.Item.ItemIndex]["CGSNP_GovtSavingNPId"].ToString());
                govtSavingsBo.DeleteGovtSavingsPortfolio(GovtSavingNPId);
                BindGovtSavingGrid();
            }
            // BindGovtSavingGrid();
        }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.DataBind();
            //cvAccopenDateCheckCurrent.ValueToCompare = DateTime.Now.ToShortDateString();
            try
            {
                // cvDepositDate1.ValueToCompare = DateTime.Now.ToShortDateString();
                path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"]).ToString();
                setMode(); //Set Add/Edit/View Mode based on the query string parameter.

                if (Session[SessionContents.PortfolioId] != null)
                {
                    portfolioId = int.Parse(Session[SessionContents.PortfolioId].ToString());
                }

                userVo     = (UserVo)Session["userVo"];
                customerVo = (CustomerVo)Session["customerVo"];

                if (!Page.IsPostBack)
                {
                    if (userVo == null || customerVo == null || portfolioId == 0 || customerAccountsVo == null || govtSavingsVo == null)
                    {
                        //Invalid data. Write redirect code here. or show error message.
                    }
                    if (mode == Mode.Edit)
                    {
                        govtSavingsVo = (GovtSavingsVo)Session["govtSavingsVo"];
                        if (govtSavingsVo != null)
                        {
                            customerAccountsVo = customerAccountBo.GetGovtSavingsAccount(govtSavingsVo.AccountId);
                        }
                        Session["customerAccountVo"] = customerAccountsVo;
                        GetData();
                        LoadDropdownValues();
                        SetFields();
                        SetValues();
                        lnkEdit.Visible        = false;
                        btnSubmit.Visible      = false;
                        btnSaveChanges.Visible = true;
                    }
                    else if (mode == Mode.View)
                    {
                        govtSavingsVo = (GovtSavingsVo)Session["govtSavingsVo"];
                        if (govtSavingsVo != null)
                        {
                            customerAccountsVo = customerAccountBo.GetGovtSavingsAccount(govtSavingsVo.AccountId);
                        }

                        GetData();
                        LoadDropdownValues();
                        SetFields();
                        SetValues();

                        btnSubmit.Visible      = false;
                        btnSaveChanges.Visible = false;
                        lnkEdit.Visible        = true;
                        DisableControls(this);
                    }
                    else if (mode == Mode.Add)
                    {
                        customerAccountsVo = (CustomerAccountsVo)Session["customerAccountVo"];
                        LoadDropdownValues();
                        SetFields();
                        btnSubmit.Visible      = true;
                        btnSaveChanges.Visible = false;
                        lnkEdit.Visible        = false;
                    }
                }
                else
                {
                    if (mode == Mode.Add)
                    {
                        customerAccountsVo = (CustomerAccountsVo)Session["customerAccountVo"];
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "PortfolioGovtSavingsEntry.ascx:Page_Load()");
                object[] objects = new object[6];
                objects[0]   = userVo;
                objects[1]   = customerVo;
                objects[2]   = portfolioId;
                objects[3]   = customerAccountsVo;
                objects[4]   = command;
                objects[5]   = path;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
コード例 #7
0
        /// <summary>
        /// Read the user entered values from fields and assign it to GovtSavingsVo object.
        /// </summary>
        /// <returns></returns>
        private GovtSavingsVo GetValuesFromFields()
        {
            GovtSavingsVo newGovtSavingsVo = new GovtSavingsVo();

            try
            {
                customerAccountsVo           = (CustomerAccountsVo)Session["customerAccountVo"];
                customerAccountsVo.AccountId = customerAccountsVo.AccountId;//Convert.ToInt32(txtAccountId.Text);
                if (txtAccOpenDate != null && txtAccOpenDate.Text != string.Empty)
                {
                    customerAccountsVo.AccountOpeningDate = Convert.ToDateTime(txtAccOpenDate.Text);
                }

                customerAccountsVo.AccountSource = txtAccountWith.Text;
                //If Edit, get the Id of  govt savings net data.
                if (mode == Mode.Edit)
                {
                    GovtSavingsVo govtSavngs = (GovtSavingsVo)Session["govtSavingsVo"];
                    newGovtSavingsVo.GoveSavingsPortfolioId = govtSavngs.GoveSavingsPortfolioId;
                }
                newGovtSavingsVo.PortfolioId    = customerAccountsVo.PortfolioId;
                newGovtSavingsVo.AccountId      = customerAccountsVo.AccountId;
                newGovtSavingsVo.AssetGroupCode = customerAccountsVo.AssetClass;
                newGovtSavingsVo.AssetInstrumentCategoryCode = customerAccountsVo.AssetCategory;

                if (ddlDebtIssuerCode != null && ddlDebtIssuerCode.SelectedItem.Value != string.Empty)
                {
                    newGovtSavingsVo.DebtIssuerCode = ddlDebtIssuerCode.SelectedItem.Value.ToString();
                }

                newGovtSavingsVo.Name = txtAssetParticulars.Text;

                if (txtCurrentValue != null && txtCurrentValue.Text != "")
                {
                    newGovtSavingsVo.CurrentValue = float.Parse(txtCurrentValue.Text);
                }



                if (txtDepositDate != null && txtDepositDate.Text != "")
                {
                    newGovtSavingsVo.PurchaseDate = DateTime.Parse(txtDepositDate.Text.ToString());
                }

                if (txtMaturityValue != null && txtMaturityValue.Text != "")
                {
                    newGovtSavingsVo.MaturityValue = float.Parse(txtMaturityValue.Text);
                }
                if (txtMaturityDate != null && txtMaturityDate.Text != "")
                {
                    newGovtSavingsVo.MaturityDate = DateTime.Parse(txtMaturityDate.Text.ToString());
                }
                if (txtDepositAmount != null && txtDepositAmount.Text != "")
                {
                    newGovtSavingsVo.DepositAmt = float.Parse(txtDepositAmount.Text);
                }
                if (txtInterstRate != null && txtInterstRate.Text != "")
                {
                    newGovtSavingsVo.InterestRate = float.Parse(txtInterstRate.Text);
                }
                if (ddlInterestBasis != null)
                {
                    newGovtSavingsVo.InterestBasisCode = ddlInterestBasis.SelectedItem.Value.ToString();
                }
                if (txtAmount != null && txtAmount.Text != "")
                {
                    newGovtSavingsVo.Amount = float.Parse(txtAmount.Text);
                }
                if (ddlPaymentMode != null)
                {
                    newGovtSavingsVo.ModeOfPayment = ddlPaymentMode.SelectedItem.Value.ToString();
                }
                if (txtPaymentNumber != null && txtPaymentNumber.Text != "")
                {
                    newGovtSavingsVo.PaymentInstrumentNumber = txtPaymentNumber.Text;
                }
                if (txtPaymentInstDate.SelectedDate != DateTime.MinValue)
                {
                    newGovtSavingsVo.PaymentInstrumentDate = Convert.ToDateTime(txtPaymentInstDate.SelectedDate);
                }
                if (txtBranchName != null && txtBranchName.Text != "")
                {
                    newGovtSavingsVo.BankBranch = txtBranchName.Text;
                }
                //if (ddlBankName != null && ddlBankName.SelectedValue !="")
                //    newGovtSavingsVo.BankName = ddlBankName.SelectedValue.ToString();
                //    newGovtSavingsVo.bankcode = int.Parse(ddlBankName.SelectedValue);

                if (newGovtSavingsVo.InterestBasisCode == "SI")
                {
                    newGovtSavingsVo.InterestPayableFrequencyCode  = ddlSimpleInterestFC.SelectedItem.Value.ToString();
                    newGovtSavingsVo.CompoundInterestFrequencyCode = "NA";
                }
                else if (newGovtSavingsVo.InterestBasisCode == "CI")
                {
                    newGovtSavingsVo.InterestPayableFrequencyCode  = "NA";
                    newGovtSavingsVo.CompoundInterestFrequencyCode = ddlCompoundInterestFC.SelectedItem.Value.ToString();
                }
                else
                {
                    newGovtSavingsVo.InterestBasisCode = null;
                }

                if (rbtnAccumulated.Checked)
                {
                    newGovtSavingsVo.IsInterestAccumalated = 1;
                    if (txtInterestAmtCredited != null && txtInterestAmtCredited.Text != string.Empty)
                    {
                        newGovtSavingsVo.InterestAmtAccumalated = float.Parse(txtInterestAmtCredited.Text);
                    }
                    newGovtSavingsVo.InterestAmtPaidOut = 0;
                }
                else
                {
                    newGovtSavingsVo.IsInterestAccumalated = 0;
                    if (txtInterestAmtCredited != null && txtInterestAmtCredited.Text != string.Empty)
                    {
                        newGovtSavingsVo.InterestAmtPaidOut = float.Parse(txtInterestAmtCredited.Text);
                    }
                    newGovtSavingsVo.InterestAmtAccumalated = 0;
                }

                //Post Office Recurring Deposit Account- Subsequent deposit details
                if (customerAccountsVo.AssetCategory != null && customerAccountsVo.AssetCategory.ToString().Trim() == "GSRD")
                {
                    if (txtSubsqntDepositAmount != null && txtSubsqntDepositAmount.Text != string.Empty)
                    {
                        newGovtSavingsVo.SubsqntDepositAmount = float.Parse(txtSubsqntDepositAmount.Text.Trim());
                    }
                    if (txtSubsqntDepositDate != null && txtSubsqntDepositDate.Text != string.Empty)
                    {
                        newGovtSavingsVo.SubsqntDepositDate = Convert.ToDateTime(txtSubsqntDepositDate.Text);
                    }

                    if (ddlDepositFrequency != null && ddlDepositFrequency.SelectedValue != string.Empty)
                    {
                        newGovtSavingsVo.DepositFrequencyCode = ddlDepositFrequency.SelectedValue;
                    }
                }

                newGovtSavingsVo.Remarks = txtRemarks.Text;
                return(newGovtSavingsVo);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "PortfolioGovtSavingsEntry.ascx:GetValuesFromFields()");
                object[] objects = new object[3];
                //objects[0] = govtSavingsVo;
                //objects[1] = customerAccountsVo;
                //objects[2] = userVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
コード例 #8
0
 /// <summary>
 /// Get the Govt Savings related data for the particular Id
 /// </summary>
 private void GetData()
 {
     govtSavingsVo      = (GovtSavingsVo)Session["govtSavingsVo"];
     customerAccountsVo = customerAccountBo.GetGovtSavingsAccount(govtSavingsVo.AccountId);
 }
コード例 #9
0
        public GovtSavingsVo GetGovtSavingsDetails(int govtSavingsNPId)
        {
            GovtSavingsVo govtSavingsVo = null;
            Database      db;
            DbCommand     getGovtSavingsListCmd;
            DataSet       dsGovtSavings;
            DataRow       dr;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                getGovtSavingsListCmd = db.GetStoredProcCommand("SP_GetGovtSavingsDetails");
                db.AddInParameter(getGovtSavingsListCmd, "@CGSNP_GovtSavingNPId", DbType.Int16, govtSavingsNPId);
                dsGovtSavings = db.ExecuteDataSet(getGovtSavingsListCmd);
                if (dsGovtSavings.Tables[0].Rows.Count > 0)
                {
                    dr            = dsGovtSavings.Tables[0].Rows[0];
                    govtSavingsVo = new GovtSavingsVo();
                    govtSavingsVo.GoveSavingsPortfolioId = int.Parse(dr["CGSNP_GovtSavingNPId"].ToString());
                    govtSavingsVo.AccountId = int.Parse(dr["CGSA_AccountId"].ToString());
                    govtSavingsVo.AssetInstrumentCategoryCode = dr["PAIC_AssetInstrumentCategoryCode"].ToString();
                    govtSavingsVo.AssetGroupCode = dr["PAG_AssetGroupCode"].ToString();
                    govtSavingsVo.DebtIssuerCode = dr["XDI_DebtIssuerCode"].ToString();
                    govtSavingsVo.InterestPayableFrequencyCode  = dr["XF_InterestPayableFrequencyCode"].ToString();
                    govtSavingsVo.CompoundInterestFrequencyCode = dr["XF_CompoundInterestFrequencyCode"].ToString();
                    govtSavingsVo.InterestRate = float.Parse(dr["CGSNP_InterestRate"].ToString());
                    govtSavingsVo.Name         = dr["CGSNP_Name"].ToString();
                    govtSavingsVo.AssetInstrumentCategoryName = dr["PAIC_AssetInstrumentCategoryName"].ToString();
                    if (dr["CGSNP_Amount"] != DBNull.Value)
                    {
                        govtSavingsVo.Amount = float.Parse(dr["CGSNP_Amount"].ToString());
                    }
                    //  govtSavingsVo.Quantity = float.Parse(dr["CIGSP_Quantity"].ToString());
                    if (dr["CGSNP_PurchaseDate"] != DBNull.Value)
                    {
                        govtSavingsVo.PurchaseDate = DateTime.Parse(dr["CGSNP_PurchaseDate"].ToString());
                    }
                    if (dr["CGSNP_DepositAmount"] != DBNull.Value)
                    {
                        govtSavingsVo.DepositAmt = float.Parse(dr["CGSNP_DepositAmount"].ToString());
                    }
                    if (dr["CGSNP_MaturityDate"] != DBNull.Value)
                    {
                        govtSavingsVo.MaturityDate = DateTime.Parse(dr["CGSNP_MaturityDate"].ToString());
                    }
                    if (dr["CGSNP_SubsqntDepositAmount"] != DBNull.Value)
                    {
                        govtSavingsVo.SubsqntDepositAmount = float.Parse(dr["CGSNP_SubsqntDepositAmount"].ToString());
                    }
                    if (dr["XF_DepositFrequencyCode"] != DBNull.Value)
                    {
                        govtSavingsVo.DepositFrequencyCode = dr["XF_DepositFrequencyCode"].ToString();
                    }

                    if (dr["CGSNP_SubsqntDepositDate"] != DBNull.Value)
                    {
                        govtSavingsVo.SubsqntDepositDate = DateTime.Parse(dr["CGSNP_SubsqntDepositDate"].ToString());
                    }
                    if (dr["CGSNP_MaturityValue"] != DBNull.Value)
                    {
                        govtSavingsVo.MaturityValue = float.Parse(dr["CGSNP_MaturityValue"].ToString());
                    }
                    if (dr["CGSNP_CurrentValue"] != DBNull.Value)
                    {
                        govtSavingsVo.CurrentValue = float.Parse(dr["CGSNP_CurrentValue"].ToString());
                    }
                    govtSavingsVo.InterestBasisCode = dr["XIB_InterestBasisCode"].ToString();
                    if (dr["CGSNP_IsInterestAccumalated"] != DBNull.Value)
                    {
                        govtSavingsVo.IsInterestAccumalated = int.Parse(dr["CGSNP_IsInterestAccumalated"].ToString());
                    }
                    if (dr["CGSNP_InterestAmtAccumalated"] != DBNull.Value)
                    {
                        govtSavingsVo.InterestAmtAccumalated = float.Parse(dr["CGSNP_InterestAmtAccumalated"].ToString());
                    }
                    if (dr["CGSNP_InterestAmtPaidOut"] != DBNull.Value)
                    {
                        govtSavingsVo.InterestAmtPaidOut = float.Parse(dr["CGSNP_InterestAmtPaidOut"].ToString());
                    }

                    if (dr["CGSNP_Amount"] != DBNull.Value)
                    {
                        govtSavingsVo.Amount = float.Parse(dr["CGSNP_Amount"].ToString());
                    }

                    govtSavingsVo.ModeOfPayment           = dr["CGSNP_ModeOfPayment"].ToString();
                    govtSavingsVo.PaymentInstrumentNumber = dr["CGSNP_PaymentInstrumentNumber"].ToString();
                    if (dr["CGSNP_PaymentInstrumentDate"] != DBNull.Value && dr["CGSNP_PaymentInstrumentDate"] != "")
                    {
                        govtSavingsVo.PaymentInstrumentDate = DateTime.Parse(dr["CGSNP_PaymentInstrumentDate"].ToString());
                    }
                    if (dr["CGSNP_BankName"] != DBNull.Value)
                    {
                        govtSavingsVo.BankName = dr["CGSNP_BankName"].ToString();
                    }
                    govtSavingsVo.BankBranch = dr["CGSNP_BankBranch"].ToString();
                    govtSavingsVo.Remarks    = dr["CGSNP_Remark"].ToString();
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "GovtSavingsDao.cs:GetGovtSavingsDetails()");


                object[] objects = new object[1];
                objects[0] = govtSavingsNPId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(govtSavingsVo);
        }
コード例 #10
0
        public bool UpdateGovtSavingsNP(GovtSavingsVo govtSavingsVo, int userId)
        {
            bool      bResult = false;
            Database  db;
            DbCommand updateGovtSavingsPortfolioCmd;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                updateGovtSavingsPortfolioCmd = db.GetStoredProcCommand("SP_UpdateGovtSavingsNP");
                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_GovtSavingNPId", DbType.Int32, govtSavingsVo.GoveSavingsPortfolioId);
                if (govtSavingsVo.DebtIssuerCode != "0")
                {
                    db.AddInParameter(updateGovtSavingsPortfolioCmd, "@XDI_DebtIssuerCode", DbType.String, govtSavingsVo.DebtIssuerCode);
                }
                if (govtSavingsVo.InterestBasisCode != "0")
                {
                    db.AddInParameter(updateGovtSavingsPortfolioCmd, "@XIB_InterestBasisCode", DbType.String, govtSavingsVo.InterestBasisCode);
                }
                if (govtSavingsVo.CompoundInterestFrequencyCode != "0")
                {
                    db.AddInParameter(updateGovtSavingsPortfolioCmd, "@XF_CompoundInterestFrequencyCode", DbType.String, govtSavingsVo.CompoundInterestFrequencyCode);
                }

                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@XF_InterestPayableFrequencyCode", DbType.String, govtSavingsVo.InterestPayableFrequencyCode);
                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_Name", DbType.String, govtSavingsVo.Name);
                if (govtSavingsVo.PurchaseDate != DateTime.MinValue)
                {
                    db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_PurchaseDate", DbType.Date, govtSavingsVo.PurchaseDate);
                }
                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_CurrentValue", DbType.Double, govtSavingsVo.CurrentValue);
                if (govtSavingsVo.MaturityDate != DateTime.MinValue)
                {
                    db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_MaturityDate", DbType.Date, govtSavingsVo.MaturityDate);
                }
                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_DepositAmount", DbType.Double, govtSavingsVo.DepositAmt);
                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_MaturityValue", DbType.Double, govtSavingsVo.MaturityValue);
                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_IsInterestAccumalated", DbType.Int32, govtSavingsVo.IsInterestAccumalated);
                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_InterestAmtAccumalated", DbType.Double, govtSavingsVo.InterestAmtAccumalated);
                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_InterestAmtPaidOut", DbType.Double, govtSavingsVo.InterestAmtPaidOut);
                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_InterestRate", DbType.Double, govtSavingsVo.InterestRate);

                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_SubsqntDepositAmount", DbType.Decimal, govtSavingsVo.SubsqntDepositAmount);
                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_Amount", DbType.Decimal, govtSavingsVo.Amount);
                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_ModeOfPayment", DbType.String, govtSavingsVo.ModeOfPayment);
                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_PaymentInstrumentNumber", DbType.String, govtSavingsVo.PaymentInstrumentNumber);
                if (govtSavingsVo.PaymentInstrumentDate != DateTime.MinValue)
                {
                    db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_PaymentInstrumentDate", DbType.DateTime, govtSavingsVo.PaymentInstrumentDate);
                }
                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_BankName", DbType.Int32, govtSavingsVo.BankName);
                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_BankBranch", DbType.String, govtSavingsVo.BankBranch);
                if (govtSavingsVo.SubsqntDepositDate != DateTime.MinValue)
                {
                    db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_SubsqntDepositDate", DbType.Date, govtSavingsVo.SubsqntDepositDate);
                }

                if (govtSavingsVo.DepositFrequencyCode != null && govtSavingsVo.DepositFrequencyCode != string.Empty)
                {
                    db.AddInParameter(updateGovtSavingsPortfolioCmd, "@XF_DepositFrequencyCode", DbType.String, govtSavingsVo.DepositFrequencyCode);
                }

                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_Remark", DbType.String, govtSavingsVo.Remarks);
                db.AddInParameter(updateGovtSavingsPortfolioCmd, "@CGSNP_ModifiedBy", DbType.Int32, userId);
                if (db.ExecuteNonQuery(updateGovtSavingsPortfolioCmd) == 1)
                {
                    bResult = true;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "GovtSavingsDao.cs:UpdateGovtSavingsPortfolio()");
                object[] objects = new object[2];
                objects[0]   = govtSavingsVo;
                objects[1]   = userId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(bResult);
        }
コード例 #11
0
        public void LoadGridview(int portfolioId)
        {
            List <GovtSavingsVo> govtSavingsList = new List <GovtSavingsVo>();
            int count = 0;

            try
            {
                govtSavingsList = govtSavingsBo.GetGovtSavingsNPList(portfolioId, mypager.CurrentPage, hdnSort.Value, out count);
                if (count > 0)
                {
                    lblTotalRows.Text = hdnRecordCount.Value = count.ToString();
                    tblPager.Visible  = true;
                }

                if (govtSavingsList != null)
                {
                    lblMsg.Visible = false;
                    GovtSavingsVo govtSavingsVo;

                    DataTable dtGovtSavings = new DataTable();
                    dtGovtSavings.Columns.Add("SI.No");
                    dtGovtSavings.Columns.Add("GovtSavingId");
                    dtGovtSavings.Columns.Add("Category");
                    dtGovtSavings.Columns.Add("Particulars");
                    dtGovtSavings.Columns.Add("Deposit Date");
                    dtGovtSavings.Columns.Add("Maturity Date");
                    dtGovtSavings.Columns.Add("Deposit Amount");
                    dtGovtSavings.Columns.Add("Rate Of Interest");
                    dtGovtSavings.Columns.Add("Current Value");
                    dtGovtSavings.Columns.Add("Maturity Value");
                    DataRow drGovtSavings;

                    for (int i = 0; i < govtSavingsList.Count; i++)
                    {
                        drGovtSavings    = dtGovtSavings.NewRow();
                        govtSavingsVo    = new GovtSavingsVo();
                        govtSavingsVo    = govtSavingsList[i];
                        drGovtSavings[0] = (i + 1).ToString();
                        drGovtSavings[1] = govtSavingsVo.GoveSavingsPortfolioId.ToString();
                        drGovtSavings[2] = govtSavingsVo.AssetInstrumentCategoryName.ToString();
                        drGovtSavings[3] = govtSavingsVo.Name.ToString();
                        if (govtSavingsVo.PurchaseDate != DateTime.MinValue)
                        {
                            drGovtSavings[4] = govtSavingsVo.PurchaseDate.ToShortDateString().ToString();
                        }
                        if (govtSavingsVo.MaturityDate != DateTime.MinValue)
                        {
                            drGovtSavings[5] = govtSavingsVo.MaturityDate.ToShortDateString().ToString();
                        }
                        //  if (govtSavingsVo.DepositAmt != null)
                        drGovtSavings[6] = govtSavingsVo.DepositAmt.ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"));
                        //if (govtSavingsVo.InterestRate != null)
                        drGovtSavings[7] = govtSavingsVo.InterestRate.ToString();
                        //if (govtSavingsVo.CurrentValue != null)
                        drGovtSavings[8] = govtSavingsVo.CurrentValue.ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"));
                        //if(govtSavingsVo.MaturityValue != null)
                        drGovtSavings[9] = govtSavingsVo.MaturityValue.ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"));

                        dtGovtSavings.Rows.Add(drGovtSavings);
                    }

                    gvrGovtSavings.DataSource = dtGovtSavings;
                    gvrGovtSavings.DataBind();
                    gvrGovtSavings.Visible = true;
                    this.GetPageCount();
                }
                else
                {
                    lblMsg.Visible            = true;
                    gvrGovtSavings.DataSource = null;
                    gvrGovtSavings.DataBind();
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "ViewGovtSavings.ascx.cs:LoadGridview()");
                object[] objects = new object[2];
                objects[0]   = govtSavingsList;
                objects[1]   = portfolioId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
コード例 #12
0
        public List <GovtSavingsVo> GetGovtSavingsNPList(int portfolioId, int CurrentPage, string sortOrder, out int count)
        {
            GovtSavingsVo        govtSavingsVo;
            List <GovtSavingsVo> govtSavingsList = null;
            Database             db;
            DbCommand            getGovtSavingsListCmd;
            DataSet dsGovtSavings;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                getGovtSavingsListCmd = db.GetStoredProcCommand("SP_GetGovtSavingsNetPosition");
                db.AddInParameter(getGovtSavingsListCmd, "@CP_PortfolioId", DbType.Int32, portfolioId);
                db.AddInParameter(getGovtSavingsListCmd, "@CurrentPage", DbType.Int16, CurrentPage);
                db.AddInParameter(getGovtSavingsListCmd, "@SortOrder", DbType.String, sortOrder);
                dsGovtSavings = db.ExecuteDataSet(getGovtSavingsListCmd);
                if (dsGovtSavings.Tables[1] != null && dsGovtSavings.Tables[1].Rows.Count > 0)
                {
                    count = Int32.Parse(dsGovtSavings.Tables[1].Rows[0][0].ToString());
                }
                else
                {
                    count = 0;
                }
                if (dsGovtSavings.Tables[0].Rows.Count > 0)
                {
                    govtSavingsList = new List <GovtSavingsVo>();
                    foreach (DataRow dr in dsGovtSavings.Tables[0].Rows)
                    {
                        govtSavingsVo           = new GovtSavingsVo();
                        govtSavingsVo.AccountId = int.Parse(dr["CGSA_AccountId"].ToString());
                        govtSavingsVo.GoveSavingsPortfolioId      = int.Parse(dr["CGSNP_GovtSavingNPId"].ToString());
                        govtSavingsVo.AssetInstrumentCategoryCode = dr["PAIC_AssetInstrumentCategoryCode"].ToString();
                        govtSavingsVo.AssetGroupCode = dr["PAG_AssetGroupCode"].ToString();
                        govtSavingsVo.DebtIssuerCode = dr["XDI_DebtIssuerCode"].ToString();
                        govtSavingsVo.InterestPayableFrequencyCode  = dr["XF_InterestPayableFrequencyCode"].ToString();
                        govtSavingsVo.CompoundInterestFrequencyCode = dr["XF_CompoundInterestFrequencyCode"].ToString();
                        if (dr["CGSNP_InterestRate"] != DBNull.Value)
                        {
                            govtSavingsVo.InterestRate = float.Parse(dr["CGSNP_InterestRate"].ToString());
                        }
                        govtSavingsVo.Name = dr["CGSNP_Name"].ToString();
                        //govtSavingsVo.Quantity = float.Parse(dr["CGSNP_Quantity"].ToString());
                        if (dr["CGSNP_PurchaseDate"] != DBNull.Value)
                        {
                            govtSavingsVo.PurchaseDate = DateTime.Parse(dr["CGSNP_PurchaseDate"].ToString());
                        }
                        if (dr["CGSNP_DepositAmount"] != DBNull.Value)
                        {
                            govtSavingsVo.DepositAmt = float.Parse(dr["CGSNP_DepositAmount"].ToString());
                        }
                        if (dr["CGSNP_MaturityDate"] != DBNull.Value)
                        {
                            govtSavingsVo.MaturityDate = DateTime.Parse(dr["CGSNP_MaturityDate"].ToString());
                        }
                        govtSavingsVo.MaturityValue               = float.Parse(dr["CGSNP_MaturityValue"].ToString());
                        govtSavingsVo.CurrentValue                = float.Parse(dr["CGSNP_CurrentValue"].ToString());
                        govtSavingsVo.InterestBasisCode           = dr["XIB_InterestBasisCode"].ToString();
                        govtSavingsVo.IsInterestAccumalated       = int.Parse(dr["CGSNP_IsInterestAccumalated"].ToString());
                        govtSavingsVo.InterestAmtAccumalated      = float.Parse(dr["CGSNP_InterestAmtAccumalated"].ToString());
                        govtSavingsVo.InterestAmtPaidOut          = float.Parse(dr["CGSNP_InterestAmtPaidOut"].ToString());
                        govtSavingsVo.AssetInstrumentCategoryName = dr["PAIC_AssetInstrumentCategoryName"].ToString();
                        govtSavingsList.Add(govtSavingsVo);
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "GovtSavingsDao.cs:GetGovtSavingsNPList()");


                object[] objects = new object[1];
                objects[0] = portfolioId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(govtSavingsList);
        }