protected void btnProbableDelete_Click(object sender, EventArgs e)
        {
            bool   result       = true;
            bool   blResult     = true;
            string gvStagingIds = "";

            rejectedRecordsBo = new RejectedRecordsBo();
            foreach (GridDataItem gvRow in gvWERPTrans.MasterTableView.Items)
            //foreach (GridViewRow gvRow in gvWERPTrans.Rows)
            {
                CheckBox ChkBxItem = (CheckBox)gvRow.FindControl("chkId");
                if (ChkBxItem.Checked)
                {
                    gvStagingIds += gvWERPTrans.MasterTableView.DataKeyValues[gvRow.RowIndex]["CMFTSId"].ToString() + ",";
                }
            }
            result = rejectedRecordsBo.DeleteProbableDuplicatesRejectedTransaction(gvStagingIds);
            if (result)
            {
                // Success Message
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Records Deleted Successfully');", true);
            }
            else
            {
                // Failure Message
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Please Select Probable Duplicate Records');", true);
            }

            BindEquityTransactionGrid(ProcessId);
        }
Exemplo n.º 2
0
        public void BindddlRejectReason()
        {
            Dictionary <string, string> genDictIsRejected = new Dictionary <string, string>();

            processlogVo      = new UploadProcessLogVo();
            rejectedRecordsBo = new RejectedRecordsBo();
            DataSet ds = rejectedRecordsBo.GetRejectReasonEquityList(1);

            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    genDictIsRejected.Add(dr["WRR_RejectReasonDescription"].ToString(), dr["WRR_RejectReasonCode"].ToString());
                }

                if (ddlRejectReason != null)
                {
                    ddlRejectReason.DataSource     = genDictIsRejected;
                    ddlRejectReason.DataTextField  = "Key";
                    ddlRejectReason.DataValueField = "Value";
                    ddlRejectReason.DataBind();
                }
            }

            ddlRejectReason.Items.Insert(0, new System.Web.UI.WebControls.ListItem("All", "0"));
        }
        protected void btnEditSelectedWerp_Click(object sender, EventArgs e)
        {
            string newPan    = string.Empty;
            string newBroker = string.Empty;
            bool   blResult  = false;

            rejectedRecordsBo = new RejectedRecordsBo();

            // Gets the footer row directly Cool right!
            GridViewRow footerRow = gvWERPProfileReject.FooterRow;

            string pan    = ((TextBox)footerRow.FindControl("txtPanMultiple")).Text;
            string broker = ((TextBox)footerRow.FindControl("txtBrokerMultiple")).Text;

            foreach (GridViewRow dr in gvWERPProfileReject.Rows)
            {
                CheckBox checkBox = (CheckBox)dr.FindControl("chkBxWerp");
                if (checkBox.Checked)
                {
                    if (pan != "" || broker != "")
                    {
                        newPan    = pan;
                        newBroker = broker;
                    }
                    else
                    {
                        newPan    = ((TextBox)dr.FindControl("txtPanWerp")).Text;
                        newBroker = ((TextBox)dr.FindControl("txtBroker")).Text;
                    }

                    int WERPStagingId = Convert.ToInt32(gvWERPProfileReject.DataKeys[dr.RowIndex].Value);
                    blResult = rejectedRecordsBo.UpdateWERPProfileStaging(WERPStagingId, newPan, newBroker);
                }
            }

            if (blResult)
            {
                // Success Message
            }
            else
            {
                // Failure Message
            }

            // BindGrid
            if (Request.QueryString["processId"] != null)
            {
                ProcessId = Int32.Parse(Request.QueryString["processId"].ToString());
            }
            if (Request.QueryString["filetypeid"] != null)
            {
                filetypeId = Int32.Parse(Request.QueryString["filetypeid"].ToString());
            }
            BindWerpProfileGrid(ProcessId);
        }
        protected void BindFixedIncomeGrid(int ProcessId)
        {
            if (ProcessId == null || ProcessId == 0)
            {
                if (txtFromFI.SelectedDate != null)
                {
                    fromDate = DateTime.Parse(txtFromFI.SelectedDate.ToString());
                }
                if (txtToFI.SelectedDate != null)
                {
                    toDate = DateTime.Parse(txtToFI.SelectedDate.ToString());
                }
                rejectReasonCode = int.Parse(ddlRejectReason.SelectedValue);
            }
            //Dictionary<string, string> genDictIsRejected = new Dictionary<string, string>();
            //Dictionary<string, string> genDictRejectReason = new Dictionary<string, string>();
            rejectedRecordsBo = new RejectedRecordsBo();
            dsRejectedRecords = rejectedRecordsBo.GetRejectedFixedIncomeStaging(adviserVo.advisorId, ProcessId, fromDate, toDate, rejectReasonCode);
            if (dsRejectedRecords.Tables[0].Rows.Count > 0)
            {
                //trMessage.Visible = false;
                trReprocess.Visible = true;
                DivAction.Visible   = true;
                msgDelete.Visible   = false;

                if (Cache["RejectedFixedIncomeDetails" + adviserVo.advisorId.ToString()] == null)
                {
                    Cache.Insert("RejectedFixedIncomeDetails" + adviserVo.advisorId.ToString(), dsRejectedRecords);
                }
                else
                {
                    Cache.Remove("RejectedFixedIncomeDetails" + adviserVo.advisorId.ToString());
                    Cache.Insert("RejectedFixedIncomeDetails" + adviserVo.advisorId.ToString(), dsRejectedRecords);
                }
                gvWERPFI.CurrentPageIndex = 0;
                gvWERPFI.DataSource       = dsRejectedRecords.Tables[0];
                gvWERPFI.DataBind();
                gvWERPFI.Visible  = true;
                Panel2.Visible    = true;
                msgDelete.Visible = false;
                btnExport.Visible = true;
            }
            else
            {
                gvWERPFI.DataSource = null;
                gvWERPFI.DataBind();
                Msgerror.Visible = true;
                //trMessage.Visible = true;
                DivAction.Visible   = false;
                gvWERPFI.Visible    = false;
                Panel2.Visible      = false;
                trReprocess.Visible = false;
                btnExport.Visible   = false;
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            trErrorMessage.Visible = false;

            string newPan   = string.Empty;
            string newFolio = string.Empty;
            bool   blResult = false;

            rejectedRecordsBo = new RejectedRecordsBo();

            // Gets the footer row directly Cool right!
            GridViewRow footerRow = gvCAMSProfileReject.FooterRow;

            foreach (GridViewRow dr in gvCAMSProfileReject.Rows)
            {
                if (((TextBox)footerRow.FindControl("txtPanMultiple")).Text.Trim() == "" && ((TextBox)footerRow.FindControl("txtFolioMultiple")).Text.Trim() == "")
                {
                    newPan   = ((TextBox)dr.FindControl("txtPan")).Text;
                    newFolio = ((TextBox)dr.FindControl("txtFolio")).Text;
                }
                else
                {
                    newPan   = ((TextBox)footerRow.FindControl("txtPanMultiple")).Text;
                    newFolio = ((TextBox)footerRow.FindControl("txtFolioMultiple")).Text;
                }

                CheckBox checkBox = (CheckBox)dr.FindControl("chkBx");
                if (checkBox.Checked)
                {
                    int StagingId     = Convert.ToInt32(gvCAMSProfileReject.DataKeys[dr.RowIndex].Values["MFFolioStagingId"].ToString());
                    int MainStagingId = Convert.ToInt32(gvCAMSProfileReject.DataKeys[dr.RowIndex].Values["MainStagingId"].ToString());
                    blResult = rejectedRecordsBo.UpdateMFFolioStaging(StagingId, MainStagingId, newPan, newFolio);
                }
            }

            if (blResult)
            {
                // Success Message
            }
            else
            {
                // Failure Message
            }

            // BindGrid
            if (Request.QueryString["processId"] != null)
            {
                ProcessId = Int32.Parse(Request.QueryString["processId"].ToString());
            }
            if (Request.QueryString["filetypeid"] != null)
            {
                filetypeId = Int32.Parse(Request.QueryString["filetypeid"].ToString());
            }
            BindGrid(ProcessId);
        }
 private void CustomerTransactionDelete()
 {
     foreach (GridViewRow gvr in this.gvWERPProfileReject.Rows)
     {
         if (((CheckBox)gvr.FindControl("chkBxWerp")).Checked == true)
         {
             rejectedRecordsBo = new RejectedRecordsBo();
             int StagingID = int.Parse(gvWERPProfileReject.DataKeys[gvr.RowIndex].Values["WERPProfileStagingId"].ToString());
             rejectedRecordsBo.DeleteWERPRejectedProfile(StagingID);
             ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "loadcontrol('RejectedWERPProfile','login');", true);
         }
     }
 }
Exemplo n.º 7
0
        protected void btnEditSelectedWPTrans_Click(object sender, EventArgs e)
        {
            string newTradeAccountNum = string.Empty;
            string newPanNum          = string.Empty;
            bool   blResult           = false;

            rejectedRecordsBo = new RejectedRecordsBo();

            // Gets the footer row directly Cool right!
            GridViewRow footerRow = gvWERPTrans.FooterRow;

            string tradeAccountNum = ((TextBox)footerRow.FindControl("txtTradeAccountNumberMultiple")).Text;
            string panNum          = ((TextBox)footerRow.FindControl("txtPanNumberMultiple")).Text;

            foreach (GridViewRow dr in gvWERPTrans.Rows)
            {
                CheckBox checkBox = (CheckBox)dr.FindControl("chkBxWPTrans");
                if (checkBox.Checked)
                {
                    if (tradeAccountNum != "" || panNum != "")
                    {
                        newTradeAccountNum = tradeAccountNum;
                        newPanNum          = panNum;
                    }
                    else
                    {
                        newTradeAccountNum = ((TextBox)dr.FindControl("txtTradeAccountNumber")).Text;
                        newPanNum          = ((TextBox)dr.FindControl("txtPanNumber")).Text;
                    }

                    int Id = Convert.ToInt32(gvWERPTrans.DataKeys[dr.RowIndex].Value);
                    blResult = rejectedRecordsBo.UpdateRejectedTradeAccountStaging(Id, newTradeAccountNum, newPanNum);
                }
            }

            if (blResult)
            {
                // Success Message
            }
            else
            {
                // Failure Message
            }

            // BindGrid
            if (Request.QueryString["processId"] != null)
            {
                ProcessId = Int32.Parse(Request.QueryString["processId"].ToString());
            }
            BindRejectedUploadsGrid(ProcessId);
        }
        private void CustomerTransactionDelete()
        {
            string StagingID = string.Empty;

            foreach (GridDataItem gvr in this.gvWERPTrans.Items)
            {
                if (((CheckBox)gvr.FindControl("chkId")).Checked == true)
                {
                    rejectedRecordsBo = new RejectedRecordsBo();
                    StagingID        += Convert.ToString(gvWERPTrans.MasterTableView.DataKeyValues[gvr.ItemIndex]["CMFTSId"]) + "~";
                }
            }
            rejectedRecordsBo.DeleteMFTransactionStaging(StagingID);
            BindEquityTransactionGrid(ProcessId);
        }
        private void CustomerFIDelete()
        {
            // string StagingID = string.Empty;
            foreach (GridDataItem gvr in this.gvWERPFI.Items)
            {
                if (((CheckBox)gvr.FindControl("chkBxWPTrans")).Checked == true)
                {
                    rejectedRecordsBo = new RejectedRecordsBo();
                    int StagingID = int.Parse(gvWERPFI.MasterTableView.DataKeyValues[gvr.ItemIndex]["CUS_Id"].ToString());

                    rejectedRecordsBo.DeleteWERPRejectedFixedIncome(StagingID);
                }
            }

            BindFixedIncomeGrid(ProcessId);
        }
        private void BindEquityTransactionGrid(int ProcessId)
        {
            Dictionary <string, string> genDictIsRejected   = new Dictionary <string, string>();
            Dictionary <string, string> genDictRejectReason = new Dictionary <string, string>();

            rejectedRecordsBo = new RejectedRecordsBo();

            dsRejectedRecords = rejectedRecordsBo.GetRejectedMFTransactionStaging(adviserId, int.Parse(hdnProcessIdFilter.Value));

            if (dsRejectedRecords.Tables[0].Rows.Count > 0)
            {   // If Records found, then bind them to grid
                trMessage.Visible   = false;
                trReprocess.Visible = true;
                trGridView.Visible  = true;
                //gvWERPTrans_Sort.DataSource = dsRejectedRecords.Tables[0];


                if (Cache["MFTransactionDetails" + adviserId.ToString()] == null)
                {
                    Cache.Insert("MFTransactionDetails" + adviserId.ToString(), dsRejectedRecords);
                }
                else
                {
                    Cache.Remove("MFTransactionDetails" + adviserId.ToString());
                    Cache.Insert("MFTransactionDetails" + adviserId.ToString(), dsRejectedRecords);
                }

                gvWERPTrans.DataSource = dsRejectedRecords;
                gvWERPTrans.DataBind();
                Panel2.ScrollBars        = ScrollBars.Horizontal;
                trGridView.Visible       = true;
                imgBtnrgHoldings.Visible = true;
            }
            else
            {
                //hdnRecordCount.Value = "0";
                Panel2.ScrollBars      = ScrollBars.None;
                trGridView.Visible     = false;
                gvWERPTrans.DataSource = null;
                gvWERPTrans.DataBind();
                trMessage.Visible        = true;
                trReprocess.Visible      = false;
                imgBtnrgHoldings.Visible = false;
            }
            //this.GetPageCount();
        }
Exemplo n.º 11
0
        private void CustomerTransactionDelete()
        {
            string StagingID = string.Empty;

            foreach (GridDataItem gvr in this.gvWERPTrans.Items)
            {
                if (((CheckBox)gvr.FindControl("chkBxWPTrans")).Checked == true)
                {
                    rejectedRecordsBo = new RejectedRecordsBo();
                    StagingID        += Convert.ToString(gvWERPTrans.MasterTableView.DataKeyValues[gvr.ItemIndex]["WERPTransactionId"]) + "~";

                    //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "loadcontrol('RejectedEquityTransactionStaging','login');", true);
                }
            }

            rejectedRecordsBo.DeleteRejectsEquityTransactionsStaging(StagingID);
            BindEquityTransactionGrid(ProcessId);
        }
        /*************To delete the selected records ****************/

        protected void btnDelete_Click(object sender, EventArgs e)
        //{
        //    int i = 0;
        //    foreach (GridViewRow gvr in this.gvCAMSProfileReject.Rows)
        //    {
        //        if (((CheckBox)gvr.FindControl("chkBx")).Checked == true)
        //            i = i + 1;
        //    }

        //    if (i == 0)
        //        ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Please select record to delete!');", true);
        //    else
        //        CustomerTransactionDelete();
        //}

        {
            int    i         = 0;
            string StagingID = string.Empty;

            foreach (GridViewRow gvr in this.gvCAMSProfileReject.Rows)
            {
                if (((CheckBox)gvr.FindControl("chkBx")).Checked == true)
                {
                    i          = i + 1;
                    StagingID += Convert.ToString(gvCAMSProfileReject.DataKeys[gvr.RowIndex].Value) + "~";
                }
            }

            if (i == 0)
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Please select record to delete!');", true);
            }
            else
            {
                rejectedRecordsBo = new RejectedRecordsBo();
                rejectedRecordsBo.DeleteMFRejectedFolios(StagingID);
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "loadcontrol('RejectedMFFolio','login');", true);
            }
        }
        private void BindWerpProfileGrid(int ProcessId)
        {
            //Dictionary<string, string> genDictIsRejected = new Dictionary<string, string>();
            Dictionary <string, string> genDictRejectReason = new Dictionary <string, string>();

            // Dictionary<string, string> genDictIsCustomerExisting = new Dictionary<string, string>();

            if (hdnCurrentPage.Value.ToString() != "")
            {
                mypager.CurrentPage  = Int32.Parse(hdnCurrentPage.Value.ToString());
                hdnCurrentPage.Value = "";
            }

            int Count;

            rejectedRecordsBo = new RejectedRecordsBo();

            if (ProcessId == 0)
            {   // Bind All Processes
                dsRejectedRecords = rejectedRecordsBo.getSuperAdminWERPRejectedProfile(ProcessId, mypager.CurrentPage, out Count, hdnSort.Value, hdnPANFilter.Value, hdnRejectReasonFilter.Value, hdnBrokerCodeFilter.Value, hdnCustomerNameFilter.Value, hdnAdviserFilter.Value);
                //   PANFilter, RejectReasonFilter, BrokerFilter, CustomerNameFilter);
            }
            else
            {   // Bind Grid for the specific Process Id
                dsRejectedRecords = rejectedRecordsBo.getSuperAdminWERPRejectedProfile(ProcessId, mypager.CurrentPage, out Count, hdnSort.Value, hdnPANFilter.Value, hdnRejectReasonFilter.Value, hdnBrokerCodeFilter.Value, hdnCustomerNameFilter.Value, hdnAdviserFilter.Value);
            }

            lblTotalRows.Text = hdnRecordCount.Value = Count.ToString();
            if (Count > 0)
            {
                DivPager.Style.Add("display", "visible");
            }

            if (dsRejectedRecords.Tables[0].Rows.Count > 0)
            {   // If Records found, then bind them to grid
                trMessage.Visible              = false;
                trReprocess.Visible            = true;
                gvWERPProfileReject.DataSource = dsRejectedRecords.Tables[0];
                gvWERPProfileReject.DataBind();

                if (dsRejectedRecords.Tables[2].Rows.Count > 0)
                {
                    // Get the Reject Reason Codes Available into Generic Dictionary
                    foreach (DataRow dr in dsRejectedRecords.Tables[2].Rows)
                    {
                        genDictRejectReason.Add(dr["RejectReason"].ToString(), dr["RejectReasonCode"].ToString());
                    }

                    DropDownList ddlRejectReason = GetRejectReasonDDL();
                    if (ddlRejectReason != null)
                    {
                        ddlRejectReason.DataSource     = genDictRejectReason;
                        ddlRejectReason.DataTextField  = "Key";
                        ddlRejectReason.DataValueField = "Value";
                        ddlRejectReason.DataBind();
                        ddlRejectReason.Items.Insert(0, new ListItem("Select", "Select"));
                    }

                    if (hdnRejectReasonFilter.Value != "")
                    {
                        ddlRejectReason.SelectedValue = hdnRejectReasonFilter.Value.ToString().Trim();
                    }
                }

                BindPanNumber(dsRejectedRecords.Tables[3]);
                BindProcessId(dsRejectedRecords.Tables[4]);
                BindAdviser(dsRejectedRecords.Tables[5]);
            }
            else
            {
                hdnRecordCount.Value           = "0";
                gvWERPProfileReject.DataSource = null;
                gvWERPProfileReject.DataBind();
                trMessage.Visible   = true;
                trReprocess.Visible = false;
            }
            this.GetPageCount();
        }
Exemplo n.º 14
0
        protected void btnEditSelectedWPTrans_Click(object sender, EventArgs e)
        {
            //int Id = 0;
            string panNumber          = string.Empty;
            string tradeAccountNumber = string.Empty;
            string scripCode          = string.Empty;
            string newScripCode       = string.Empty;
            string exchange           = string.Empty;
            string price    = string.Empty;
            string newPrice = string.Empty;

            string transactionType    = string.Empty;
            string newTransactionType = string.Empty;
            bool   blResult           = false;

            rejectedRecordsBo = new RejectedRecordsBo();

            // Gets the footer row directly Cool right!
            GridViewRow footerRow = gvWERPTrans.FooterRow;

            string newPanNumber = ((TextBox)footerRow.FindControl("txtPanNumberMultiple")).Text;

            if (((TextBox)footerRow.FindControl("txtScripCodeMultiple")).Text != string.Empty)
            {
                newScripCode = ((TextBox)footerRow.FindControl("txtScripCodeMultiple")).Text;
            }

            string newExchange = ((TextBox)footerRow.FindControl("txtExchangeMultiple")).Text;

            if (((DropDownList)footerRow.FindControl("ddlTransactionType")).SelectedValue != "-1")
            {
                newTransactionType = ((DropDownList)footerRow.FindControl("ddlTransactionType")).SelectedValue;
            }

            if (((TextBox)footerRow.FindControl("txtPriceMultiple")).Text != string.Empty)
            {
                newPrice = ((TextBox)footerRow.FindControl("txtPriceMultiple")).Text;
            }



            foreach (GridViewRow dr in gvWERPTrans.Rows)
            {
                CheckBox checkBox = (CheckBox)dr.FindControl("chkBxWPTrans");
                if (checkBox.Checked)
                {
                    if (newPanNumber != "" || newScripCode != "" || newExchange != "" || newPrice != "" || newTransactionType != "") //Change this logic
                    {
                        panNumber       = newPanNumber;
                        scripCode       = newScripCode;
                        exchange        = newExchange;
                        transactionType = newTransactionType;
                        price           = newPrice;
                    }
                    else
                    {
                        panNumber = ((TextBox)dr.FindControl("txtPanNumber")).Text;
                        if (((TextBox)dr.FindControl("txtScripCode")).Text != string.Empty)
                        {
                            scripCode = ((TextBox)dr.FindControl("txtScripCode")).Text;
                        }
                        exchange        = ((TextBox)dr.FindControl("txtExchange")).Text;
                        transactionType = ((DropDownList)dr.FindControl("ddlTransactionType")).SelectedValue;
                        // price = Convert.ToDouble(((TextBox)dr.FindControl("txtPrice")).Text);
                        price = ((TextBox)dr.FindControl("txtPrice")).Text;
                    }
                    int id = Convert.ToInt32(gvWERPTrans.DataKeys[dr.RowIndex].Value);


                    blResult = rejectedRecordsBo.UpdateRejectedEquityTransactionStaging(id, panNumber, scripCode, exchange, price.ToString(), transactionType);
                }
            }

            if (blResult)
            {
                // Success Message
            }
            else
            {
                // Failure Message
            }

            // BindGrid
            if (Request.QueryString["processId"] != null)
            {
                ProcessId = Int32.Parse(Request.QueryString["processId"].ToString());
            }
            BindEquityTransactionGrid(ProcessId);
        }
Exemplo n.º 15
0
        private void BindEquityTransactionGrid(int ProcessId)
        {
            Dictionary <string, string> genDictIsRejected   = new Dictionary <string, string>();
            Dictionary <string, string> genDictRejectReason = new Dictionary <string, string>();

            if (hdnCurrentPage.Value.ToString() != "")
            {
                mypager.CurrentPage  = Int32.Parse(hdnCurrentPage.Value.ToString());
                hdnCurrentPage.Value = "";
            }

            int Count;

            rejectedRecordsBo = new RejectedRecordsBo();

            dsRejectedRecords = rejectedRecordsBo.GetRejectedEquityTransactionsStaging(ProcessId, mypager.CurrentPage, out Count, hdnSort.Value, hdnRejectReasonFilter.Value, hdnPanNumberFilter.Value, hdnScripFilter.Value, hdnExchangeFilter.Value, hdnTransactionTypeFilter.Value);
            lblTotalRows.Text = hdnRecordCount.Value = Count.ToString();

            //lblTotalRows.Text = (Count.ToString());
            if (Count > 0)
            {
                DivPager.Style.Add("display", "visible");
            }

            if (dsRejectedRecords.Tables[0].Rows.Count > 0)
            {                                                           // If Records found, then bind them to grid
                dtTransactionTypes       = dsRejectedRecords.Tables[4]; //All transaction types
                dtFilterTransactionTypes = dsRejectedRecords.Tables[5]; //Transaction types for filter
                trMessage.Visible        = false;
                trReprocess.Visible      = true;
                gvWERPTrans.DataSource   = dsRejectedRecords.Tables[0];
                gvWERPTrans.DataBind();


                if (dsRejectedRecords.Tables[2].Rows.Count > 0)
                {
                    // Get the Reject Reason Codes Available into Generic Dictionary
                    foreach (DataRow dr in dsRejectedRecords.Tables[2].Rows)
                    {
                        genDictRejectReason.Add(dr["RejectReason"].ToString(), dr["RejectReasonCode"].ToString());
                    }

                    DropDownList ddlRejectReason = GetRejectReasonDDL();
                    if (ddlRejectReason != null)
                    {
                        ddlRejectReason.DataSource     = genDictRejectReason;
                        ddlRejectReason.DataTextField  = "Key";
                        ddlRejectReason.DataValueField = "Value";
                        ddlRejectReason.DataBind();
                        ddlRejectReason.Items.Insert(0, new ListItem("Select Reject Reason", "Select Reject Reason"));
                    }

                    if (hdnRejectReasonFilter.Value != "")
                    {
                        ddlRejectReason.SelectedValue = hdnRejectReasonFilter.Value.ToString().Trim();
                    }
                }

                BindPanNumber(dsRejectedRecords.Tables[3]);
            }
            else
            {
                hdnRecordCount.Value   = "0";
                gvWERPTrans.DataSource = null;
                gvWERPTrans.DataBind();
                trMessage.Visible   = true;
                trReprocess.Visible = false;
            }
            this.GetPageCount();
        }
Exemplo n.º 16
0
        private void BindRejectedUploadsGrid(int ProcessId)
        {
            // Dictionary<string, string> genDictIsRejected = new Dictionary<string, string>();
            Dictionary <string, string> genDictRejectReason = new Dictionary <string, string>();

            if (hdnCurrentPage.Value.ToString() != "")
            {
                mypager.CurrentPage  = Int32.Parse(hdnCurrentPage.Value.ToString());
                hdnCurrentPage.Value = "";
            }

            int Count;

            rejectedRecordsBo = new RejectedRecordsBo();

            if (ProcessId == 0) //TODO : This IF ELSE can be removed.
            {                   // Bind All Processes
                dsRejectedRecords = rejectedRecordsBo.GetRejectedTradeAccountStaging(ProcessId, mypager.CurrentPage, out Count, hdnSort.Value, hdnTradeAccountNumFilter.Value, hdnRejectReasonFilter.Value, hdnPanFilter.Value);
            }
            else
            {   // Bind Grid for the specific Process Id
                dsRejectedRecords = rejectedRecordsBo.GetRejectedTradeAccountStaging(ProcessId, mypager.CurrentPage, out Count, hdnSort.Value, hdnTradeAccountNumFilter.Value, hdnRejectReasonFilter.Value, hdnPanFilter.Value);
            }

            lblTotalRows.Text = hdnRecordCount.Value = Count.ToString();
            if (Count > 0)
            {
                DivPager.Style.Add("display", "visible");
            }

            if (dsRejectedRecords.Tables[0].Rows.Count > 0)
            {   // If Records found, then bind them to grid
                trMessage.Visible      = false;
                trReprocess.Visible    = true;
                gvWERPTrans.DataSource = dsRejectedRecords.Tables[0];
                gvWERPTrans.DataBind();


                if (dsRejectedRecords.Tables[2].Rows.Count > 0)
                {
                    // Get the Reject Reason Codes Available into Generic Dictionary
                    foreach (DataRow dr in dsRejectedRecords.Tables[2].Rows)
                    {
                        genDictRejectReason.Add(dr["RejectReason"].ToString(), dr["RejectReasonCode"].ToString());
                    }

                    DropDownList ddlRejectReason = GetRejectReasonDDL();
                    if (ddlRejectReason != null)
                    {
                        ddlRejectReason.DataSource     = genDictRejectReason;
                        ddlRejectReason.DataTextField  = "Key";
                        ddlRejectReason.DataValueField = "Value";
                        ddlRejectReason.DataBind();
                        ddlRejectReason.Items.Insert(0, new ListItem("Select", "Select"));
                    }

                    if (hdnRejectReasonFilter.Value != "")
                    {
                        ddlRejectReason.SelectedValue = hdnRejectReasonFilter.Value.ToString().Trim();
                    }
                }
                BindPanNumber(dsRejectedRecords.Tables[3]);
            }
            else
            {
                hdnRecordCount.Value   = "0";
                gvWERPTrans.DataSource = null;
                gvWERPTrans.DataBind();
                trMessage.Visible   = true;
                trReprocess.Visible = false;
            }
            this.GetPageCount();
        }
        protected void btnProbableInsert_Click(object sender, EventArgs e)
        {
            bool   result       = true;
            bool   blResult     = true;
            string gvStagingIds = "";

            uploadsCommonBo = new UploadCommonBo();
            processlogVo    = uploadsCommonBo.GetProcessLogInfo(ProcessId);

            int fileTypeId = processlogVo.FileTypeId;

            rejectedRecordsBo = new RejectedRecordsBo();
            foreach (GridDataItem gvRow in gvWERPTrans.MasterTableView.Items)
            //foreach (GridViewRow gvRow in gvWERPTrans.Rows)
            {
                CheckBox ChkBxItem = (CheckBox)gvRow.FindControl("chkId");
                if (ChkBxItem.Checked)
                {
                    gvStagingIds += gvWERPTrans.MasterTableView.DataKeyValues[gvRow.RowIndex]["CMFTSId"].ToString() + ",";
                }
            }
            result = rejectedRecordsBo.InsertProbableDuplicatesRejectedTransaction(gvStagingIds);
            if (result)
            {
                // Success Message
                processlogVo.IsInsertionToWERPComplete = 1;
                processlogVo.NoOfTransactionInserted   = uploadsCommonBo.GetTransUploadCount(ProcessId, "WPMF");

                processlogVo.EndTime = DateTime.Now;

                if (fileTypeId == 1)
                {
                    processlogVo.NoOfRejectedRecords = uploadsCommonBo.GetTransUploadRejectCount(ProcessId, Contants.UploadExternalTypeCAMS);
                }
                else if (fileTypeId == 3)
                {
                    processlogVo.NoOfRejectedRecords = uploadsCommonBo.GetTransUploadRejectCount(ProcessId, Contants.UploadExternalTypeKarvy);
                }
                else if (fileTypeId == 15)
                {
                    processlogVo.NoOfRejectedRecords = uploadsCommonBo.GetTransUploadRejectCount(ProcessId, Contants.UploadExternalTypeTemp);
                }
                else if (fileTypeId == 17)
                {
                    processlogVo.NoOfRejectedRecords = uploadsCommonBo.GetTransUploadRejectCount(ProcessId, Contants.UploadExternalTypeDeutsche);
                }
                else if (filetypeId == 25)
                {
                    processlogVo.NoOfRejectedRecords = uploadsCommonBo.GetTransUploadRejectCount(ProcessId, "SU");
                }
                blResult = uploadsCommonBo.UpdateUploadProcessLog(processlogVo);

                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Records Inserted Successfully');", true);
            }
            else
            {
                // Failure Message
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Please Select Probable Duplicate Records');", true);
            }

            BindEquityTransactionGrid(ProcessId);
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string newScheme         = string.Empty;
            string PanNum            = string.Empty;
            string TransactionType   = string.Empty;
            string FolioNumber       = string.Empty;
            double Price             = 0;
            double Units             = 0;
            double Amount            = 0;
            int    UserTransactionNo = 0;
            int    CMFTSId           = 0;
            bool   blResult          = false;

            rejectedRecordsBo = new RejectedRecordsBo();
            GridFooterItem footerRow = (GridFooterItem)gvWERPTrans.MasterTableView.GetItems(GridItemType.Footer)[0];

            foreach (GridDataItem dr in gvWERPTrans.Items)
            {
                if (((TextBox)footerRow.FindControl("txtSchemeFooter")).Text.Trim() == "")
                {
                    newScheme = ((TextBox)dr.FindControl("txtScheme")).Text;
                }
                else
                {
                    newScheme = ((TextBox)footerRow.FindControl("txtSchemeFooter")).Text;
                }
                if (((TextBox)footerRow.FindControl("txtPanFooter")).Text.Trim() == "")
                {
                    PanNum = ((TextBox)dr.FindControl("txtPanNum")).Text;
                }
                else
                {
                    PanNum = ((TextBox)footerRow.FindControl("txtPanFooter")).Text;
                }
                if (((TextBox)footerRow.FindControl("txtTransactionFooter")).Text.Trim() == "")
                {
                    TransactionType = ((TextBox)dr.FindControl("txtTransaction")).Text;
                }
                else
                {
                    TransactionType = ((TextBox)footerRow.FindControl("txtTransactionFooter")).Text;
                }
                if (((TextBox)footerRow.FindControl("txtFolioNumberFooter")).Text.Trim() == "")
                {
                    FolioNumber = ((TextBox)dr.FindControl("txtFolioNumber")).Text;
                }
                else
                {
                    FolioNumber = ((TextBox)footerRow.FindControl("txtFolioNumberFooter")).Text;
                }

                if (((TextBox)footerRow.FindControl("txtPriceFooter")).Text.Trim() == "")
                {
                    Price = Convert.ToDouble(((TextBox)dr.FindControl("txtPrice")).Text);
                }
                else
                {
                    Price = Convert.ToDouble(((TextBox)footerRow.FindControl("txtPriceFooter")).Text);
                }
                if (((TextBox)footerRow.FindControl("txtUnitsFooter")).Text.Trim() == "")
                {
                    Units = Convert.ToDouble(((TextBox)dr.FindControl("txtUnits")).Text);
                }
                else
                {
                    Units = Convert.ToDouble(((TextBox)footerRow.FindControl("txtUnitsFooter")).Text);
                }
                if (((TextBox)footerRow.FindControl("txtAmountFooter")).Text.Trim() == "")
                {
                    Amount = Convert.ToDouble(((TextBox)dr.FindControl("txtAmount")).Text);
                }
                else
                {
                    Amount = Convert.ToDouble(((TextBox)footerRow.FindControl("txtAmountFooter")).Text);
                }
                if (((TextBox)footerRow.FindControl("txtUsertransactionFooter")).Text.Trim() == "")
                {
                    UserTransactionNo = Convert.ToInt32(((TextBox)dr.FindControl("txtUsertransaction")).Text);
                }
                else
                {
                    UserTransactionNo = Convert.ToInt32(((TextBox)footerRow.FindControl("txtUsertransactionFooter")).Text);
                }


                CheckBox checkBox = (CheckBox)dr.FindControl("chkId");
                if (checkBox.Checked)
                {
                    int          selectedRow = 0;
                    GridDataItem gdi;
                    gdi         = (GridDataItem)checkBox.NamingContainer;
                    selectedRow = gdi.ItemIndex + 1;
                    CMFTSId     = int.Parse((gvWERPTrans.MasterTableView.DataKeyValues[selectedRow - 1]["CMFTSId"].ToString()));
                    blResult    = rejectedRecordsBo.UpdateMFTrasactionStaging(CMFTSId, PanNum, newScheme, TransactionType, FolioNumber, Price, Units, Amount, UserTransactionNo);
                }
            }
            if (blResult)
            {
                // Success Message
            }
            else
            {
                // Failure Message
            }
            // BindGrid
            if (Request.QueryString["processId"] != null)
            {
                ProcessId = Int32.Parse(Request.QueryString["processId"].ToString());
            }
            if (Request.QueryString["filetypeid"] != null)
            {
                filetypeId = Int32.Parse(Request.QueryString["filetypeid"].ToString());
            }
            //BindGrid(ProcessId);
            BindEquityTransactionGrid(ProcessId);
        }
Exemplo n.º 19
0
        private void BindEquityTransactionGrid(int ProcessId)
        {
            if (ProcessId == null || ProcessId == 0)
            {
                if (txtFromTran.SelectedDate != null)
                {
                    fromDate = DateTime.Parse(txtFromTran.SelectedDate.ToString());
                }
                if (txtToTran.SelectedDate != null)
                {
                    toDate = DateTime.Parse(txtToTran.SelectedDate.ToString());
                }

                rejectReasonCode = int.Parse(ddlRejectReason.SelectedValue);
            }
            Dictionary <string, string> genDictIsRejected   = new Dictionary <string, string>();
            Dictionary <string, string> genDictRejectReason = new Dictionary <string, string>();

            //if (hdnCurrentPage.Value.ToString() != "")
            //{
            //    mypager.CurrentPage = Int32.Parse(hdnCurrentPage.Value.ToString());
            //    hdnCurrentPage.Value = "";
            //}
            rejectedRecordsBo = new RejectedRecordsBo();
            dsRejectedRecords = rejectedRecordsBo.GetRejectedEquityTransactionsStaging(adviserVo.advisorId, ProcessId, fromDate, toDate, rejectReasonCode);
            if (dsRejectedRecords.Tables[0].Rows.Count > 0)
            {
                //trMessage.Visible = false;
                trReprocess.Visible = true;
                DivAction.Visible   = true;
                // msgDelete.Visible = false;

                if (Cache["RejectedEquityDetails" + adviserVo.advisorId.ToString()] == null)
                {
                    Cache.Insert("RejectedEquityDetails" + adviserVo.advisorId.ToString(), dsRejectedRecords);
                }
                else
                {
                    Cache.Remove("RejectedEquityDetails" + adviserVo.advisorId.ToString());
                    Cache.Insert("RejectedEquityDetails" + adviserVo.advisorId.ToString(), dsRejectedRecords);
                }

                gvWERPTrans.CurrentPageIndex = 0;
                gvWERPTrans.DataSource       = dsRejectedRecords.Tables[0];
                gvWERPTrans.DataBind();
                gvWERPTrans.Visible = true;
                Panel2.Visible      = true;
                msgDelete.Visible   = false;
                btnExport.Visible   = true;
            }
            else
            {
                hdnRecordCount.Value   = "0";
                gvWERPTrans.DataSource = null;
                gvWERPTrans.DataBind();
                Msgerror.Visible = true;
                //trMessage.Visible = true;
                DivAction.Visible   = false;
                gvWERPTrans.Visible = false;
                Panel2.Visible      = false;
                trReprocess.Visible = false;
                btnExport.Visible   = false;
            }
        }
        private void BindEquityTransactionGrid(int ProcessId)
        {
            Dictionary <string, string> genDictIsRejected   = new Dictionary <string, string>();
            Dictionary <string, string> genDictRejectReason = new Dictionary <string, string>();

            if (hdnCurrentPage.Value.ToString() != "")
            {
                mypager.CurrentPage  = Int32.Parse(hdnCurrentPage.Value.ToString());
                hdnCurrentPage.Value = "";
            }

            int Count;

            rejectedRecordsBo = new RejectedRecordsBo();

            dsRejectedRecords = rejectedRecordsBo.GetRejectedMFTransactionStaging(adviserVo.advisorId, mypager.CurrentPage, out Count, hdnSort.Value, int.Parse(hdnProcessIdFilter.Value), hdnRejectReasonFilter.Value, hdnFileNameFilter.Value, hdnFolioFilter.Value, hdnTransactionTypeFilter.Value, hdnInvNameFilter.Value, hdnSourceTypeFilter.Value, hdnSchemeNameFilter.Value);

            lblTotalRows.Text = hdnRecordCount.Value = Count.ToString();
            if (Count > 0)
            {
                DivPager.Style.Add("display", "visible");
            }

            if (dsRejectedRecords.Tables[0].Rows.Count > 0)
            {   // If Records found, then bind them to grid
                trMessage.Visible      = false;
                trReprocess.Visible    = true;
                gvWERPTrans.DataSource = dsRejectedRecords.Tables[0];
                gvWERPTrans.DataBind();


                if (dsRejectedRecords.Tables[2].Rows.Count > 0)
                {
                    // Get the Reject Reason Codes Available into Generic Dictionary
                    foreach (DataRow dr in dsRejectedRecords.Tables[2].Rows)
                    {
                        if (dr["RejectReasonCode"].ToString() != "7")
                        {
                            genDictRejectReason.Add(dr["RejectReason"].ToString(), dr["RejectReasonCode"].ToString());
                        }
                    }

                    DropDownList ddlRejectReason = GetRejectReasonDDL();
                    if (ddlRejectReason != null)
                    {
                        ddlRejectReason.DataSource     = genDictRejectReason;
                        ddlRejectReason.DataTextField  = "Key";
                        ddlRejectReason.DataValueField = "Value";
                        ddlRejectReason.DataBind();
                        ddlRejectReason.Items.Insert(0, new ListItem("Select", "Select"));
                    }

                    if (hdnRejectReasonFilter.Value != "")
                    {
                        ddlRejectReason.SelectedValue = hdnRejectReasonFilter.Value.ToString().Trim();
                    }
                }

                BindProcessId(dsRejectedRecords.Tables[3]);
                BindInvName(dsRejectedRecords.Tables[6]);
                BindFileName(dsRejectedRecords.Tables[4]);
                BindSourceType(dsRejectedRecords.Tables[5]);
                BindFolioNumber(dsRejectedRecords.Tables[7]);
                BindSchemeName(dsRejectedRecords.Tables[8]);
                BindTransactionType(dsRejectedRecords.Tables[9]);
            }
            else
            {
                hdnRecordCount.Value   = "0";
                gvWERPTrans.DataSource = null;
                gvWERPTrans.DataBind();
                trMessage.Visible   = true;
                trReprocess.Visible = false;
            }
            this.GetPageCount();
        }
        private void BindGrid(int ProcessId)
        {
            Dictionary <string, string> genDictIsRejected         = new Dictionary <string, string>();
            Dictionary <string, string> genDictRejectReason       = new Dictionary <string, string>();
            Dictionary <string, string> genDictIsCustomerExisting = new Dictionary <string, string>();

            try
            {
                if (hdnCurrentPage.Value.ToString() != "")
                {
                    mypager.CurrentPage  = Int32.Parse(hdnCurrentPage.Value.ToString());
                    hdnCurrentPage.Value = "";
                }

                int Count;

                rejectedRecordsBo = new RejectedRecordsBo();

                if (ProcessId == 0)
                {   // Bind All Processes
                    dsRejectedRecords = rejectedRecordsBo.getMFRejectedFolios(ProcessId, mypager.CurrentPage, out Count, hdnSortProcessID.Value, hdnIsRejectedFilter.Value, hdnPANFilter.Value.Trim(), hdnRejectReasonFilter.Value, hdnNameFilter.Value.Trim(), hdnFolioFilter.Value.Trim(), hdnIsCustomerExistingFilter.Value);
                }
                else
                {   // Bind Grid for the specific Process Id
                    dsRejectedRecords = rejectedRecordsBo.getMFRejectedFolios(ProcessId, mypager.CurrentPage, out Count, hdnSortProcessID.Value, hdnIsRejectedFilter.Value, hdnPANFilter.Value.Trim(), hdnRejectReasonFilter.Value, hdnNameFilter.Value.Trim(), hdnFolioFilter.Value.Trim(), hdnIsCustomerExistingFilter.Value);
                }

                lblTotalRows.Text = hdnRecordCount.Value = Count.ToString();
                if (Count > 0)
                {
                    DivPager.Style.Add("display", "visible");
                }

                if (dsRejectedRecords.Tables[0].Rows.Count > 0)
                {   // If Records found, then bind them to grid
                    trProfileMessage.Visible = false;
                    trReprocess.Visible      = true;

                    gvCAMSProfileReject.DataSource = dsRejectedRecords.Tables[0];
                    gvCAMSProfileReject.DataBind();

                    if (dsRejectedRecords.Tables[2].Rows.Count > 0)
                    {
                        // Get the Reject Reason Codes Available into Generic Dictionary
                        foreach (DataRow dr in dsRejectedRecords.Tables[2].Rows)
                        {
                            genDictRejectReason.Add(dr["WRR_RejectReasonDescription"].ToString(), dr["WRR_RejectReasonCode"].ToString());
                        }

                        DropDownList ddlRejectReason = GetRejectReasonDDL();
                        if (ddlRejectReason != null)
                        {
                            ddlRejectReason.DataSource     = genDictRejectReason;
                            ddlRejectReason.DataTextField  = "Key";
                            ddlRejectReason.DataValueField = "Value";
                            ddlRejectReason.DataBind();
                            ddlRejectReason.Items.Insert(0, new ListItem("Select Reject Reason", "Select Reject Reason"));
                        }

                        if (hdnRejectReasonFilter.Value != "")
                        {
                            ddlRejectReason.SelectedValue = hdnRejectReasonFilter.Value.ToString().Trim();
                        }
                    }

                    if (dsRejectedRecords.Tables[3].Rows.Count > 0)
                    {
                        // Get Is Reject Flags Available into Generic Dictionary
                        foreach (DataRow dr in dsRejectedRecords.Tables[3].Rows)
                        {
                            genDictIsRejected.Add(dr["IsRejected"].ToString(), dr["IsRejected"].ToString());
                        }

                        DropDownList ddlReject = GetIsRejectedDDL();
                        if (ddlReject != null)
                        {
                            ddlReject.DataSource     = genDictIsRejected;
                            ddlReject.DataTextField  = "Key";
                            ddlReject.DataValueField = "Value";
                            ddlReject.DataBind();
                            ddlReject.Items.Insert(0, new ListItem("Select Is Reject Flag", "Select Is Reject Flag"));
                        }

                        if (hdnIsRejectedFilter.Value != "")
                        {
                            ddlReject.SelectedValue = hdnIsRejectedFilter.Value.ToString().Trim();
                        }
                    }

                    if (dsRejectedRecords.Tables[4].Rows.Count > 0)
                    {
                        // Get Is Customer Exist Flag into Generic Dictionary
                        foreach (DataRow dr in dsRejectedRecords.Tables[4].Rows)
                        {
                            genDictIsCustomerExisting.Add(dr["CustomerExists"].ToString(), dr["CustomerExists"].ToString());
                        }

                        DropDownList ddlCustExists = GetCustExistsDDL();
                        if (ddlCustExists != null)
                        {
                            ddlCustExists.DataSource     = genDictIsCustomerExisting;
                            ddlCustExists.DataTextField  = "Key";
                            ddlCustExists.DataValueField = "Value";
                            ddlCustExists.DataBind();
                            ddlCustExists.Items.Insert(0, new ListItem("Select a Flag", "Select a Flag"));
                        }

                        if (hdnIsCustomerExistingFilter.Value != "")
                        {
                            ddlCustExists.SelectedValue = hdnIsCustomerExistingFilter.Value.ToString().Trim();
                        }
                    }

                    TextBox txtName  = GetNameTextBox();
                    TextBox txtFolio = GetFolioTextBox();
                    TextBox txtPan   = GetPanTextBox();

                    if (txtName != null && txtFolio != null && txtPan != null)
                    {
                        if (hdnNameFilter.Value != "")
                        {
                            txtName.Text = hdnNameFilter.Value.ToString().Trim();
                        }
                        if (hdnFolioFilter.Value != "")
                        {
                            txtFolio.Text = hdnFolioFilter.Value.ToString().Trim();
                        }
                        if (hdnPANFilter.Value != "")
                        {
                            txtPan.Text = hdnPANFilter.Value.ToString().Trim();
                        }
                    }
                }
                else
                {
                    hdnRecordCount.Value           = "0";
                    gvCAMSProfileReject.DataSource = null;
                    gvCAMSProfileReject.DataBind();
                    trProfileMessage.Visible = true;
                    trReprocess.Visible      = false;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "RejectedCAMSProfile.ascx:BindGrid()");

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

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

            this.GetPageCount();
        }