public static ClientResponseObject getCemetryGround(Cemetry c)
        {
            if (c != null)
            {
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(SERVER_LINK + "/cemetry/" + c.cemetryId + "/cemetryground");
                request.Method = "GET";
                request.ContentType = "application/json";
                request.CookieContainer = new CookieContainer();
                request.CookieContainer.Add(new Uri(SERVER_LINK + "/cemetry"),
                new Cookie("JSESSIONID", JSESSIONID));
                request.CookieContainer.Add(new Uri(SERVER_LINK + "/cemetry"),
                new Cookie("CIMITERO_AUTH_TOKEN", CIMITERO_AUTH_TOKEN));

                try
                {
                    using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
                    {
                        Console.WriteLine(response.Headers.Keys);
                        StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
                        string json = reader.ReadToEnd();
                        JObject jObject = JObject.Parse(json);

                        if (Boolean.Parse(jObject["ok"].ToString()))
                        {
                            JToken jArray = jObject["items"];
                            JToken jCemetryGrounds = jArray["items"];
                            List<CemetryGround> cemetryGrounds = JsonConvert.DeserializeObject<List<CemetryGround>>(jCemetryGrounds.ToString());
                            return new ClientResponseObject(Boolean.Parse(jObject["ok"].ToString()), "", cemetryGrounds);
                        }
                        else
                        {
                            return new ClientResponseObject(Boolean.Parse(jObject["ok"].ToString()), extractErrorsFromResponse(jObject));
                        }
                    }
                }
                catch (WebException ex)
                {
                    return new ClientResponseObject(false, ex.Message);
                }
            }
            else
            {
                return new ClientResponseObject(false, "Kein Friedhof ausgewählt!");
            }
        }
 public static void setSelectedCemetry(Cemetry c)
 {
     cemetry = c;
 }
        public static ClientResponseObject addCemetry(Cemetry c)
        {
            if (c != null)
            {
                try
                {
                    var httpWebRequest = (HttpWebRequest)WebRequest.Create(SERVER_LINK + "/cemetry");
                    httpWebRequest.ContentType = "application/json";
                    httpWebRequest.Method = "POST";
                    httpWebRequest.ContentType = "application/json";
                    httpWebRequest.CookieContainer = new CookieContainer();
                    httpWebRequest.CookieContainer.Add(new Uri(SERVER_LINK + "/cemetry"),
                    new Cookie("JSESSIONID", JSESSIONID));
                    httpWebRequest.CookieContainer.Add(new Uri(SERVER_LINK + "/cemetry"),
                    new Cookie("CIMITERO_AUTH_TOKEN", CIMITERO_AUTH_TOKEN));

                    using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
                    {

                        streamWriter.Write(JsonConvert.SerializeObject(c));
                        streamWriter.Flush();
                        streamWriter.Close();
                    }

                    var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
                    using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
                    {
                        var json = streamReader.ReadToEnd();
                        JObject jObject = JObject.Parse(json);

                        if (Boolean.Parse(jObject["ok"].ToString()))
                        {
                            return new ClientResponseObject(Boolean.Parse(jObject["ok"].ToString()), "");
                        }
                        else
                        {
                            return new ClientResponseObject(Boolean.Parse(jObject["ok"].ToString()), extractErrorsFromResponse(jObject));
                        }

                    }
                }
                catch (Exception ex)
                {
                    return new ClientResponseObject(false, ex.Message);
                }
            }
            else
            {
                return new ClientResponseObject(false, "Kein Friedhof!");
            }

        }
        private void datagrid_Cemetries_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if(datagrid_Cemetries.SelectedItem != null)
            {
                tmpCemetry = ((Cemetry) datagrid_Cemetries.SelectedItem);
                tbox_cemetry_name.Text = tmpCemetry.name;
                tbox_cemetry_address.Text = tmpCemetry.address;
                tbox_longitude.Text = tmpCemetry.longitude.ToString();
                tbox_latitude.Text = tmpCemetry.latitute.ToString();
                tbox_cemetry_id.Text = tmpCemetry.cemetryId.ToString();
                lbl_newCemetry.Content = "Friedhof '" + tmpCemetry.name + "'";

                this.showPartial(this.newCemetry);
            }
        }