public void UpdateSaldo() { if (Items.Count == 0) { return; } BankAccountList cuentas = BankAccountList.GetList(false); BankAccountInfo cuenta; foreach (BankAccountInfo item in cuentas) { item.SaldoParcial = item.SaldoInicial; } foreach (BankLineInfo item in Items.Reverse()) { if (item.EEstado == EEstado.Anulado) { item.Saldo = 0; } else { cuenta = cuentas.GetItem(item.OidCuenta); if (cuenta != null) { cuenta.SaldoParcial += item.Importe; } item.Saldo = (cuenta != null) ? cuenta.SaldoParcial : item.Importe; } } }
internal static BankAccountList getBankAccountList(HttpResponseMessage responce) { var bankAccountList = new BankAccountList(); var jsonObject = JsonConvert.DeserializeObject <Dictionary <string, object> >(responce.Content.ReadAsStringAsync().Result); if (jsonObject.ContainsKey("bankaccounts")) { var bankAccountsArray = JsonConvert.DeserializeObject <List <object> >(jsonObject["bankaccounts"].ToString()); foreach (var bankAccountObj in bankAccountsArray) { var bankAccount = new BankAccount(); bankAccount = JsonConvert.DeserializeObject <BankAccount>(bankAccountObj.ToString()); bankAccountList.Add(bankAccount); } } if (jsonObject.ContainsKey("page_context")) { var pageContext = new PageContext(); pageContext = JsonConvert.DeserializeObject <PageContext>(jsonObject["page_context"].ToString()); bankAccountList.page_context = pageContext; } return(bankAccountList); }
public IActionResult ShowMultipleAccounts() { var accounts = new BankAccountList(); return(View("Test", accounts)); }
public virtual void Init(ContabilidadConfig config) { _config = config; SetConditions(config.Conditions); _accounting_entry = Convert.ToInt64(_config.AsientoInicial); if (!_config.RutaSalida.EndsWith("\\")) { _config.RutaSalida += "\\"; } if (!Directory.Exists(_config.RutaSalida)) { Directory.CreateDirectory(_config.RutaSalida); } _ayudas = AyudaList.GetList(false); _taxes = ImpuestoList.GetList(false); _families = FamiliaList.GetList(false, true); _bank_accounts = BankAccountList.GetList(false); _expense_types = TipoGastoList.GetList(false); _registry = Registro.New(ETipoRegistro.Contabilidad); _registry.Nombre = Resources.Labels.REGISTRO_CONTABILIDAD; _registry.ETipoExportacion = config.TipoExportacion; _registry.Observaciones = GetConditions(); }
public IActionResult BankAccountList() { var bankAccountList = new BankAccountList(); bankAccountList.FillList(); return(View(bankAccountList)); }
public IActionResult AddNewAccount(string name, decimal balance, string animalType, bool isKing, bool isBad) { var accounts = new BankAccountList(); accounts.accounts.Add(new BankAccount(name, balance, animalType, isKing, isBad)); return(View("Test", accounts)); }
public override void UpdateList() { switch (_current_action) { case molAction.Add: case molAction.Copy: if (_entity == null) { return; } List.AddItem(_entity.GetInfo(false)); if (FilterType == IFilterType.Filter) { BankAccountList listA = BankAccountList.GetList(_filter_results); listA.AddItem(_entity.GetInfo(false)); _filter_results = listA.GetSortedList(); } break; case molAction.Edit: case molAction.Lock: case molAction.Unlock: case molAction.ChangeStateAnulado: if (_entity == null) { return; } if (_entity.Oid != ActiveItem.Oid) { ActiveItem.CopyFrom(_entity.CuentasAsociadas.GetItem(ActiveItem.Oid)); } else { ActiveItem.CopyFrom(_entity); } break; case molAction.Delete: if (ActiveItem == null) { return; } List.RemoveItem(ActiveOID); if (FilterType == IFilterType.Filter) { BankAccountList listD = BankAccountList.GetList(_filter_results); listD.RemoveItem(ActiveOID); _filter_results = listD.GetSortedList(); } break; } RefreshSources(); if (_entity != null) { Select(_entity.Oid); } _entity = null; }
public BankAccountSelectForm(Form parent, BankAccountList list) : base(true, parent, list) { InitializeComponent(); SetView(molView.Select); DialogResult = DialogResult.Cancel; }
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); } }
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; } }
static void writeAccounts(BankAccountList list) { int i = 0; while (i < list.accountNumber) { BankAccount account = list.accounts[i]; writeAccount(account); Console.WriteLine("-------------------------------"); i++; } }
public BankAccountDTO ValidateBankAccount(int bSBDetailID, string accountNumber, int?bankAccountID) { BankAccountList bankAccount = BankAccountList.ValidateBankAccount(bSBDetailID, accountNumber, bankAccountID); if (bankAccount.Count > 0) { return(bankAccount[0].CurrentDTO); } return(null); }
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; } }
static int addAccount(BankAccountList list, BankAccount account) { if (list.accountNumber == 100) { return(-1); } else { list.accounts[list.accountNumber] = account; list.accountNumber = list.accountNumber + 1; return(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; } }
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; } }
static void Main(string[] args) { BankAccountList l = new BankAccountList(); loadAccounts(l); incrementAmount(l.accounts[0], 100); incrementAmount(l.accounts[1], 1000); BankAccount ac = higherAmount(l); if (ac != null) { writeAccount(ac); } else { Console.WriteLine("No hay ninguna cuenta"); } /*BankAccount ac1 = readBankAccount(); * Console.WriteLine("Cuanto quieres ingresar?"); * double cantidad = Convert.ToDouble(Console.ReadLine()); * incrementAmount(ac1, cantidad); * Console.WriteLine("Cuanto quieres sacar?"); * cantidad = Convert.ToDouble(Console.ReadLine()); * decrementAmount(ac1, cantidad); * writeAccount(ac1); * BankAccount ac2 = readBankAccount(); * BankAccount resultado = accountUnion(ac1, ac2); * if (resultado != null) * { * writeAccount(resultado); * } * else * { * Console.WriteLine("El propietario de las cuentas NO es el mismo"); * }*/ /* * BankAccount ac1 = readBankAccount(); * Console.WriteLine("Cuanto quieres ingresar?"); * double cantidad = Convert.ToDouble(Console.ReadLine()); * incrementAmount(ac1, cantidad); * BankAccount ac2 = readBankAccount(); * Console.WriteLine("Cuanto quieres ingresar?"); * cantidad = Convert.ToDouble(Console.ReadLine()); * incrementAmount(ac2, cantidad); * * BankAccount resultado = accountUnion(ac1, ac2); */ }
public IActionResult All(int index) { var bank = new BankAccountList(); if (BankAccountList.Accounts[index - 1].IsKing) { BankAccountList.Accounts[index - 1].Balance += 100; } else { BankAccountList.Accounts[index - 1].Balance += 10; } return(View(BankAccountList.Accounts)); }
public BankAccountMngForm(bool isModal, Form parent, BankAccountList list) : base(isModal, parent, list) { InitializeComponent(); SetView(molView.Normal); // Parche para poder abrir el formulario en modo diseño y no perder la configuracion de columnas DatosLocal_BS = Datos; Tabla.DataSource = DatosLocal_BS; SetMainDataGridView(Tabla); Datos.DataSource = BankAccountList.NewList().GetSortedList(); SortProperty = Entidad.DataPropertyName; }
public async void Edit_Bank() { if (selectedBank.BANK_ID != null && selectedBank.BANK_ID != 0) { App.Current.Properties["Action"] = "Edit"; HttpClient client = new HttpClient(); client.BaseAddress = new Uri(GlobalData.gblApiAdress); client.DefaultRequestHeaders.Accept.Add( new MediaTypeWithQualityHeaderValue("application/json")); client.Timeout = new TimeSpan(500000000000); HttpResponseMessage response = client.GetAsync("api/BankAPI/BankEdit?id=" + selectedBank.BANK_ID + "").Result; if (response.IsSuccessStatusCode) { data = JsonConvert.DeserializeObject <BankModel[]>(await response.Content.ReadAsStringAsync()); if (data.Length > 0) { for (int i = 0; i < data.Length; i++) { selectedBank.ADDRESS_1 = data[i].ADDRESS_1; selectedBank.ADDRESS_2 = data[i].ADDRESS_2; selectedBank.BANK_CODE = data[i].BANK_CODE; selectedBank.BANK_ID = data[i].BANK_ID; selectedBank.BANK_NAME = data[i].BANK_NAME; selectedBank.CITY = data[i].CITY; selectedBank.COMPANY_ID = data[i].COMPANY_ID; selectedBank.COUNTRY = data[i].COUNTRY; selectedBank.EMAIL = data[i].EMAIL; selectedBank.FAX_NUMBER = data[i].FAX_NUMBER; selectedBank.IFSC_CODE = data[i].IFSC_CODE; selectedBank.IS_DELETED = data[i].IS_DELETED; selectedBank.MOBILE_NUMBER = data[i].MOBILE_NUMBER; selectedBank.PHONE_NUMBER = data[i].PHONE_NUMBER; selectedBank.PIN_CODE = data[i].PIN_CODE; selectedBank.STATE = data[i].STATE; selectedBank.WEBSITE = data[i].WEBSITE; } App.Current.Properties["BankEdit"] = selectedBank; BankAccountList IA = new BankAccountList(); IA.Show(); } } } else { MessageBox.Show("Select Bank first", "Bank Selection", MessageBoxButton.OK, MessageBoxImage.Error); return; } }
public IActionResult AnimalList() { BankAccountList bankAccounts = new BankAccountList(); bankAccounts.Accounts.Add(new BankAccount() { Name = "Simba", Balance = 2000, AnimalType = AnimalType.Lion, IsKing = true, IsGood = true }); bankAccounts.Accounts.Add(new BankAccount() { Name = "Timon", Balance = 1000, AnimalType = AnimalType.Meerktas, IsKing = false, IsGood = false }); bankAccounts.Accounts.Add(new BankAccount() { Name = "Pumbaa", Balance = 5000, AnimalType = AnimalType.Boar, IsKing = false, IsGood = false }); bankAccounts.Accounts.Add(new BankAccount() { Name = "Rafiki", Balance = 4000, AnimalType = AnimalType.Baboon, IsKing = false, IsGood = true }); bankAccounts.Accounts.Add(new BankAccount() { Name = "Zazu", Balance = 3000, AnimalType = AnimalType.Hornbill, IsKing = false, IsGood = true }); return(View(bankAccounts)); }
public IActionResult RaiseTheBalance(int increment) { foreach (var item in BankAccountList.AccountList) { if (item.IsKing) { item.Balance += increment + 90; } else { item.Balance += increment; } } var accounts = new BankAccountList(); return(View("Test", accounts)); }
static BankAccount higherAmount(BankAccountList list) { int i = 0; double maxAmount = -1; BankAccount result = null; while (i < list.accountNumber) { if (list.accounts[i].amount > maxAmount) { result = list.accounts[i]; maxAmount = result.amount; } i++; } return(result); }
protected override void RefreshMainData() { PgMng.Grow(string.Empty, "CuentaBancaria"); long oid = ActiveOID; switch (DataType) { case EntityMngFormTypeData.Default: List = BankAccountList.GetList(false); break; case EntityMngFormTypeData.ByParameter: _sorted_list = List.GetSortedList(); break; } PgMng.Grow(string.Empty, "Lista de CuentaBancarias"); }
private void PB0801_Load(object sender, EventArgs e) { try { SetScreenName(); var loadTask = new List <Task>(); if (Company == null) { loadTask.Add(LoadCompanyAsync()); } if (ApplicationControl == null) { loadTask.Add(LoadApplicationControlAsync()); } loadTask.Add(LoadControlColorAsync()); loadTask.Add(LoadFunctionAuthorities(MasterImport, MasterExport)); Task <List <BankAccount> > loadListTask = LoadListAsync(); loadTask.Add(loadListTask.ContinueWith(task => BankAccountList.AddRange(task.Result))); ProgressDialog.Start(ParentForm, Task.WhenAll(loadTask), false, SessionKey); InitializeGridTemplate(); grdBankAccount.DataSource = new BindingSource(BankAccountList, null); ComboDataBind(); DisplaySectionInput(); txtCategoryCode.MaxLength = 2; txtCategoryCode.PaddingChar = '0'; ClearAll(); BaseContext.SetFunction05Enabled(Authorities[MasterImport]); BaseContext.SetFunction06Enabled(Authorities[MasterExport]); } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
static void loadAccounts(BankAccountList list) { bool end = false; while (!end) { Console.WriteLine("Quieres añadir?"); String result = Console.ReadLine(); if (result == "s") { BankAccount account = readBankAccount(); addAccount(list, account); } else { end = true; } } }
private BankAccountList GetBankAccounts(int page, int pageSize) { var bankAccounts = this.bankAccountRepository.GetBankAccounts( p => !p.isLocked, new string[] { "Customer" }, //new string[] { "Customer" }, page, pageSize, new SortExpression <BankAccount>(p => p.customer.lastName, ListSortDirection.Ascending), new SortExpression <BankAccount>(p => p.number, ListSortDirection.Descending)); var vm = new BankAccountList { BankAccounts = bankAccounts.BankAccouns.ToList(), Page = page, TotalCount = bankAccounts.TotalCount }; return(vm); }
internal static BankAccountList getBankAccountList(HttpResponseMessage responce) { var bankAccountList = new BankAccountList(); var jsonObject = JsonConvert.DeserializeObject<Dictionary<string, object>>(responce.Content.ReadAsStringAsync().Result); if (jsonObject.ContainsKey("bankaccounts")) { var bankAccountsArray = JsonConvert.DeserializeObject<List<object>>(jsonObject["bankaccounts"].ToString()); foreach (var bankAccountObj in bankAccountsArray) { var bankAccount = new BankAccount(); bankAccount = JsonConvert.DeserializeObject<BankAccount>(bankAccountObj.ToString()); bankAccountList.Add(bankAccount); } } if (jsonObject.ContainsKey("page_context")) { var pageContext = new PageContext(); pageContext = JsonConvert.DeserializeObject<PageContext>(jsonObject["page_context"].ToString()); bankAccountList.page_context = pageContext; } return bankAccountList; }
protected virtual void SetBankAccountAction() { BankAccountSelectForm form; if (_entity.EMedioPago == EMedioPago.ComercioExterior) { form = new BankAccountSelectForm(this, BankAccountList.GetList(ETipoCuenta.ComercioExterior, moleQule.Base.EEstado.Active, false)); } else { form = new BankAccountSelectForm(this, BankAccountList.GetNoAsociadasList(moleQule.Base.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; } }
private void Import() { try { ImportSetting importSetting = null; var task = Util.GetMasterImportSettingAsync(Login, ImportFileType.BankAccount); ProgressDialog.Start(ParentForm, task, false, SessionKey); importSetting = task.Result; var definition = new BankAccountFileDefinition(new DataExpression(ApplicationControl)); definition.CategoryIdField.GetModelsByCode = val => { Dictionary <string, Category> product = null; ServiceProxyFactory.LifeTime(factory => { var categoryMaster = factory.Create <CategoryMasterClient>(); CategoriesResult result = categoryMaster.GetByCode( Login.SessionKey, Login.CompanyId, 2, val); if (result.ProcessResult.Result) { product = result.Categories .ToDictionary(c => c.Code); } }); return(product ?? new Dictionary <string, Category>()); }; definition.SectionIdField.Ignored = !UseSection; definition.SectionIdField.GetModelsByCode = val => { Dictionary <string, Section> product = null; ServiceProxyFactory.LifeTime(factory => { var sectionMaster = factory.Create <SectionMasterClient>(); SectionsResult result = sectionMaster.GetByCode( Login.SessionKey, Login.CompanyId, val); if (result.ProcessResult.Result) { product = result.Sections .ToDictionary(c => c.Code); } }); return(product ?? new Dictionary <string, Section>()); }; var importer = definition.CreateImporter(m => new { m.BankCode, m.BranchCode, m.AccountTypeId, m.AccountNumber }); importer.UserId = Login.UserId; importer.UserCode = Login.UserCode; importer.CompanyId = Login.CompanyId; importer.CompanyCode = Login.CompanyCode; importer.LoadAsync = async() => await LoadListAsync(); importer.RegisterAsync = async unitOfWork => await RegisterForImportAsync(unitOfWork); var importResult = DoImport(importer, importSetting, ClearAll); if (!importResult) { return; } BankAccountList.Clear(); Task <List <BankAccount> > loadListTask = LoadListAsync(); ProgressDialog.Start(ParentForm, loadListTask, false, SessionKey); BankAccountList.AddRange(loadListTask.Result); grdBankAccount.DataSource = new BindingSource(BankAccountList, null); } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); ShowWarningDialog(MsgErrImportErrorWithoutLog); } }
private void Delete() { try { if (!ValidateChildren()) { return; } if (!ValidateInput(isDelete: true)) { return; } if (!ShowConfirmDialog(MsgQstConfirmDelete)) { DispStatusMessage(MsgInfProcessCanceled); return; } var bankCode = txtBankCode.Text; var branchCode = txtBranchCode.Text; int accountTypeId = Convert.ToInt32(cmbAccountType.SelectedItem.SubItems[1].Value); var accountNumber = txtAccountNumber.Text; CurrentAccount = BankAccountList.Find(b => (b.BankCode == bankCode) && (b.BranchCode == branchCode) && (b.AccountTypeId == accountTypeId) && (b.AccountNumber == accountNumber)); BankId = CurrentAccount != null ? CurrentAccount.Id : 0; CountResult deleteResult = new CountResult(); List <BankAccount> newList = null; if (BankId > 0) { var task = ServiceProxyFactory.LifeTime(async factory => { var service = factory.Create <BankAccountMasterClient>(); deleteResult = await service.DeleteAsync( Login.SessionKey, BankId); if (deleteResult.ProcessResult.Result && deleteResult.Count > 0) { newList = await LoadListAsync(); } }); ProgressDialog.Start(ParentForm, task, false, SessionKey); } if (deleteResult.Count > 0) { BankAccountList.Clear(); BankAccountList.AddRange(newList); grdBankAccount.DataSource = new BindingSource(BankAccountList, null); ClearAll(); DispStatusMessage(MsgInfDeleteSuccess); } else { ShowWarningDialog(MsgErrDeleteError); } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }