public ActionResult AddInvoiceType([DataSourceRequest] DataSourceRequest request, ConfigInvoiceTypeModel model)
        {
            try
            {
                if (model != null)
                {
                    var service = new ConfigInvoiceTypeSevice();

                    var invoice = DataTransfer.Transfer<Config_Invoice_Type>(
                        model,
                        typeof(ConfigInvoiceTypeModel));

                    model.ID = service.Add(invoice);
                }

                return Json(new[] { model }.ToDataSourceResult(request, ModelState));
            }
            catch
            {
                return View();
            }
        }
        public ActionResult ModifyInvoiceType([DataSourceRequest] DataSourceRequest request, ConfigInvoiceTypeModel model)
        {
            if (model != null && ModelState.IsValid)
            {
                var service = new ConfigInvoiceTypeSevice();

                var cost = DataTransfer.Transfer<Config_Invoice_Type>(
                    model,
                    typeof(ConfigInvoiceTypeModel));

                service.Modify(cost);
            }

            return Json(new[] { model }.ToDataSourceResult(request, ModelState));
        }
        public ActionResult RemoveInvoiceType(int id, FormCollection collection)
        {
            try
            {
                var service = new ConfigInvoiceTypeSevice();

                service.Remove(id);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        public ActionResult QueryInvoiceType()
        {
            var service = new ConfigInvoiceTypeSevice();

            var list = service.QueryAll();
            if (list != null)
            {
                var modelList = new List<ConfigInvoiceTypeModel>();

                foreach (var config in list)
                {
                    modelList.Add(
                        DataTransfer.Transfer<ConfigInvoiceTypeModel>(
                            config,
                            typeof(Config_Invoice_Type)));
                }

                return Json(modelList);
            }

            return null;
        }