public async Task <RO <string> > CustomerChangeProperties([FromBody] ClientChangePropertiesData clientdata) { var ro = new RO <string>(); if (ModelState.IsValid) { #if SESAM VendorInterface vendor = new VendorInterface(); ro = await vendor.CustomerChangeProperties(clientdata); #else var result = await VendorDL.CustomerChangeProperties(clientdata); if (result != null) { ro.ReturnCode = 0; ro.ReturnValue = result; } else { ro.ReturnCode = 100; } #endif } else { var message = string.Join(" | ", ModelState.Values.SelectMany(v => v.Errors).Select(e => e.ErrorMessage)); ro.ReturnCode = 100; ro.Message = $"Bad request - CustomerChangeProperties - Incorrect parameters: {message}"; } return(ro); }
/// <summary> /// /// </summary> /// <param name="clientdata"></param> /// <returns></returns> public async Task <BossIDWS.Vendor.REST.ReturnObjects.RO <string> > CustomerChangeProperties(ClientChangePropertiesData clientdata) { BossIDWS.Vendor.REST.ReturnObjects.RO <string> roc = new ReturnObjects.RO <string>(); try { VendorEngine engine = new VendorEngine(); VendorRO vendorro = engine.CustomerChangeProperties(clientdata.InstallationID, clientdata.Customerkey, clientdata.Customername, clientdata.Streetaddress, clientdata.Description); roc.ReturnCode = vendorro.ReturnCode; roc.ReturnValue = vendorro.ReturnValue; roc.Message = vendorro.Message; } catch (Exception e) { roc.ReturnCode = 1024; roc.Message = "CustomerChangeProperties failure - " + e.ToString(); } return(await Task.FromResult(roc)); }