public function executeEdit(\Library\HttpRequest $rq)
 {
     // Init result
     $result = $this->InitResponseWS();
     \Applications\PMTool\Helpers\CommonHelper::SetActiveTab($this->user(), \Applications\PMTool\Resources\Enums\AnalyteTabKeys::FieldTab, \Library\Enums\SessionKeys::TabActiveAnalyte);
     $pm = \Applications\PMTool\Helpers\PmHelper::GetCurrentSessionPm($this->user());
     $analyte = \Applications\PMTool\Helpers\CommonHelper::PrepareUserObject($this->dataPost(), new \Applications\PMTool\Models\Dao\Field_analyte());
     $result["data"] = $analyte;
     $manager = $this->managers->getManagerOf($this->module());
     $result_edit = $manager->edit($analyte, "field_analyte_id");
     if ($result_edit) {
         $analyteMatch = \Applications\PMTool\Helpers\CommonHelper::FindIndexInObjectListById($analyte->field_analyte_id(), "field_analyte_id", $pm, \Library\Enums\SessionKeys::PmFieldAnalytes);
         $pm[\Library\Enums\SessionKeys::PmFieldAnalytes][$analyteMatch["key"]] = $analyte;
         \Applications\PMTool\Helpers\PmHelper::SetSessionPm($this->user(), $pm);
     }
     $this->SendResponseWS($result, array("resx_file" => \Applications\PMTool\Resources\Enums\ResxFileNameKeys::FieldAnalyte, "resx_key" => $this->action(), "step" => $result_edit ? "success" : "error"));
 }
 public function executeUpdateItems(\Library\HttpRequest $rq)
 {
     $result = \Applications\PMTool\Helpers\AnalyteHelper::UpdateProjectAnalytes($this);
     \Applications\PMTool\Helpers\CommonHelper::SetActiveTab($this->user(), \Applications\PMTool\Resources\Enums\AnalyteTabKeys::LabTab, \Library\Enums\SessionKeys::TabActiveAnalyte);
     $this->SendResponseWS($result, array("resx_file" => \Applications\PMTool\Resources\Enums\ResxFileNameKeys::LabAnalyte, "resx_key" => $this->action(), "step" => $result["rows_affected"] === count($result["arrayOfValues"]) ? "success" : "error"));
 }