private List <WCFTemplate> GetImportTemplatesError(string errorMessage) { const string errorGuid = "GetImportTemplatesError_0F649AC6-0D07-49EA-906C-413256B8A43E"; WCFTemplate template = new WCFTemplate(); template.Id = errorGuid; template.Name = errorMessage; List <WCFTemplate> list = new List <WCFTemplate> { template }; return(list); }
public void UpdateTemplateIds(WCFTemplate template) { if (string.IsNullOrEmpty(template.Id)) { Guid guid = System.Guid.NewGuid(); template.Id = guid.ToString(); } foreach (TemplateFrame frame in template.Frames) { if (string.IsNullOrEmpty(frame.Id)) { frame.Id = Guid.NewGuid().ToString(); } } }
public void AddTemplate(string authenticationCookie, WCFTemplate template, string userData) { try { string userName; userName = ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanAddTemplates); _addin.AddTemplate(userName, template, userData); } catch (ServiceAuthorizationException) { throw new ServiceAuthorizationException("Access denied, please login with different user to have this feature available."); } catch (Exception e) { throw new WebException(e.Message, e.InnerException); } }
public void UpdateTemplate(string authenticationCookie, WCFTemplate template, string userData) { try { string userName; userName = ServiceUtils.Authorize(authenticationCookie, PermissionsTable.Instance.CanEditTemplates); _addin.UpdateTemplate(userName, template, userData); } catch (ServiceAuthorizationException) { throw new ServiceAuthorizationException("Access denied, please login with different user to have this feature available."); } catch (Exception e) { throw new ServiceException(e.Message, HttpStatusCode.InternalServerError); } }