private void ProcessApprovals(string str)
    {
        try
        {
            int      suc    = 0;
            int      failed = 0;
            int      count  = 0;
            string[] arr    = str.Split(',');
            int      i      = 0;
            string   User   = Session["UserName"].ToString();
            for (i = 0; i < arr.Length; i++)
            {
                int RecordId = int.Parse(arr[i].ToString());

                string ss = datafile.ApproveAccountCredit(RecordId);
                if (ss.Equals("SUCCESS"))
                {
                    count++;
                    //update approved credits
                    datafile.UpdateApprovedCredit(RecordId, User);

                    //Insert into

                    CustomerReceiptCreditDetails cust = datafile.GetCustomerReceiptDetails(RecordId);
                    DateTime todaydate    = DateTime.Now;
                    string   datetoday    = todaydate.ToString().Replace("/", "-").Replace(":", "-").Replace(" ", "-");
                    string   vendorTranld = "CREDIT" + datetoday;

                    int insertedstatuscount = 0;

                    insertedstatuscount = datafile.InsertIntoReceivedPrepaidTxns(cust.CustomerCode, cust.CustomerAccount, cust.CustomerCreditAmount, vendorTranld);
                    if (insertedstatuscount > 0)
                    {
                        //UpdateCustomerAccount
                        int updatestatuscount = 0;
                        updatestatuscount = datafile.UpdatePrepaidCustomerAccountBalance(cust.CustomerCode, cust.CustomerCreditAmount, cust.CustomerAccount);
                        if (updatestatuscount > 0)
                        {
                        }
                    }
                }
                else
                {
                    failed++;
                }
            }
            string msg = suc + " Credits Have Been Approved and " + failed + "Failed";
            //datafile.LogActivity(Session["UserName"].ToString(), "Approved Account Credits Details");
            ShowMessage(msg, false);
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }