-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUpdatedTransaction.aspx.cs
52 lines (49 loc) · 2.09 KB
/
UpdatedTransaction.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
if (line.Contains("lr_start_transaction"))
{
int startIndex = line.IndexOf("lr_start_transaction") + 21;
int endIndex = line.IndexOf("\"", startIndex + 1);
string transactionName = line.Substring(startIndex + 1, endIndex - startIndex - 1);
// Check if the transaction name has the required format
string[] parts = transactionName.Split('_');
if (parts.Length >= 4)
{
// Capture the TransactionName part
transactionName = txtAppCICode.Text + "_" + txtScriptName.Text + "_"
+ txtFuncName.Text + "_" + string.Format("{0:D2}", transactionNum) + "_"
+ parts[parts.Length - 1];
}
else
{
// Update the transaction name with the new format
transactionName = txtAppCICode.Text + "_" + txtScriptName.Text + "_"
+ txtFuncName.Text + "_" + string.Format("{0:D2}", transactionNum) + "_"
+ transactionName;
}
line = line.Substring(0, startIndex + 1) + transactionName + line.Substring(endIndex);
// Increment the transaction number
transactionNum++;
}
if (line.Contains("lr_end_transaction"))
{
int startIndex = line.IndexOf("lr_end_transaction") + 19;
int endIndex = line.IndexOf("\"", startIndex + 1);
string transactionName = line.Substring(startIndex + 1, endIndex - startIndex - 1);
// Check if the transaction name has the required format
string[] parts = transactionName.Split('_');
if (parts.Length >= 5)
{
// Capture the TransactionName part
transactionName = txtAppCICode.Text + "_" + txtScriptName.Text + "_"
+ txtFuncName.Text + "_" + string.Format("{0:D2}", transactionNum) + "_"
+ parts[parts.Length - 1];
}
else
{
// Update the transaction name
transactionName = txtAppCICode.Text + "_" + txtScriptName.Text + "_"
+ txtFuncName.Text + "_" + string.Format("{0:D2}", transactionNum - 1) + "_"
+ transactionName;
}
line = line.Substring(0, startIndex + 1) + transactionName + line.Substring(endIndex);
}
updatedFile += line + "\n";