public async Task<ActionResult> Create(PaymentType paymentType)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    string url = base.GetApiServiceURL("PaymentTypes");

                    var httpClient = new HttpClient();
                    httpClient.DefaultRequestHeaders.Add("User-Agent", "Other");
                    var response = await httpClient.PostAsJsonAsync(url, paymentType);

                    if (response.IsSuccessStatusCode)
                    {
                        ShowMessage("PaymentType '" + paymentType.Name + "' added.", EnumMessageType.INFO);
                    }
                    else
                    {
                        ShowMessage("Error contacting server.", EnumMessageType.ERROR);
                    }

                    return RedirectToAction("Index");
                }
                else
                {
                    return View();
                }
            }
            catch
            {
                ShowMessage("Error creating new paymentType.", EnumMessageType.ERROR);
                return View();
            }
        }
        // POST api/Categories
        public async Task PostAsync(PaymentType paymentTypePosted)
        {
            MongoHelper<PaymentType> paymentTypeHelper = new MongoHelper<PaymentType>();

            try
            {
                await paymentTypeHelper.Collection.InsertOneAsync(paymentTypePosted);
            }
            catch (Exception e)
            {
                Trace.TraceError("PaymentTypes PostAsync error : " + e.Message);
                throw;
            }

        }
        // PUT api/Categories/5
        public async Task PutAsync(string id, PaymentType paymentTypePut)
        {
            try
            {
                var filter = Builders<PaymentType>.Filter.Eq(p => p.Id, ObjectId.Parse(id));
                var update = Builders<PaymentType>.Update.Set("Name", paymentTypePut.Name);

                MongoHelper<PaymentType> paymentTypeHelper = new MongoHelper<PaymentType>();
                await paymentTypeHelper.Collection.UpdateOneAsync(filter, update);
            }
            catch (Exception e)
            {
                Trace.TraceError("PaymentTypes PutAsync error : " + e.Message);
                throw;
            }
        }
        public async Task<ActionResult> Edit(string id, PaymentType paymentTypePut)
        {
            try
            {
                string url = base.GetApiServiceURL("PaymentTypes");
                                    
                paymentTypePut.Id = ObjectId.Parse(id);

                var httpClient = new HttpClient();
                httpClient.DefaultRequestHeaders.Add("User-Agent", "Other");
                var response = await httpClient.PutAsJsonAsync(url + "/" + id, paymentTypePut);

                if (response.IsSuccessStatusCode)
                {
                    ShowMessage("PaymentType '" + paymentTypePut.Name + "' updated.", EnumMessageType.INFO);
                }
                else
                {
                    ShowMessage("Error contacting server.", EnumMessageType.ERROR);
                }

                return RedirectToAction("Index");
            }
            catch
            {
                ShowMessage("Error updating paymentType.", EnumMessageType.ERROR);
                return View();
            }
        }