@@ -44,20 +44,20 @@ public IActionResult LoadReport([FromBody] ReportDB reportDB)
4444
4545 public class SaveReportDB
4646 {
47- public String ReportName { get ; set ; }
48- public String Report { get ; set ; }
47+ public string ReportName { get ; set ; }
48+ public string Report { get ; set ; }
4949 }
5050
5151 public class ReportDB
5252 {
53- public String ReportName { get ; set ; }
53+ public string ReportName { get ; set ; }
5454 }
5555
5656 public class RenameReportDB
5757 {
58- public String ReportName { get ; set ; }
59- public String RenameReport { get ; set ; }
60- public Boolean isReportExists { get ; set ; }
58+ public string ReportName { get ; set ; }
59+ public string RenameReport { get ; set ; }
60+ public bool isReportExists { get ; set ; }
6161 }
6262
6363 public class ErrorViewModel
@@ -105,17 +105,16 @@ public void RemoveReportFromDB(string reportName)
105105 sqlConn . Close ( ) ;
106106 }
107107
108- public void RenameReportInDB ( string reportName , string renameReport , Boolean isReportExists )
108+ public void RenameReportInDB ( string reportName , string renameReport , bool isReportExists )
109109 {
110110 SqlConnection sqlConn = OpenConnection ( ) ;
111111 SqlCommand cmd1 = null ;
112+ if ( isReportExists )
113+ {
114+ RemoveReportFromDB ( renameReport ) ;
115+ }
112116 foreach ( DataRow row in GetDataTable ( sqlConn ) . Rows )
113117 {
114- if ( isReportExists )
115- {
116- RemoveReportFromDB ( renameReport ) ;
117- isReportExists = false ;
118- }
119118 if ( ( row [ "ReportName" ] as string ) . Equals ( reportName ) )
120119 {
121120 cmd1 = new SqlCommand ( "UPDATE ReportTable set ReportName=@RenameReport where ReportName like '%" + reportName + "%'" , sqlConn ) ;
0 commit comments