public ActionResult Edit(Tenan tenan)
        {
            try
            {

                    TenanEditedMessage msg = new TenanEditedMessage()
                    {
                        TenanId = tenan.TenanId,
                        TenanName = tenan.TenanName,
                        Alamat = tenan.Alamat,
                        LocationId = tenan.LocationId,
                        Nppkp = tenan.Nppkp,
                        Npwp = tenan.Npwp,
                        TerminalId = tenan.TerminalId,
                        SubTerminalId = tenan.SubTerminalId,
                        TanggalBergabung = tenan.TanggalBergabung,
                        Tarif = tenan.Tarif,
                        CategoryId = tenan.CategoryId,
                        TenanTypeId = tenan.TenanTypeId,
                        ProductTypeId = tenan.ProductTypeId,
                        Gate = tenan.Gate,
                        Target = tenan.Target,
                        CcyCode = tenan.CcyCode,
                        FormulaKonsesi = tenan.FormulaKonsesi.ToLower()

                    };

                    new RabbitHelper().SendTenanEditedMessage(msg);
                    return View("update");

            }
            catch (Exception)
            {

                throw;
            }
        }
        public void UpdateTenant(string[] tenanDataRow)
        {
            int tenanId = Int32.Parse(tenanDataRow[0]);
            string tenanName = tenanDataRow[1];
            string tenanAddress = tenanDataRow[2];
            string npwp = tenanDataRow[3];
            decimal tarif = Decimal.Parse(tenanDataRow[4].Replace("%", ""));
            string tenanType = tenanDataRow[5];
            string productType = tenanDataRow[6];
            string ccy = tenanDataRow[7];
            string gate = tenanDataRow[8];
            int tenanTypeId = 0;
            int productTypeId = 0;
            string ccyCode = "IDR";

            tenanAddress = tenanAddress.Replace(',', ' ');
            tenanAddress = tenanAddress.Replace("\r\n", "-");
            Tenan tenan = MasterDataRepository().FindTenanById(tenanId);
            TenanType _tenanType = MasterDataRepository().FindTenanTypeByName(tenanType.ToLower());
            ProductType _productType = MasterDataRepository().FindProductTypeByName(productType.ToLower());
            FindCcyCode _ccy = MasterDataRepository().FindCcyCodeByName(ccy.ToLower());
            if (_tenanType != null)
                tenanTypeId = _tenanType.TenanTypeId;
            if (_productType != null)
                productTypeId = _productType.ProductTypeId;
            if (_ccy != null)
                ccyCode = _ccy.CcyCode;
            TenanEditedMessage editTenanMessage = new TenanEditedMessage
            {
                TenanId = tenanId,
                TenanName = tenanName,
                Alamat = tenanAddress,
                Npwp = npwp,
                Tarif = tarif,

                CategoryId = tenan.CategoryId,
                LocationId = tenan.LocationId,
                TerminalId = tenan.TerminalId,
                SubTerminalId = tenan.SubTerminalId,
                Gate = gate,

                ProductTypeId = productTypeId,
                TanggalBergabung = tenan.TanggalBergabung,
                TenanTypeId = tenanTypeId,
                Nppkp = tenan.Nppkp,
                CcyCode = ccyCode
            };
            rabbitHelper.SendTenanEditedMessage(editTenanMessage);
        }