protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //check if a success message is inside the stack
                //if (base.Error.Count > 0)
                //{
                //    this.frmPasswordPolicy.Visible = false;
                //    return;
                //}

                if (!Page.IsPostBack)
                {
                    this.gridViewPasswordPolicy.DataSource = _sysConfigHandler.GetAll();
                    this.gridViewPasswordPolicy.DataBind();

                    //this.gridViewPasswordPolicyProc.DataSource = _sysConfigHandler.GetAllProc();
                    //this.gridViewPasswordPolicyProc.DataBind();
                }
            }
            catch (Exception ex)
            {
                LogUtitlity.LogToText($"{ex.ToString()}");
            }
        }
Exemplo n.º 2
0
        protected void btnUpdateValueProceed_ServerClick(object sender, EventArgs e)
        {
            try
            {
                var selectedRow = this.gridViewRules.SelectedRow;
                if (selectedRow.Cells[SharedConst.COMP_RULE_TYPE_COLUMN_INDEX].Text == SharedConst.COMP_RULE_TYPE_TEXT_SIMPLE)
                {
                    SetGridCellValue(this.gridViewCompValue.SelectedRow, 2, this.txtNewValueSimple.Value);
                    SetGridCellValue(this.gridViewCompValue.SelectedRow, 3, this.txtAreaAnalystComment.Value);
                    this.gridViewCompValue.SelectedRow.Cells[2].ForeColor = System.Drawing.Color.Maroon;
                    this.gridViewCompValue.SelectedRow.Cells[3].ForeColor = System.Drawing.Color.Maroon;
                }
                else if (selectedRow.Cells[SharedConst.COMP_RULE_TYPE_COLUMN_INDEX].Text == SharedConst.COMP_RULE_TYPE_TEXT_COMPOUND)
                {
                }
                else
                {
                    return;
                }

                //set a flag to show a value has been changed
                SaveToSession(SharedConst.SESSION_IS_MODIFIED, "true");
            }
            catch (Exception ex)
            {
                LogUtitlity.LogToText(ex.ToString());
                divAlert.Visible = true;
                divAlert.Attributes.Add("class", "alert alert-danger alert-dismissible");
                lblError.Text = SharedConst.ERROR_SHARED_ERROR_MESSAGE;
            }
        }
Exemplo n.º 3
0
 protected void gridviewLeftRight_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     try
     {
         //cast the selected sender control to grid
         var selectedGrid = sender as GridView;
         if (selectedGrid.ID.Equals("griviewReturnAdjusted"))
         {
             this.gridviewLeft300.PageIndex = e.NewPageIndex;
             this.gridviewLeft300.DataSource
                 = raHandler.MBR300ReturnAdjustment(GetFromSession("table1"), this.cmbReportingInstitution.SelectedValue, GetFromSession(SharedConst.S_SCHEDULE_ID).ToString(), GetFromSession(SharedConst.S_RUN_ID).ToString());
             this.gridviewLeft300.DataBind();
         }
         else
         {
             this.gridviewRight1000.PageIndex  = e.NewPageIndex;
             this.gridviewRight1000.DataSource = raHandler.MBR1000ReturnAdjustment(GetFromSession("table2"), this.cmbReportingInstitution.SelectedValue, GetFromSession(SharedConst.S_SCHEDULE_ID).ToString(), GetFromSession(SharedConst.S_RUN_ID).ToString());
             this.gridviewRight1000.DataBind();
         }
     }
     catch (Exception ex)
     {
         LogUtitlity.LogToText(ex.ToString());
     }
 }
 protected void btnDownload_ServerClick(object sender, EventArgs e)
 {
     try
     {
         //Get the return builder filename
         var rbFileName = this.gridViewRb.Rows[0].Cells[2].Text;
         //Get the return builder download path
         var rbPathInConfig = SharedConst.RETURN_BUILDER_DOWNLOAD_PATH;
         //combine the file name and path
         var realFileNameAndPath = rbPathInConfig + rbFileName;
         if (string.IsNullOrWhiteSpace(rbFileName) || string.IsNullOrWhiteSpace(Server.HtmlDecode(rbFileName)))
         {
             divAlert.Visible = true;
             lblError.Text    = "No file available to download";
         }
         else
         {
             Response.Clear();
             Response.ContentType = "application/zip";
             Response.AddHeader("Content-Disposition", $"attachment; filename={rbFileName}");
             Response.TransmitFile(realFileNameAndPath);
             var data = Response.OutputStream;
             Response.End();
             checked
             {
             }
         }
     }
     catch (Exception ex)
     {
         LogUtitlity.LogToText(ex.ToString());
     }
 }
        protected void cmbInstitutionType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.cmbInstitutionType.SelectedItem.ToString() != null)
            {
                try
                {
                    var instTypeId = this.cmbInstitutionType.SelectedValue;

                    var ritypeId = Convert.ToInt32(this.cmbInstitutionType.SelectedValue);
                    if (!String.IsNullOrWhiteSpace(ritypeId.ToString()))
                    {
                        ReturnInstitutions ri = new ReturnInstitutions();
                        ri.GetReturnInstitutionsByTypeId(this.cmbReportingInstitution, ritypeId);
                    }
                    else
                    {
                        divAlert.Visible = true;
                        lblErrorMsg.Text = "Please select an institution type";
                    }
                }
                catch (Exception ex)
                {
                    LogUtitlity.LogToText(ex.ToString());
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //check if a success message is inside the stack
                if (base.Error.Count > 0)
                {
                    this.frmsysmanagement.Visible = false;
                    return;
                }

                if (!Page.IsPostBack)
                {
                    var allUser = _users.GetAllUser(new TCoreUsersObject
                    {
                        user_name = "Admin"
                    });
                    this.gridViewListUser.DataSource = allUser;
                    this.gridViewListUser.DataBind();
                }
            }
            catch (Exception ex)
            {
                LogUtitlity.LogToText(ex.ToString());
            }
        }
Exemplo n.º 7
0
        protected void lblAdjustReturn_ServerClick(object sender, EventArgs e)
        {
            try
            {
                if (GetFromSession("aiflag").ToString().Equals("300"))
                {
                    if (this.canEdit == false)
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true);
                    }
                }

                if (GetFromSession("aiflag").ToString().Equals("1000"))
                {
                    if (this.canEdit == false)
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal2();", true);
                    }

                    else
                    {
                        divAlert.Attributes.Add("class", "alert alert-warning alert-dismissible");
                        this.divAlert.Visible = true;
                        this.lblErrorMsg.Text = "Please select a return to be adjusted from below";
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                LogUtitlity.LogToText(ex.ToString());
            }
        }
Exemplo n.º 8
0
        protected void gridViewPenalties_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.Header)
                {
                    e.Row.TableSection = TableRowSection.TableHeader;
                }

                if (e.Row.Cells.Count > 0)
                {
                    e.Row.Cells[7].Visible  = false;
                    e.Row.Cells[8].Visible  = false;
                    e.Row.Cells[9].Visible  = false;
                    e.Row.Cells[10].Visible = false;
                    e.Row.Cells[12].Visible = false;
                    e.Row.Cells[13].Visible = false;
                    e.Row.Cells[14].Visible = false;
                    e.Row.Cells[15].Visible = false;
                    e.Row.Cells[16].Visible = false;
                    e.Row.Cells[17].Visible = false;
                }
            }
            catch (Exception ex)
            {
                LogUtitlity.LogToText(ex.ToString());
            }
        }
        protected void btnUpdateScore_ServerClick(object sender, EventArgs e)
        {
            try
            {
                var    columnIndex      = GetColumnIndexByName(this.gridviewRatingSetup.SelectedRow, "rating_score");
                string ratingScoreValue = this.txtRatingScore.Value.Trim();
                string componentWeight  = GetGridCellValue(this.gridviewRatingSetup.SelectedRow, GetColumnIndexByName(this.gridviewRatingSetup.SelectedRow, "component_weight"));

                if (string.IsNullOrWhiteSpace(ratingScoreValue))
                {
                    ratingScoreValue = "0.00";
                }

                //Check that rating score is not higher than component_weight
                divAlert.Visible = true;
                if (double.Parse(ratingScoreValue) > double.Parse(componentWeight))
                {
                    lblError.Text = "Rating score value can't be greater than component weight";
                    return;
                }
                else
                {
                    divAlert.Visible = false;
                    SetGridCellValue(this.gridviewRatingSetup.SelectedRow, columnIndex, ratingScoreValue);
                    this.gridviewRatingSetup.SelectedRow.Cells[columnIndex].ForeColor = System.Drawing.Color.Maroon;
                }
            }
            catch (Exception ex)
            {
                LogUtitlity.LogToText(ex.ToString());
            }
        }
Exemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //Get the user name of the currently logged in user and decrypt it
                if (!String.IsNullOrWhiteSpace(Request.QueryString[SharedConst.QUERY_STRING_USER_NAME]))
                {
                    currentUser = Request.QueryString[SharedConst.QUERY_STRING_USER_NAME];

                    //uncomment this below line when the encryption
                    //var encryptedQueryString = Request.QueryString[SharedConst.QUERY_STRING_USER_NAME];
                    //encryptedQueryString = HttpUtility.UrlDecode(encryptedQueryString.Trim());
                    //currentUser = CryptoServiceHandler.Decrypt(currentUser, CryptoServiceHandler.ENCRYPTION_PASS_PHRASE);
                }
                else
                {
                    this.frmPenalty.Visible = false;
                }

                if (!Page.IsPostBack)
                {
                    this.gridViewPenalties.DataSource = new Penalties().ListPenalties();
                    this.gridViewPenalties.DataBind();
                }
            }
            catch (Exception ex)
            {
                LogUtitlity.LogToText(ex.ToString());
            }
        }
        protected void btnSaveChanges_ServerClick(object sender, EventArgs e)
        {
            int rowsAffected = 0;

            try
            {
                //Validate business data
                ValidateBusinessData();

                //contiue to save all changes
                for (int x = 0; x < this.gridviewRatingSetup.Rows.Count; x++)
                {
                    var selectedRow = this.gridviewRatingSetup.SelectedRow;
                    _scoreobject = new TRPTComputationBankRatingScoringObject();
                    _scoreobject.bank_rating_code = this.gridviewRatingSetup.Rows[x].Cells[1].Text;
                    _scoreobject.ri_type_id       = Convert.ToInt32(this.cmbRiType.SelectedValue);
                    _scoreobject.ri_id            = Convert.ToInt32(this.cmbReportingInstitution.SelectedValue);
                    _scoreobject.rating_date      = Convert.ToDateTime(this.txtWorkcollectionDate.Text.Trim());
                    _scoreobject.rating_score     = this.gridviewRatingSetup.Rows[x].Cells[5].Text;
                    _scoreobject.last_modified    = DateTime.Now;
                    _scoreobject.modified_by      = currentUser;

                    //Check bank rating code exists
                    bool codeExists = _scorehandler.CheckDataExists(this.gridviewRatingSetup.Rows[x].Cells[1].Text);
                    divAlert.Visible = true;
                    divAlert.Attributes.Add("class", "alert alert-success alert-dismissible");
                    if (codeExists == true)
                    {
                        rowsAffected  = _scorehandler.UpdateComputationBankRatingScore(_scoreobject);
                        lblError.Text = "Management component on bank rating score updated successfully";
                    }
                    else
                    {
                        rowsAffected  = _scorehandler.SaveComputationBankRatingScore(_scoreobject);
                        lblError.Text = "Management component on bank rating score saved successfully";
                    }
                }

                //if (rowsAffected > 0)
                //{

                //}
                //else
                //    lblError.Text = "An error occured while saving changes";
            }
            catch (Exception ex)
            {
                if (ex.ToString().Contains("PRIMARY KEY"))
                {
                    divAlert.Visible = true;
                    divAlert.Attributes.Add("class", "alert alert-warning alert-dismissible");
                    lblError.Text = "Bank rating code already exists";
                }
                LogUtitlity.LogToText(ex.ToString());
            }
        }
Exemplo n.º 12
0
        protected void gridViewRules_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                var selectedItem = this.gridViewRules.SelectedRow;
                if (selectedItem.Cells.Count > 0)
                {
                    _ruleTypeText = selectedItem.Cells[SharedConst.COMP_RULE_TYPE_COLUMN_INDEX].Text;
                    //Store the rule name and rule ID using the selected row column index
                    _ruleId   = selectedItem.Cells[1].Text;
                    _rulename = selectedItem.Cells[2].Text;
                    void BindComputationRuleSpool()
                    {
                        _ruleVarianceAdjustment           = new RuleVarianceAdjustment();
                        this.gridViewCompValue.DataSource = _ruleVarianceAdjustment.CompRuleSpool(Convert.ToInt32(this.hndSchedule.Value), Convert.ToInt32(_ruleId));
                        this.gridViewCompValue.DataBind();
                    };

                    BindComputationRuleSpool();

                    #region comment
                    ////Get the version ID
                    //string GetVersionId()
                    //{
                    //    var versionId = new TRPTComputationValueTableHandler().GetVersionId(Convert.ToInt32(cmbRiType.SelectedValue), Convert.ToInt32(cmbReportingInstitution.SelectedValue), cmbFrequency.SelectedValue, Convert.ToDateTime(txtWorkcollectionDate.Text), _rulename, Convert.ToInt32(this.hndText.Value));
                    //    if (!string.IsNullOrWhiteSpace(versionId))
                    //        return versionId;
                    //    else
                    //        return string.Empty;
                    //};
                    //_versionid = GetVersionId();

                    ////Get the version ID
                    //string GetRunId()
                    //{
                    //    return new TRPTComputationValueTableHandler().GetRunId(Convert.ToInt32(cmbRiType.SelectedValue), Convert.ToInt32(cmbReportingInstitution.SelectedValue), cmbFrequency.SelectedValue, Convert.ToDateTime(txtWorkcollectionDate.Text), _rulename, Convert.ToInt32(this.hndText.Value));
                    //};
                    //_runid = GetRunId();
                    #endregion

                    this.hndType.Value = this.gridViewRules.SelectedRow.Cells[SharedConst.COMP_RULE_TYPE_COLUMN_INDEX].Text;
                }
                else
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                LogUtitlity.LogToText(ex.ToString());
                divAlert.Visible = true;
                divAlert.Attributes.Add("class", "alert alert-danger alert-dismissible");
                lblError.Text = SharedConst.ERROR_SHARED_ERROR_MESSAGE;
            }
        }
 protected void gridViewListUser_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     try
     {
         e.Row.Cells[1].Visible = false;
     }
     catch (Exception ex)
     {
         LogUtitlity.LogToText(SharedConst.Ad_HOC_LOG_PATH, ex.ToString());
     }
 }
Exemplo n.º 14
0
 protected void lblAddNewPenalty_ServerClick(object sender, EventArgs e)
 {
     try
     {
         Response.Redirect(NEW_PENALTY_PAGE_URL + currentUser);
     }
     catch (Exception ex)
     {
         LogUtitlity.LogToText(ex.ToString());
     }
 }
Exemplo n.º 15
0
 protected void lblBankScoring_ServerClick(object sender, EventArgs e)
 {
     try
     {
         Response.Redirect($"~/mgtcomponent/bankratingscore.aspx?uname={currentUser}", false);
     }
     catch (Exception ex)
     {
         LogUtitlity.LogToText(ex.ToString());
     }
 }
Exemplo n.º 16
0
 public String GetFromSession(string key)
 {
     try
     {
         return(Session[key].ToString());
     }
     catch (Exception ex)
     {
         LogUtitlity.LogToText(ex.ToString());
         return(null);
     }
 }
 protected void btnGoBack_Click(object sender, EventArgs e)
 {
     try
     {
         string filePath = $"~/mgtcomponent/bankratingsetupview.aspx?uname={currentUser}";
         Response.Redirect(filePath);
     }
     catch (Exception ex)
     {
         LogUtitlity.LogToText(ex.ToString());
     }
 }
Exemplo n.º 18
0
        protected void btnAddAnalystComment_ServerClick(object sender, EventArgs e)
        {
            try
            {
                //Check if any modification has been made on the returns

                Session["comment"] = this.txtAreaAnalystComment.Value.Trim();
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal3();", true);
            }
            catch (Exception ex)
            {
                LogUtitlity.LogToText(ex.ToString());
            }
        }
Exemplo n.º 19
0
        public String GetFromSession(string key)
        {
            string sessionValue = string.Empty;

            try
            {
                sessionValue = Session[key].ToString();
            }
            catch (Exception ex)
            {
                LogUtitlity.LogToText(ex.ToString());
                return(null);
            }

            return(sessionValue);
        }
Exemplo n.º 20
0
        /// <summary>
        /// Save some specific column value from the grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void gridviewRight1000_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                //Get the currently selected rows in the gridview
                var gridViewSelectedRow = this.gridviewRight1000.SelectedRow;
                gridViewSelectedRow.Focus();
                if (gridViewSelectedRow.Cells.Count > 0)
                {
                    //Set a flag to indicate that the selected row is contains value(s)
                    this.hdnValues.Value = "1000:1";
                    SaveToSession("aiflag", "1000");

                    //check that selected index is editable
                    var selectedItemCode = Convert.ToInt32(HttpUtility.HtmlEncode(gridViewSelectedRow.Cells[7].Text));
                    this.canEdit = raHandler.IsRestrictedItem(selectedItemCode);
                    if (this.canEdit == false)
                    {
                        divAlert.Attributes.Add("class", "alert alert-warning alert-dismissible");
                        divAlert.Visible = true;
                        lblErrorMsg.Text = "Warning - can't modify the selected item";
                    }
                    else
                    {
                        //Hide the error div
                        divAlert.Visible = false;

                        //set the selected rows in the gridview
                        lblItemCode2.InnerText              = $"Item Code: {selectedItemCode}";
                        lblDescriptionToModify2.InnerText   = $"Item Description : {HttpUtility.HtmlEncode(gridViewSelectedRow.Cells[8].Text)}";
                        lblLocalCurrencyToModify2.InnerText = $"Amount (Month) : {HttpUtility.HtmlEncode(gridViewSelectedRow.Cells[9].Text)}";
                        lblLocalCurrencyToModify3.InnerText = $"Amount (Year) : {HttpUtility.HtmlEncode(gridViewSelectedRow.Cells[10].Text)}";
                        lblAdjReason2.InnerText             = $"Reason for Adjustment : { (!String.IsNullOrWhiteSpace(HttpUtility.HtmlDecode(gridViewSelectedRow.Cells[13].Text)) ? gridViewSelectedRow.Cells[13].Text : "-")}";
                    }
                }
                else
                {
                    //Set a flag to indicate that the selected row is empty
                    this.hdnValues.Value = "0:0";
                }
            }
            catch (Exception ex)
            {
                LogUtitlity.LogToText(ex.ToString());
            }
        }
Exemplo n.º 21
0
        protected void btnProceedToReturnAdjustment_ServerClick(object sender, EventArgs e)
        {
            try
            {
                var clickedButton = sender as System.Web.UI.HtmlControls.HtmlButton;
                //The button bellow works for all returns with 300 suffix
                if (clickedButton.ID.Equals("btnProceedToReturnAdjustment"))
                {
                    //Set the new value in the gridview
                    if (GetFromSession("table1").Equals(SharedConst.T_SUBMISSION_MDHR300))
                    {
                        SetGridViewRowCellValueAndColor(this.gridviewLeft300, 9, Convert.ToDecimal(this.txtNewCurrencyValue.Value).ToString(StringUtility.FormatMoney()).Insert(0, "₦"), System.Drawing.Color.Maroon);
                        SetGridViewRowCellValueAndColor(this.gridviewLeft300, 10, Convert.ToDecimal(this.txtNewCurrencyValue2.Value).ToString(StringUtility.FormatMoney()).Insert(0, "₦"), System.Drawing.Color.Maroon);
                    }
                    else
                    {
                        SetGridViewRowCellValueAndColor(this.gridviewLeft300, 9, Convert.ToDecimal(this.txtNewCurrencyValue.Value).ToString(StringUtility.FormatMoney()).Insert(0, "₦"), System.Drawing.Color.Maroon);
                    }

                    //Get the old value before saving changing it.
                    var gridViewSelectedRow = this.gridviewLeft300.SelectedRow;
                    int itemCode            = Convert.ToInt32(HttpUtility.HtmlEncode(gridViewSelectedRow.Cells[7].Text));

                    String returnCode = GetFromSession("table1").Split('_')[3];
                    CalculateTotal(returnCode, itemCode);
                }
                else //The button bellow works for all returns with 1000 suffix
                {
                    SetGridViewRowCellValueAndColor(this.gridviewRight1000, 9, Convert.ToDecimal(this.txtNewLastMonthCurrencyValue.Value).ToString(StringUtility.FormatMoney()).Insert(0, "₦"), System.Drawing.Color.Maroon);
                    SetGridViewRowCellValueAndColor(this.gridviewRight1000, 10, Convert.ToDecimal(this.txtNewYearToDateCurrencyValue.Value).ToString(StringUtility.FormatMoney()).Insert(0, "₦"), System.Drawing.Color.Maroon);

                    //Get the old value before saving changing it.
                    var gridViewSelectedRow = this.gridviewRight1000.SelectedRow;
                    int itemCode            = Convert.ToInt32(HttpUtility.HtmlEncode(gridViewSelectedRow.Cells[7].Text));

                    String returnCode = GetFromSession("table2").Split('_')[3];
                    CalculateTotal(returnCode, itemCode);
                }
            }
            catch (Exception ex)
            {
                divAlert.Visible = true;
                lblErrorMsg.Text = "An error occured while executing the page";
                LogUtitlity.LogToText(ex.ToString());
            }
        }
Exemplo n.º 22
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            _bankRatingModel = new TRPComputationBankRatingSetupObject();
            try
            {
                ValidateBusinessData();

                _bankRatingModel.bank_rating_code    = this.txtBankRatingCode.Value.Trim();
                _bankRatingModel.ri_type_id          = Convert.ToInt32(this.cmbRiType.SelectedValue.ToString());
                _bankRatingModel.param               = this.txtParam.Value.Trim();
                _bankRatingModel.description         = this.txtDescription.Value.Trim();
                _bankRatingModel.component_weight    = this.txtComponentWeight.Value.Trim();
                _bankRatingModel.start_validity_date = Convert.ToDateTime(txtStartValidityDate.Text);
                _bankRatingModel.end_validity_date   = DateTime.MinValue;
                _bankRatingModel.created_date        = DateTime.Now;
                _bankRatingModel.created_by          = currentUser;

                _bankRatinghandler = new TRPTComputationBankRatingSetupHandler();
                var rowsAffected = _bankRatinghandler.SaveComputationBankRatingSetup(_bankRatingModel);

                divAlert.Visible = true;
                divAlert.Attributes.Add("class", "alert alert-success alert-dismissible");

                if (rowsAffected > 0)
                {
                    lblError.Text = "Management component on bank rating saved successfully";
                }
                else
                {
                    lblError.Text = "An error occured while saving changes";
                }
            }
            catch (Exception ex)
            {
                if (ex.ToString().Contains("PRIMARY KEY"))
                {
                    //divAlert.Visible = true;
                    //divAlert.Attributes.Add("class", "alert alert-success alert-dismissible");
                    //_bankRatingModel.last_modified = DateTime.Now;
                    //_bankRatingModel.modified_by = currentUser;
                    //_bankRatinghandler.UpdateComputationBankRatingSetup(_bankRatingModel);
                }
                LogUtitlity.LogToText(ex.ToString());
            }
        }
        protected void btnSave_ServerClick(object sender, EventArgs e)
        {
            try
            {
                //Save the settings
                //Loop the gridview and check if gridview.rows[n-index].text = _modiftracker
                var tracker = (List <string>)Session["tracker"] ?? null;
                if (tracker == null || tracker.Count < 1)
                {
                    return;
                }
                tracker.Distinct <string>();
                foreach (var code in tracker)
                {
                    for (int y = 0; y <= this.gridViewPasswordPolicy.Rows.Count - 1; y++)
                    {
                        if (code == this.gridViewPasswordPolicy.Rows[y].Cells[1].Text)
                        {
                            //Save the changes
                            int isEnabled = (this.gridViewPasswordPolicy.Rows[y].Cells[4].Text.Equals("Enable")) ? 1 : 0;
                            _rowsaffected += _sysConfigHandler.Save(new TSysConfigurationIrsObject()
                            {
                                config_id     = Convert.ToInt32(code),
                                default_value = this.gridViewPasswordPolicy.Rows[y].Cells[2].Text,
                                config_value  = this.gridViewPasswordPolicy.Rows[y].Cells[3].Text,
                                enabled       = isEnabled
                            });
                        }
                    }
                }

                if (_rowsaffected > 0)
                {
                    this.divAlert.Visible = true;
                    divAlert.Attributes.Add("class", "alert alert-success alert-dismissible");
                    this.lblError.Text = "Password policy settings saved successfully";
                }
            }
            catch (Exception ex)
            {
                LogUtitlity.LogToText($"{ex.ToString()}");
            }
        }
        protected void btnUpdateScore_ServerClick(object sender, EventArgs e)
        {
            try
            {
                using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required))
                {
                    if (_testDefnHandler.GetLiquidityStressTestByInputReq(1).Count > 0)
                    {
                        foreach (var key in _testDefnHandler.GetLiquidityStressTestByInputReq(1))
                        {
                            _testScoreObj.item_code        = key.Key;
                            _testScoreObj.item_description = key.Value;
                            _testScoreObj.ri_id            = Convert.ToInt32(this.cmbReportingInstitution.SelectedValue);
                            _testScoreObj.valuation_date   = Convert.ToDateTime(this.txtEndValidityDate.Text);
                            _testScoreObj.amount           = this.txtAmount.Value.Trim();

                            rowsAffected += _testHandler.SaveComputationBankRatingSetup(_testScoreObj);
                        }
                        divAlert.Visible = true;
                        if (rowsAffected > 0)
                        {
                            divAlert.Attributes.Add("class", "alert alert-success alert-dismissible");
                            lblError.Text = "Liquidity stress test saved successfully";
                        }
                        else
                        {
                            lblError.Text = "An error occured while saving changes";
                        }
                    }
                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                divAlert.Visible = true;
                if (ex.ToString().Contains("PRIMARY KEY"))
                {
                    lblError.Text = "Selected reporting institution liquidity ratio already exists";
                }
                LogUtitlity.LogToText(ex.ToString());
            }
        }
        protected void btnUpdatePolicySettings_ServerClick(object sender, EventArgs e)
        {
            try
            {
                void ValidateControl()
                {
                    if (!string.IsNullOrWhiteSpace(txtDefaultValue.Value))
                    {
                        SetGridViewRowCellValueAndColor(this.gridViewPasswordPolicy, 2, this.txtDefaultValue.Value, System.Drawing.Color.Maroon);
                    }

                    if (!string.IsNullOrWhiteSpace(txtPolicyValue.Value))
                    {
                        SetGridViewRowCellValueAndColor(this.gridViewPasswordPolicy, 3, this.txtDefaultValue.Value, System.Drawing.Color.Maroon);
                    }

                    if (!string.IsNullOrWhiteSpace(cmbEnable.SelectedItem.Text) && !cmbEnable.SelectedItem.Text.Equals("--choose one--"))
                    {
                        SetGridViewRowCellValueAndColor(this.gridViewPasswordPolicy, 4, this.cmbEnable.SelectedItem.Text, System.Drawing.Color.Maroon);
                    }
                }

                ValidateControl();

                if (Session["tracker"] != null)
                {
                    _modifTracker = (List <string>)Session["tracker"];
                    _modifTracker.Add(gridViewPasswordPolicy.SelectedRow.Cells[1].Text);
                    Session["tracker"] = _modifTracker;
                }
                else
                {
                    _modifTracker.Add(gridViewPasswordPolicy.SelectedRow.Cells[1].Text);
                    Session["tracker"] = _modifTracker;
                }
            }
            catch (Exception ex)
            {
                LogUtitlity.LogToText($"{ex.ToString()}");
            }
        }
Exemplo n.º 26
0
 protected void gridViewBankRatingSetup_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         var    selectedRow  = this.gridViewBankRatingSetup.SelectedRow;
         string bankRateCode = selectedRow.Cells[1].Text.Trim();
         if (!string.IsNullOrWhiteSpace(bankRateCode))
         {
             string filePath = $"~/mgtcomponent/bankratingsetup.aspx?uname={currentUser}&brc={bankRateCode}";
             Response.Redirect(filePath);
         }
         else
         {
             return;
         }
     }
     catch (Exception ex)
     {
         LogUtitlity.LogToText(ex.ToString());
     }
 }
Exemplo n.º 27
0
 protected void cmbRiType_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.cmbRiType.SelectedItem.ToString() != null && this.cmbRiType.SelectedValue != "0")
     {
         try
         {
             var instTypeId = this.cmbRiType.SelectedValue;
             _ruleVarianceAdjustment = new RuleVarianceAdjustment();
             _ruleVarianceAdjustment.GetRI(this.cmbReportingInstitution, Convert.ToInt32(instTypeId));
             this.cmbReportingInstitution.Items.Insert(0, new ListItem("--choose one--", "0", true));
         }
         catch (Exception ex)
         {
             LogUtitlity.LogToText(ex.ToString());
         }
     }
     else
     {
         this.cmbReportingInstitution.Items.Clear();
     }
 }
Exemplo n.º 28
0
        protected void btnUpdate_ServerClick(object sender, EventArgs e)
        {
            try
            {
                string columnListValue = this.cmbColumnListComplex.SelectedValue;
                string columnName      = this.cmbColumnListComplex.SelectedItem.ToString();
                int    index           = GetColumnIndexByName(this.gridViewCompValue.SelectedRow, columnName);

                if (columnName.Equals("comment"))
                {
                    SetGridCellValue(this.gridViewCompValue.SelectedRow, index, this.txtAreaAnalystComment.Value.Trim());
                    this.gridViewCompValue.SelectedRow.Cells[index].ForeColor = System.Drawing.Color.Maroon;
                }
                else
                {
                    SetGridCellValue(this.gridViewCompValue.SelectedRow, index, this.txtNewValueComplex.Value.Trim());
                    this.gridViewCompValue.SelectedRow.Cells[index].ForeColor = System.Drawing.Color.Maroon;
                }

                //Rebuild the column list control to include all column names minus previously selected column name
                if (string.IsNullOrWhiteSpace(this.hfColumnList.Value))
                {
                    this.hfColumnList.Value = $"{columnListValue}";
                }
                else
                {
                    this.hfColumnList.Value += $",{columnListValue}";
                }

                this.cmbColumnListComplex.Items.Clear();
                _ruleVarianceAdjustment = new RuleVarianceAdjustment();
                _ruleVarianceAdjustment.BindSpoolColumns(this.cmbColumnListComplex, this.hfColumnList.Value);

                ClientScript.RegisterStartupScript(this.GetType(), "Pop", "$('#exampleModalCenterValue').modal('show')", true);
            }
            catch (Exception ex)
            {
                LogUtitlity.LogToText(ex.ToString());
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (base.Error.Count > 0)
                {
                    this.frmBankRatingScore.Visible = false;
                    return;
                }

                if (!Page.IsPostBack)
                {
                    _scorehandler.BindBankRatingSetupRiTypes(this.cmbRiType);
                    this.cmbRiType.Items.Insert(0, "-choose one-");
                }
            }
            catch (Exception ex)
            {
                LogUtitlity.LogToText(ex.ToString());
                LogUtitlity.LogToText(ex.ToString());
            }
        }
 protected void cmbRiType_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         var ritypeId = Convert.ToInt32(this.cmbRiType.SelectedValue);
         _ritypeid = ritypeId;
         if (!String.IsNullOrWhiteSpace(ritypeId.ToString()))
         {
             _testDefnHandler.BindStressTestRI(this.cmbReportingInstitution, ritypeId);
             this.cmbReportingInstitution.Items.Insert(0, "-choose one-");
         }
         else
         {
             divAlert.Visible = true;
             lblError.Text    = "Please select an institution type";
         }
     }
     catch (Exception ex)
     {
         LogUtitlity.LogToText(ex.ToString());
     }
 }