Ejemplo n.º 1
0
        protected void btnReprocess_Click(object sender, EventArgs e)
        {
            //System.Threading.Thread.Sleep(5000);
            bool blResult = false;

            uploadsCommonBo = new UploadCommonBo();
            UploadProcessLogVo processlogVo    = new UploadProcessLogVo();
            string             error           = "";
            int          processIdReprocessAll = 0;
            string       strErrorDesc          = "Please a select a processId";
            DropDownList ddl = (DropDownList)gvSIPReject.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);

                if (Request.QueryString["processId"] != null)
                {
                    processId    = Int32.Parse(Request.QueryString["processId"].ToString());
                    processlogVo = uploadsCommonBo.GetProcessLogInfo(processId);

                    blResult = MFWERPSIPTransactionInsertion(processId);
                }

                else
                {
                    DataSet ds = uploadsCommonBo.GetSuperAdminSIPUploadRejectDistinctDetailsForProcessId(processId);
                    //DataSet ds = uploadsCommonBo.GetSuperAdminSIPUploadRejectDistinctProcessIdForAdviser();
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        //processIdReprocessAll = int.Parse(dr["WUPL_ProcessId"].ToString());
                        processIdReprocessAll = processId;
                        processlogVo          = uploadsCommonBo.GetProcessLogInfo(processIdReprocessAll);

                        blResult = MFWERPSIPTransactionInsertion(processIdReprocessAll);

                        if (blResult == false)
                        {
                            error = error + "Error when reprocessing for the processid:" + processIdReprocessAll + ";";
                        }
                    }
                }

                if (error == "")
                {
                    // Success Message
                    //trErrorMessage.Visible = true;
                    //lblError.Text = "Reprocess Done Successfully!";
                    msgReprocessComplete.Visible = true;
                }
                else
                {
                    // Failure Message
                    trErrorMessage.Visible         = true;
                    msgReprocessincomplete.Visible = true;
                    lblError.Text = "ErrorStatus:" + error;
                }

                BindRejectedSIPGrid(processId);
            }
        }