Beispiel #1
0
 public void Update()
 {
     try
     {
         var form    = _app.FindSingle("048b8074-1a68-4dc4-af15-dbc0914f5745");
         var newform = form.MapTo <Form>();
         _app.Update(newform);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
 }
        public Response <FormResp> Get(string id)
        {
            var result = new Response <FormResp> ();

            try {
                result.Result = _app.FindSingle(id);
            } catch (Exception ex) {
                result.Code    = 500;
                result.Message = ex.InnerException?.Message ?? ex.Message;
            }

            return(result);
        }
Beispiel #3
0
 public string Get(string id)
 {
     try
     {
         var result = new Response <FormResp>
         {
             Result = _app.FindSingle(id)
         };
         return(JsonHelper.Instance.Serialize(result));
     }
     catch (Exception ex)
     {
         Result.Code    = 500;
         Result.Message = ex.InnerException?.Message ?? ex.Message;
         return(JsonHelper.Instance.Serialize(Result));
     }
 }
Beispiel #4
0
        public Response <FormResp> Get(string id, string canWriteFormItemIds)
        {
            var result = new Response <FormResp>();

            try
            {
                result.Result = _app.FindSingle(id);

                if (!string.IsNullOrEmpty(canWriteFormItemIds))
                {
                    result.Result.CanWriteFormItemIds = JsonHelper.Instance.Deserialize <string[]>(canWriteFormItemIds);
                }
            }
            catch (Exception ex)
            {
                result.Code    = 500;
                result.Message = ex.InnerException?.Message ?? ex.Message;
            }

            return(result);
        }