protected bool SendRequestSave(BaseRoot value, List <MappingFields> mapping, Func <string, object, bool> getReponse) { string content = LoadXml(GetEntityName(), mapping); if (string.IsNullOrEmpty(value.GetId())) { return(SendRequestInsert(value.Authentication, content, value, getReponse)); } return(SendRequestUpdate(value.Authentication, content, value, getReponse)); }
private bool SendRequestUpdate(Authentication value, string content, BaseRoot baseRoot, Func <string, object, bool> getResponse) { string url = value.UrlService; string urlFormat = string.Format("{0}xml/{1}/{2}?authtoken={3}&scope={4}&newFormat=1&id={5}&xmlData={6}", url, GetEntityName(), "updateRecords", value.Token, value.User, baseRoot.GetId(), content); return(HttpMessageSender.SendRequestPost(urlFormat, content, baseRoot, getResponse)); }