Skip to content

Commit

Permalink
Merge pull request #1388 from Ginger-Automation/BugFix/Official_Relea…
Browse files Browse the repository at this point in the history
…se_Open_Bugs_17October2019

Bug fix/official release open bugs 17 october2019
  • Loading branch information
JinendraGhodke authored Oct 17, 2019
2 parents f65bce5 + df2142c commit 2a8c095
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
23 changes: 14 additions & 9 deletions Ginger/Ginger/Actions/ActionEditPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private void InitView()
{
SetViewMode();
}

if ((EditMode == General.eRIPageViewMode.Automation || EditMode == General.eRIPageViewMode.View) &&
(mAction.Status != null && mAction.Status != Amdocs.Ginger.CoreNET.Execution.eRunStatus.Pending))
{
Expand Down Expand Up @@ -309,8 +309,8 @@ private void InitOutputValuesTabView()

//Output Values
xOutputValuesGrid.btnRefresh.AddHandler(Button.ClickEvent, new RoutedEventHandler(RefreshOutputValuesGridElements));
xOutputValuesGrid.btnAdd.AddHandler(Button.ClickEvent, new RoutedEventHandler(AddReturnValue));
xOutputValuesGrid.AddSeparator();
xOutputValuesGrid.btnAdd.AddHandler(Button.ClickEvent, new RoutedEventHandler(AddReturnValue));
xOutputValuesGrid.AddSeparator();

xOutputValuesGrid.AddToolbarTool(eImageType.Reset, "Clear Un-used Parameters", new RoutedEventHandler(ClearUnusedParameter), imageSize: 14);
BindingHandler.ObjFieldBinding(xOutputValuesGrid.AddCheckBox("Add Parameters Automatically", null), CheckBox.IsCheckedProperty, mAction, nameof(Act.AddNewReturnParams));
Expand All @@ -323,6 +323,11 @@ private void InitOutputValuesTabView()
{
xOutputValuesExpander.IsExpanded = true;
}

if (EditMode == General.eRIPageViewMode.View)
{
xOutputValuesGrid.DisableGridColoumns();
}
}

private void InitExecutionReportTabView()
Expand All @@ -338,7 +343,7 @@ private void InitExecutionReportTabView()

//execution details section
if (EditMode == General.eRIPageViewMode.Automation || EditMode == General.eRIPageViewMode.View)
{
{
BindingHandler.ObjFieldBinding(xExecutionStatusImage, UcItemExecutionStatus.StatusProperty, mAction, nameof(Act.Status));
BindingHandler.ObjFieldBinding(xExecutionStatusLabel, UcItemExecutionStatus.StatusProperty, mAction, nameof(Act.Status));

Expand Down Expand Up @@ -713,7 +718,7 @@ private void GenerateStoreToVarsList()
}

//remove old
for(int indx=0;indx< mStoreToVarsList.Count;indx++)
for (int indx = 0; indx < mStoreToVarsList.Count; indx++)
{
if (tempList.Contains(mStoreToVarsList[indx]) == false)
{
Expand All @@ -733,7 +738,7 @@ private void SetActInputValuesGrid()
//Show/hide if needed
xInputValuesGrid.SetTitleLightStyle = true;
xInputValuesGrid.btnAdd.AddHandler(Button.ClickEvent, new RoutedEventHandler(AddInputValue));//?? going to be hide in next line code

xInputValuesGrid.ClearTools();
xInputValuesGrid.ShowDelete = System.Windows.Visibility.Visible;

Expand Down Expand Up @@ -1046,7 +1051,7 @@ private void SetViewMode()

xAddOutputToDataSourcePnl.IsEnabled = false;
xDataSourceConfigGrid.ToolsTray.Visibility = Visibility.Collapsed;
xDataSourceConfigGrid.DisableGridColoumns();
xDataSourceConfigGrid.DisableGridColoumns();
xOutputValuesGrid.ToolsTray.Visibility = Visibility.Collapsed;
xOutputValuesGrid.DisableGridColoumns();

Expand Down Expand Up @@ -1576,7 +1581,7 @@ private void ActionPropertyChanged(object sender, System.ComponentModel.Property
//}
}



private void InitActionLog()
{
Expand Down Expand Up @@ -1701,7 +1706,7 @@ private void SetScreenshotsPnlView()
{
if (xTakeScreenShotCheckBox.IsChecked == true)
{
xScreenshotsCaptureTypeConfigsPnl.Visibility = Visibility.Visible;
xScreenshotsCaptureTypeConfigsPnl.Visibility = Visibility.Visible;
}
else
{
Expand Down
10 changes: 8 additions & 2 deletions Ginger/GingerCore/DataSource/AccessDataSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public override DataTable GetQueryOutput(string query)

}

public override void RunQuery(string query)
public override bool RunQuery(string query)
{
try
{
Expand All @@ -218,7 +218,10 @@ public override void RunQuery(string query)
catch (Exception ex)
{
Reporter.ToLog(eLogLevel.ERROR, "Failed to Execute Query", ex);
return false;
}

return true;
}

public override void AddTable(string TableName,string columnlist="")
Expand Down Expand Up @@ -274,7 +277,10 @@ public override void RenameTable(string TableName, string NewTableName)
if(!TableName.Equals(NewTableName, StringComparison.OrdinalIgnoreCase))
{
var query = "SELECT * INTO " + NewTableName + " FROM " + TableName;
RunQuery(query);
if (RunQuery(query))
{
DeleteTable(TableName); // AccessDB does not support renaming table using alter query so we copy data to new table and delete old
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion Ginger/GingerCoreCommon/DataBaseLib/DataSourceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public override string GetNameForFileName()
public abstract string UpdateDSReturnValues(string Name, string sColList, string sColVals);
public abstract string GetExtension();
public abstract string AddNewKeyValueTableQuery();
public abstract void RunQuery(string query);
public abstract bool RunQuery(string query);

public abstract int GetRowCount(string TableName);
public abstract void AddTable(string tableName, string columnList = "");
Expand Down
4 changes: 3 additions & 1 deletion Ginger/GingerCoreNET/DataSource/LiteDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -686,12 +686,14 @@ public override void RenameTable(string tableName, string newTableName)
}
}

public override void RunQuery(string query)
public override bool RunQuery(string query)
{
using (LiteDatabase db = new LiteDatabase(FileFullPath))
{
var result = db.Engine.Run(query);
}

return true;
}

public void RunQuery(string query, int LocateRowValue, string DSTableName, bool MarkUpdate = false, bool NextAvai = false)
Expand Down

0 comments on commit 2a8c095

Please sign in to comment.