Ejemplo n.º 1
0
        private bool TradeAccountStagingInsertion(int ProcessId, out int countTransactionsInserted, out int countRejectedRecords)
        {
            bool blResult = false;

            processlogVo    = new UploadProcessLogVo();
            uploadsCommonBo = new UploadCommonBo();
            werpUploadBo    = new WerpUploadsBo();

            countTransactionsInserted = 0;
            countRejectedRecords      = 0;

            processlogVo = uploadsCommonBo.GetProcessLogInfo(ProcessId);
            WerpEQUploadsBo werpEQUploadsBo = new WerpEQUploadsBo();
            // WERP Insertion
            string packagePath = Server.MapPath("\\UploadPackages\\EQTradeAccountUploadPackage\\EQTradeAccountUploadPackage\\EQTradeAccountUploadPackage\\UploadChecksOnEQTradeStaging.dtsx");
            bool   WERPEQSecondStagingCheckResult = werpEQUploadsBo.WERPEQProcessDataInSecondStagingTradeAccount(ProcessId, packagePath, configPath, adviserVo.advisorId);

            if (WERPEQSecondStagingCheckResult)
            {
                packagePath = Server.MapPath("\\UploadPackages\\EQTradeAccountUploadPackage\\EQTradeAccountUploadPackage\\EQTradeAccountUploadPackage\\UploadEQTradeStagingToWerp.dtsx");
                bool WERPEQTradeWerpResult = werpEQUploadsBo.WERPEQInsertTradeAccountDetails(ProcessId, packagePath, configPath);

                if (WERPEQTradeWerpResult)
                {
                    processlogVo.IsInsertionToWERPComplete = 1;
                    processlogVo.NoOfAccountsInserted      = uploadsCommonBo.GetAccountsUploadCount(ProcessId, "WPEQ");
                    processlogVo.NoOfRejectedRecords       = uploadsCommonBo.GetAccountsUploadRejectCount(ProcessId, "WPEQ");
                    processlogVo.EndTime = DateTime.Now;
                    bool updateProcessLog = uploadsCommonBo.UpdateUploadProcessLog(processlogVo);

                    if (updateProcessLog)
                    {
                        blResult = true;
                    }
                }
            }

            return(blResult);
        }
        protected void btnReprocess_Click(object sender, EventArgs e)
        {
            bool                    blResult                = false;
            UploadCommonBo          uploadsCommonBo         = new UploadCommonBo();
            UploadProcessLogVo      processlogVo            = new UploadProcessLogVo();
            UploadProcessLogVo      TempprocesslogVo        = new UploadProcessLogVo();
            StandardProfileUploadBo standardProfileUploadBo = new StandardProfileUploadBo();
            StandardFolioUploadBo   standardFolioUploadBo   = new StandardFolioUploadBo();
            CamsUploadsBo           camsUploadsBo           = new CamsUploadsBo();
            int countCustCreated = 0;

            //int countFolioCreated = 0;
            //int countRejectedRecords = 0;

            // processlogVo = uploadsCommonBo.GetProcessLogInfo(ProcessId);


            // 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());
            }

            processlogVo = uploadsCommonBo.GetProcessLogInfo(ProcessId);
            if (uploadsCommonBo.ResetRejectedFlagByProcess(ProcessId, 9))
            {
                //Folio Chks in Std Folio Staging
                string packagePath = Server.MapPath("\\UploadPackages\\StandardFolioUploadPackageNew\\StandardFolioUploadPackageNew\\UploadsCommonFolioChecksInFolioStaging.dtsx");
                bool   camsFolioStagingChkResult = standardFolioUploadBo.StdFolioChksInFolioStaging(packagePath, adviserVo.advisorId, ProcessId, configPath);
                if (camsFolioStagingChkResult)
                {
                    //Folio Chks in Std Folio Staging
                    packagePath = Server.MapPath("\\UploadPackages\\StandardFolioUploadPackageNew\\StandardFolioUploadPackageNew\\UploadStdFolioFromFolioStagingToWerpTable.dtsx");
                    bool camsFolioWerpInsertionResult = standardFolioUploadBo.StdCustomerFolioCreation(packagePath, adviserVo.advisorId, ProcessId, configPath);
                    if (camsFolioWerpInsertionResult)
                    {
                        processlogVo.IsInsertionToWERPComplete = 1;
                        processlogVo.EndTime = DateTime.Now;
                        if (processlogVo.FileTypeId == 2)
                        {
                            processlogVo.IsInsertionToWERPComplete = 1;
                            processlogVo.EndTime               = DateTime.Now;
                            processlogVo.NoOfRejectedRecords   = uploadsCommonBo.GetProfileUploadRejectCount(ProcessId, "CA");
                            processlogVo.NoOfAccountsInserted  = uploadsCommonBo.GetAccountsUploadCount(ProcessId, "WPMF");
                            processlogVo.NoOfInputRejects      = uploadsCommonBo.GetUploadProfileInputRejectCount(ProcessId, "CA");
                            processlogVo.NoOfAccountDuplicates = processlogVo.NoOfTotalRecords - processlogVo.NoOfAccountsInserted - processlogVo.NoOfRejectedRecords;
                        }
                        else if (processlogVo.FileTypeId == 4)
                        {
                            processlogVo.IsInsertionToWERPComplete = 1;
                            processlogVo.EndTime               = DateTime.Now;
                            processlogVo.NoOfRejectedRecords   = uploadsCommonBo.GetProfileUploadRejectCount(ProcessId, "KA");
                            processlogVo.NoOfAccountsInserted  = uploadsCommonBo.GetAccountsUploadCount(ProcessId, "WPMF");
                            processlogVo.NoOfInputRejects      = uploadsCommonBo.GetUploadProfileInputRejectCount(ProcessId, "KA");
                            processlogVo.NoOfAccountDuplicates = processlogVo.NoOfTotalRecords - processlogVo.NoOfAccountsInserted - processlogVo.NoOfRejectedRecords;
                        }
                        else if (processlogVo.FileTypeId == 16)
                        {
                            processlogVo.IsInsertionToWERPComplete = 1;
                            processlogVo.EndTime               = DateTime.Now;
                            processlogVo.NoOfRejectedRecords   = uploadsCommonBo.GetProfileUploadRejectCount(ProcessId, "TN");
                            processlogVo.NoOfAccountsInserted  = uploadsCommonBo.GetAccountsUploadCount(ProcessId, "WPMF");
                            processlogVo.NoOfInputRejects      = uploadsCommonBo.GetUploadProfileInputRejectCount(ProcessId, "TN");
                            processlogVo.NoOfAccountDuplicates = processlogVo.NoOfTotalRecords - processlogVo.NoOfAccountsInserted - processlogVo.NoOfRejectedRecords;
                            blResult = uploadsCommonBo.UpdateUploadProcessLog(processlogVo);
                        }
                        else if (processlogVo.FileTypeId == 18)
                        {
                            processlogVo.IsInsertionToWERPComplete = 1;
                            processlogVo.EndTime               = DateTime.Now;
                            processlogVo.NoOfRejectedRecords   = uploadsCommonBo.GetProfileUploadRejectCount(ProcessId, "DT");
                            processlogVo.NoOfAccountsInserted  = uploadsCommonBo.GetAccountsUploadCount(ProcessId, "WPMF");
                            processlogVo.NoOfInputRejects      = uploadsCommonBo.GetUploadProfileInputRejectCount(ProcessId, "DT");
                            processlogVo.NoOfAccountDuplicates = processlogVo.NoOfTotalRecords - processlogVo.NoOfAccountsInserted - processlogVo.NoOfRejectedRecords;
                            blResult = uploadsCommonBo.UpdateUploadProcessLog(processlogVo);
                        }
                        blResult = uploadsCommonBo.UpdateUploadProcessLog(processlogVo);
                        if (blResult)
                        {
                            bool stdFolioCommonDeleteResult = standardFolioUploadBo.StdDeleteCommonStaging(ProcessId);
                        }
                    }
                }
            }

            if (blResult)
            {
                // Success Message
                trErrorMessage.Visible = true;
                lblError.Text          = "Reprocess Done Successfully!";
            }
            else
            {
                // Failure Message
                trErrorMessage.Visible = true;
                lblError.Text          = "Reprocess Failure!";
            }

            BindGrid(ProcessId);
        }
        protected void btnReprocess_Click(object sender, EventArgs e)
        {
            bool                    blResult                = false;
            UploadCommonBo          uploadsCommonBo         = new UploadCommonBo();
            UploadProcessLogVo      processlogVo            = new UploadProcessLogVo();
            UploadProcessLogVo      TempprocesslogVo        = new UploadProcessLogVo();
            StandardProfileUploadBo standardProfileUploadBo = new StandardProfileUploadBo();
            StandardFolioUploadBo   standardFolioUploadBo   = new StandardFolioUploadBo();
            CamsUploadsBo           camsUploadsBo           = new CamsUploadsBo();
            string                  strErrorDesc            = "Please a select a processId";
            DropDownList            ddl = (DropDownList)gvCAMSProfileReject.HeaderRow.Cells[0].FindControl("ddlProcessId");
            string                  val = ddl.SelectedValue;

            if (val == "Select")
            {
                Response.Write(@"<script language='javascript'>alert('The following errors have occurred: \n" + strErrorDesc + " .');</script>");
            }
            else
            {
                ProcessId = Convert.ToInt32(val);
                // 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());
                }

                processlogVo = uploadsCommonBo.GetProcessLogInfo(ProcessId);
                if (uploadsCommonBo.ResetRejectedFlagByProcess(ProcessId, 9))
                {
                    //Folio Chks in Std Folio Staging
                    string packagePath = Server.MapPath("\\UploadPackages\\StandardFolioUploadPackageNew\\StandardFolioUploadPackageNew\\UploadsCommonFolioChecksInFolioStaging.dtsx");
                    bool   camsFolioStagingChkResult = standardFolioUploadBo.StdFolioChksInFolioStaging(packagePath, processlogVo.AdviserId, ProcessId, configPath);
                    if (camsFolioStagingChkResult)
                    {
                        //Folio Chks in Std Folio Staging
                        packagePath = Server.MapPath("\\UploadPackages\\StandardFolioUploadPackageNew\\StandardFolioUploadPackageNew\\UploadStdFolioFromFolioStagingToWerpTable.dtsx");
                        bool camsFolioWerpInsertionResult = standardFolioUploadBo.StdCustomerFolioCreation(packagePath, processlogVo.AdviserId, ProcessId, configPath);
                        if (camsFolioWerpInsertionResult)
                        {
                            processlogVo.IsInsertionToWERPComplete = 1;
                            processlogVo.EndTime = DateTime.Now;
                            if (processlogVo.FileTypeId == 2)
                            {
                                processlogVo.IsInsertionToWERPComplete = 1;
                                processlogVo.EndTime               = DateTime.Now;
                                processlogVo.NoOfRejectedRecords   = uploadsCommonBo.GetProfileUploadRejectCount(ProcessId, "CA");
                                processlogVo.NoOfAccountsInserted  = uploadsCommonBo.GetAccountsUploadCount(ProcessId, "WPMF");
                                processlogVo.NoOfInputRejects      = uploadsCommonBo.GetUploadProfileInputRejectCount(ProcessId, "CA");
                                processlogVo.NoOfAccountDuplicates = processlogVo.NoOfTotalRecords - processlogVo.NoOfAccountsInserted - processlogVo.NoOfRejectedRecords;
                            }
                            else if (processlogVo.FileTypeId == 4)
                            {
                                processlogVo.IsInsertionToWERPComplete = 1;
                                processlogVo.EndTime               = DateTime.Now;
                                processlogVo.NoOfRejectedRecords   = uploadsCommonBo.GetProfileUploadRejectCount(ProcessId, "KA");
                                processlogVo.NoOfAccountsInserted  = uploadsCommonBo.GetAccountsUploadCount(ProcessId, "WPMF");
                                processlogVo.NoOfInputRejects      = uploadsCommonBo.GetUploadProfileInputRejectCount(ProcessId, "KA");
                                processlogVo.NoOfAccountDuplicates = processlogVo.NoOfTotalRecords - processlogVo.NoOfAccountsInserted - processlogVo.NoOfRejectedRecords;
                            }
                            else if (processlogVo.FileTypeId == 16)
                            {
                                processlogVo.IsInsertionToWERPComplete = 1;
                                processlogVo.EndTime               = DateTime.Now;
                                processlogVo.NoOfRejectedRecords   = uploadsCommonBo.GetProfileUploadRejectCount(ProcessId, "TN");
                                processlogVo.NoOfAccountsInserted  = uploadsCommonBo.GetAccountsUploadCount(ProcessId, "WPMF");
                                processlogVo.NoOfInputRejects      = uploadsCommonBo.GetUploadProfileInputRejectCount(ProcessId, "TN");
                                processlogVo.NoOfAccountDuplicates = processlogVo.NoOfTotalRecords - processlogVo.NoOfAccountsInserted - processlogVo.NoOfRejectedRecords;
                                blResult = uploadsCommonBo.UpdateUploadProcessLog(processlogVo);
                            }
                            else if (processlogVo.FileTypeId == 18)
                            {
                                processlogVo.IsInsertionToWERPComplete = 1;
                                processlogVo.EndTime               = DateTime.Now;
                                processlogVo.NoOfRejectedRecords   = uploadsCommonBo.GetProfileUploadRejectCount(ProcessId, "DT");
                                processlogVo.NoOfAccountsInserted  = uploadsCommonBo.GetAccountsUploadCount(ProcessId, "WPMF");
                                processlogVo.NoOfInputRejects      = uploadsCommonBo.GetUploadProfileInputRejectCount(ProcessId, "DT");
                                processlogVo.NoOfAccountDuplicates = processlogVo.NoOfTotalRecords - processlogVo.NoOfAccountsInserted - processlogVo.NoOfRejectedRecords;
                                blResult = uploadsCommonBo.UpdateUploadProcessLog(processlogVo);
                            }
                            blResult = uploadsCommonBo.UpdateUploadProcessLog(processlogVo);
                            if (blResult)
                            {
                                bool stdFolioCommonDeleteResult = standardFolioUploadBo.StdDeleteCommonStaging(ProcessId);
                            }
                        }
                    }
                }

                if (blResult)
                {
                    // Success Message
                    trErrorMessage.Visible = true;
                    lblError.Text          = "Reprocess Done Successfully!";
                }
                else
                {
                    // Failure Message
                    trErrorMessage.Visible = true;
                    lblError.Text          = "Reprocess Failure!";
                }

                BindGrid(ProcessId);
            }
        }