Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix entity name on "was changed" message for BC Rest services. #791

Merged
merged 1 commit into from
Mar 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public override Task Get(object parameters)
}
else
{
return SetError(((int)HttpStatusCode.NotFound).ToString(), HttpStatusCode.NotFound.ToString());
return SetError(HttpStatusCode.NotFound.ToString(HttpHelper.INT_FORMAT), HttpStatusCode.NotFound.ToString());
}
}
catch (Exception e)
Expand Down Expand Up @@ -166,7 +166,7 @@ public override Task Delete(object parameters)
}
else
{
return SetError(((int)HttpStatusCode.NotFound).ToString(), HttpStatusCode.NotFound.ToString());
return SetError(HttpStatusCode.NotFound.ToString(HttpHelper.INT_FORMAT), HttpStatusCode.NotFound.ToString());
}
}
catch (Exception e)
Expand All @@ -191,12 +191,12 @@ public override Task Put(object parameters)
{
bool gxcheck = IsRestParameter(CHECK_PARAMETER);
GxSilentTrnSdt entity = (GxSilentTrnSdt)Activator.CreateInstance(_worker.GetType(), new Object[] { _gxContext });
var entity_interface = MakeRestType(entity);
object entity_interface = MakeRestType(entity);
entity_interface = ReadRequestBodySDTObj(entity_interface.GetType());
string entityHash = entity_interface.GetType().GetProperty("Hash").GetValue(entity_interface) as string;

ReflectionHelper.CallBCMethod(_worker, LOAD_METHOD, key);
var worker_interface = MakeRestType(_worker);
object worker_interface = MakeRestType(_worker);
string currentHash = worker_interface.GetType().GetProperty("Hash").GetValue(worker_interface) as string;
if (entityHash == currentHash)
{
Expand Down Expand Up @@ -227,12 +227,12 @@ public override Task Put(object parameters)
}
else
{
return SetError(HttpStatusCode.Conflict.ToString(), _worker.trn.context.GetMessage("GXM_waschg", new object[] { this.GetType().Name }));
return SetError(HttpStatusCode.Conflict.ToString(HttpHelper.INT_FORMAT), _worker.trn.context.GetMessage("GXM_waschg", new object[] { _worker.GetName() }));
}
}
else
{
return SetError(((int)HttpStatusCode.NotFound).ToString(), HttpStatusCode.NotFound.ToString());
return SetError(HttpStatusCode.NotFound.ToString(HttpHelper.INT_FORMAT), HttpStatusCode.NotFound.ToString());
}
}
catch (Exception e)
Expand Down