예제 #1
0
        protected void Rg_BankWebSite_InsertCommand(object sender, GridCommandEventArgs e)
        {
            var editedItem     = (GridEditableItem)e.Item;
            var bankAccountsId = new Guid(((DropDownList)editedItem.FindControl("DDL_Bank")).SelectedValue);

            TargetId = new Guid(RTVWebSite.SelectedValue);
            var bwInfo = new BankAccountInfo
            {
                BankAccountsId = bankAccountsId,
                TargetId       = TargetId
            };

            try
            {
                _bankAccountsWrite.InsertBindBankAccounts(TargetId, bankAccountsId);
            }
            catch
            {
                RAM.Alert("插入该资金账户失败!");
            }
            if (CacheCollection.SalePlatform.Get(bwInfo.TargetId) != null || CacheCollection.Filiale.IsB2CFiliale(bwInfo.TargetId))
            {
                try
                {
                    B2CSao.AddBankAccountBinding(bwInfo.TargetId, bwInfo.BankAccountsId);
                }
                catch (Exception exp)
                {
                    RAM.Alert("同步失败,错误信息:" + exp.Message);
                }
            }
        }
        protected override void SetParametrosPagoComercioExteriorAction()
        {
            if (_loan == null)
            {
                return;
            }

            BankAccountInfo cuenta = BankAccountInfo.Get(_loan.OidCuenta, false);

            if (cuenta.ETipoCuenta != ETipoCuenta.CuentaCorriente)
            {
                _entity.OidCuentaBancaria = cuenta.OidCuentaAsociada;
                _entity.CuentaBancaria    = cuenta.CuentaAsociada;
            }
            else
            {
                _entity.OidCuentaBancaria = cuenta.Oid;
                _entity.CuentaBancaria    = cuenta.Valor;
            }

            _entity.EMedioPago  = EMedioPago.Transferencia;
            _entity.EEstadoPago = moleQule.Base.EEstado.Pagado;

            base.SetParametrosPagoComercioExteriorAction();
            Cuenta_TB.Text = cuenta.Valor;
        }
예제 #3
0
        protected override void SetBankAccountAction()
        {
            if (!ControlsMng.IsCurrentItemValid(Lines_DGW))
            {
                return;
            }

            CashLine item = ControlsMng.GetCurrentItem(Lines_DGW) as CashLine;

            if (item.Locked)
            {
                return;
            }

            if (!new ETipoLineaCaja[]
            {
                ETipoLineaCaja.EntradaPorTraspaso,
                ETipoLineaCaja.SalidaPorIngreso
            }.Contains(item.ETipoLinea))
            {
                return;
            }

            BankAccountSelectForm form = new BankAccountSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo cuenta = form.Selected as BankAccountInfo;

                item.OidCuentaBancaria = cuenta.Oid;
                item.CuentaBancaria    = cuenta.Valor;
            }
        }
예제 #4
0
 /// <summary>
 /// 根据来源ID,站点类型来获取
 /// </summary>
 /// <returns></returns>
 public BankAccountInfo Get(BankAccountInfo sinfo)
 {
     using (SqlConnection conn = Databases.GetSqlConnection(GlobalConfig.ERP_DB_NAME, false))
     {
         return(conn.QueryFirstOrDefault <BankAccountInfo>(SQL_SELECT_BY_BANKACCOUNTSID_FROMSOUCEID_FROMTYPE, new { BankAccountsId = sinfo.BankAccountsId, TargetId = sinfo.TargetId }));
     }
 }
예제 #5
0
        public void TestUpdateBankAccount()
        {
            var bankAccountInfo = new BankAccountInfo();

            bankAccountInfo.Id                = "bnk_test_4y355piolnoh4e6cohd";
            bankAccountInfo.BankId            = "tmb";
            bankAccountInfo.BankAccountName   = "John Doe";
            bankAccountInfo.BankAccountNumber = "111111111111";

            string json = @"{
                            'object': 'recipient_bank_account',
                            'id': 'bnk_test_4y355piolnoh4e6cohd',
                            'location': '/recipients/recp_test_4y355pimyomptde4cvo/bank_accounts/bnk_test_4y355piolnoh4e6cohd',
                            'bank_id': 'tmb',
                            'bank_account_no': '111111111111',
                            'bank_account_name': 'John Doe',
                            'created': '2014-11-17T05:55:32Z'
                            }";

            stubResponse(json);
            var result = client.RecipientService.UpdateBankAccount("recp_test_4y355pimyomptde4cvo", bankAccountInfo);

            Assert.AreEqual("tmb", result.BankId);
            Assert.AreEqual("John Doe", result.BankAccountName);
            Assert.AreEqual("111111111111", result.BankAccountNumber);
        }
예제 #6
0
 public void Update(Guid oldBankAccountsId, BankAccountInfo info)
 {
     using (SqlConnection conn = Databases.GetSqlConnection(GlobalConfig.ERP_DB_NAME, false))
     {
         conn.Execute(SQL_UPDATE, new { BankAccountsId = info.BankAccountsId, TargetId = info.TargetId, OldBankAccountsId = oldBankAccountsId });
     }
 }
예제 #7
0
 /// <summary>
 /// 插入一条记录
 /// </summary>
 public void Insert(BankAccountInfo info)
 {
     using (SqlConnection conn = Databases.GetSqlConnection(GlobalConfig.ERP_DB_NAME, false))
     {
         conn.Execute(SQL_INSERT, new { BankAccountsId = info.BankAccountsId, TargetId = info.TargetId });
     }
 }
예제 #8
0
        public async Task <IActionResult> Edit(int id, [Bind("BankAccountInfoId,AccountHolder,AccountNumber,BankId,BranchName,IFSCCode,AccountType,IsClientAccount")] BankAccountInfo bankAccountInfo)
        {
            if (id != bankAccountInfo.BankAccountInfoId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bankAccountInfo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BankAccountInfoExists(bankAccountInfo.BankAccountInfoId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BankId"] = new SelectList(_context.Banks, "BankId", "BankName", bankAccountInfo.BankId);
            return(View(bankAccountInfo));
        }
예제 #9
0
 public void Load(Guid clientId, Guid practiceId, Guid bankAccountId)
 {
     PracticeId = practiceId;
     ClientId = clientId;
     ICashFlowManagerService service = new CashFlowManagerService();
     SelectedBankAccount  = service.GetBankAccount(bankAccountId);
 }
예제 #10
0
        public static BankLineList GetByCuentaList(BankAccountInfo cuenta, bool childs)
        {
            QueryConditions conditions = new QueryConditions
            {
                CuentaBancaria = cuenta
            };

            return(GetList(conditions, childs));
        }
        public async Task CreateAsync(BankAccountInfo item)
        {
            item = item ?? throw new ArgumentNullException(nameof(item));

            using (var context = CreateContext())
            {
                context.BankAccounts.Add(item);
                await context.SaveChangesAsync();
            }
        }
예제 #12
0
        private void Cuenta_BT_Click(object sender, EventArgs e)
        {
            BankAccountSelectForm form = new BankAccountSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                _cuenta        = form.Selected as BankAccountInfo;
                Cuenta_TB.Text = _cuenta.Valor;
            }
        }
예제 #13
0
        /// <summary>更新银行账户信息
        /// </summary>
        /// <param name="info"></param>
        public static void UpdateBankAccount(BankAccountInfo info)
        {
            var pushDataId = Guid.NewGuid();

            //var filialeId = GetFilialeIdBySalePlatform(info.TargetId);
            using (var client = ClientProxy.CreateB2CWcfClient(info.TargetId))
            {
                client.Instance.BankAccountsUpdate(pushDataId, ConvertToB2CModel(info));
            }
        }
예제 #14
0
        protected override void GetFormSourceData(object [] parameters)
        {
            _entity = BankLine.New();

            if (parameters[0] != null)
            {
                BankAccountInfo cuenta = parameters[0] as BankAccountInfo;
                SetCuentaBancaria(cuenta);
            }
            _entity.BeginEdit();
        }
예제 #15
0
        private void Cuenta_BT_Click(object sender, EventArgs e)
        {
            BankAccountSelectForm form = new BankAccountSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo cuenta = form.Selected as BankAccountInfo;

                _entity.CuentaBancaria = cuenta.Valor;
            }
        }
예제 #16
0
        public void Validator_Validate_NotValid_IbanNumber()
        {
            var c = new BankAccountInfo()
            {
                IbanNumber = "IR930150000001351800087200"
            };

            var results = _validator.Validate(c);

            Assert.IsFalse(results.IsValid);
        }
예제 #17
0
        public void Validator_Validate_NotValid_ShetabCardNumber()
        {
            var c = new BankAccountInfo()
            {
                ShetabCardNumber = "6037991199500591"
            };

            var results = _validator.Validate(c);

            Assert.IsFalse(results.IsValid);
        }
        protected override void EditAccountAction()
        {
            BankAccountSelectForm form = new BankAccountSelectForm(this, BankAccountList.GetList(ETipoCuenta.CuentaCorriente, EEstado.Active, false));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo cuenta = form.Selected as BankAccountInfo;
                Cuenta_TB.Text         = cuenta.Valor;
                _entity.CuentaBancaria = cuenta.Valor;
            }
        }
        protected virtual void SelectCuentaAction()
        {
            ETipoCuenta           tipo = _entity.ETipoMovimientoBanco == EBankLineType.Manual ? ETipoCuenta.CuentaCorriente : ETipoCuenta.FondoInversion;
            BankAccountSelectForm form = new BankAccountSelectForm(this, BankAccountList.GetList(tipo, EEstado.Active, false));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo cuenta = form.Selected as BankAccountInfo;
                SetCuentaBancaria(cuenta);
            }
        }
예제 #20
0
 private static Account ParseBankAccount(BankAccountInfo bank)
 {
     return(new Account()
     {
         Type = AccountTypeEnum.Checking,
         Id = bank.BANKACCTFROM.ACCTID,
         BankId = bank.BANKACCTFROM.BANKID,
         SubType = bank.BANKACCTFROM.ACCTTYPE.ToString(),
         Status = bank.SVCSTATUS.ToString(),
     });
 }
        protected void SetCuentaBancaria(BankAccountInfo source)
        {
            if (source == null)
            {
                return;
            }

            _entity.OidCuentaMov = source.Oid;
            _entity.OidCuenta    = source.Oid;
            _entity.Cuenta       = source.Valor;
            _entity.Entidad      = source.Entidad;
        }
        protected virtual void SelectCuentaAction()
        {
            BankAccountSelectForm form = new BankAccountSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo cuenta = form.Selected as BankAccountInfo;

                Cuenta_TB.Text         = cuenta.Valor;
                _entity.CuentaBancaria = cuenta.Valor;
            }
        }
        private void CuentaAsociada_BT_Click(object sender, EventArgs e)
        {
            BankAccountSelectForm form = new BankAccountSelectForm(this, BankAccountList.GetList(ETipoCuenta.CuentaCorriente, moleQule.Base.EEstado.Active, false));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo item = form.Selected as BankAccountInfo;

                _entity.OidCuentaBAsociada = item.Oid;
                _entity.CuentaAsociada     = item.Valor;
            }
        }
        private void CuentaAjena_BT_Click(object sender, EventArgs e)
        {
            BankAccountSelectForm form = new BankAccountSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo item = form.Selected as BankAccountInfo;

                _entity.OidCuentaBAsociada = item.Oid;
                _entity.CuentaAsociada     = item.Valor;
            }
        }
예제 #25
0
        public async Task <IActionResult> Create([Bind("BankAccountInfoId,AccountHolder,AccountNumber,BankId,BranchName,IFSCCode,AccountType,IsClientAccount")] BankAccountInfo bankAccountInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bankAccountInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BankId"] = new SelectList(_context.Banks, "BankId", "BankName", bankAccountInfo.BankId);
            return(View(bankAccountInfo));
        }
        //protected override void SetImpuestoAction()
        //{
        //    ImpuestoSelectForm form = new ImpuestoSelectForm(this);
        //    if (form.ShowDialog(this) == DialogResult.OK)
        //    {
        //        ImpuestoInfo item = form.Selected as ImpuestoInfo;
        //        Entity.SetImpuesto(item);
        //        Impuesto_TB.Text = Entity.Impuesto;
        //    }
        //}

        //protected override void SetImpuestoDefectoAction()
        //{
        //    Entity.SetImpuesto(null);
        //    Impuesto_TB.Text = Entity.Impuesto;
        //}

        protected override void SetCuentaAsociadaAction()
        {
            BankAccountSelectForm form = new BankAccountSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo item = form.Selected as BankAccountInfo;

                _entity.OidCuentaBAsociada = item.Oid;
                _entity.CuentaAsociada     = item.Valor;
            }
        }
        protected virtual void SetCuentaDestinoAction()
        {
            BankAccountSelectForm form = new BankAccountSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo cuenta = form.Selected as BankAccountInfo;

                _entity.OidCuentaDestino = cuenta.Oid;
                _entity.CuentaDestino    = cuenta.Valor;
                CuentaDestino_TB.Text    = _entity.CuentaDestino;
            }
        }
예제 #28
0
        private void Cuenta_BT_Click(object sender, EventArgs e)
        {
            BankAccountSelectForm form = new BankAccountSelectForm(this, BankAccountList.GetList(ETipoCuenta.CuentaCorriente, EEstado.Active, false));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo cuenta = form.Selected as BankAccountInfo;

                _entity.OidCuentaBancaria = cuenta.Oid;
                _entity.CuentaBancaria    = cuenta.Valor;
                CuentaBancaria_TB.Text    = cuenta.Valor;
            }
        }
예제 #29
0
        protected virtual void SetBankAccountAction()
        {
            BankAccountSelectForm form = new BankAccountSelectForm(this, BankAccountList.GetList(EEstado.Active, false));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo cuenta = form.Selected as BankAccountInfo;

                _entity.OidCuentaBancaria = cuenta.Oid;
                _entity.CuentaBancaria    = cuenta.Valor;
                Cuenta_TB.Text            = _entity.CuentaBancaria;
            }
        }
예제 #30
0
        public void ShowApuntesAction()
        {
            BankAccountInfo cuenta = BankAccountInfo.Get(ActiveOID, false);

            Assembly assembly = Assembly.Load("moleQule.Face.Invoice");
            Type     type     = assembly.GetType("moleQule.Face.Invoice.BankLineMngForm");

            EntityMngBaseForm form = (EntityMngBaseForm)type.InvokeMember("BankLineMngForm", BindingFlags.CreateInstance, null, null, new object[3] {
                true, this, cuenta
            });

            form.ShowDialog();
        }
예제 #31
0
     public IBankAccountInfoBuilder WithTestData(int bankAccountID = 0)
     {
         _bankAccountInfo = _bankAccountInfo with
         {
             BankAccountID  = bankAccountID,
             AccountName    = "A valid account name",
             CurrentBalance = 0,
             Symbol         = "GBP",
             DecimalFormat  = "2.2-2",
             IsBudgeted     = false
         };
         return(this);
     }
 }
        public void AddBankAccount(BankAccountInfo bankAccount)
        {
            try
            {
                CashFlowManagerEntities db = new CashFlowManagerEntities();

                if (bankAccount.Id == Guid.Empty)
                    bankAccount.Id = Guid.NewGuid();
                db.BankAccounts.Add(bankAccount.ToEntity<BankAccount>());
                db.SaveChanges();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                throw;
            }
        }
 public void DeleteBankAccount(BankAccountInfo bankAccount)
 {
     try
     {
         CashFlowManagerEntities db = new CashFlowManagerEntities();
         BankAccount ba = (from b in db.BankAccounts where b.Id == bankAccount.Id select b).SingleOrDefault();
         if (ba != null)
         {
             db.BankAccounts.Remove(ba);
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
         throw;
     }
 }
        public BankAccountInfo GetBankAccount(Guid bankAccountId)
        {
            BankAccountInfo bankAccount = new BankAccountInfo();

            try
            {
                CashFlowManagerEntities db = new CashFlowManagerEntities();

                if (bankAccountId != Guid.Empty)
                {
                    var ba = (from b in db.BankAccounts where b.Id == bankAccountId select b).SingleOrDefault();

                    if (ba != null)
                    {
                        bankAccount = BankAccountInfo.FromEntity(ba);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                throw;
            }

            return bankAccount;
        }
 public void UpdateBankAccount(BankAccountInfo bankAccount)
 {
     try
     {
         CashFlowManagerEntities db = new CashFlowManagerEntities();
         BankAccount ba = (from b in db.BankAccounts where b.Id == bankAccount.Id select b).SingleOrDefault();
         if (ba != null)
         {
             ba.AccountName = bankAccount.AccountName;
             ba.AccountNumber = bankAccount.AccountNumber;
             ba.Balance = bankAccount.Balance;
             ba.ClientId = bankAccount.ClientId;
         }
         db.Entry(ba).State = EntityState.Modified;
         db.SaveChanges();
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
         throw;
     }
 }