private void InitializeInfo() { DataTable _denominations = Cache.GetCachedTable("currencydenominations"); if (_denominations != null) { DataRow[] _rows = _denominations.Select("[DetailId] = " + _id.ToString()); if (_rows.Length > 0) { DataRow _row = _rows[0]; if (VisualBasic.IsNumeric(_row["Denomination"])) { txtValue.Value = VisualBasic.CDbl(_row["Denomination"]); } if (!Materia.IsNullOrNothing(_row["Currency"])) { cboCurrency.SelectedValue = _row["Currency"]; } if (VisualBasic.IsNumeric(_row["Active"])) { chkActive.Checked = VisualBasic.CBool(_row["Active"]); } } } }
private void InitializeInfo() { DataTable _signatories = Cache.GetCachedTable("signatories"); DataTable _users = Cache.GetCachedTable("users"); if (_signatories != null && _users != null) { var _query = from _signs in _signatories.AsEnumerable() join _usr in _users.AsEnumerable() on _signs.Field <string>("Username") equals _usr.Field <string>("Username") where _signs.Field <long>("DetailId") == _id select new { Username = _signs.Field <string>("Username"), RoleId = _signs.Field <int>("RoleId"), FullName = _usr.Field <string>("FirstName") + " " + _usr.Field <string>("LastName"), Department = _usr.Field <string>("Department"), Position = _usr.Field <string>("Position"), CashLimit = _signs.Field <decimal>("CashLimit"), BankLimit = _signs.Field <decimal>("BankLimit") }; foreach (var _row in _query) { cboUsername.SelectedValue = _row.Username; cboRole.SelectedValue = _row.RoleId; txtFullName.Text = _row.FullName; txtDepartment.Text = _row.Department; txtPosition.Text = _row.Position; txtBankLimit.Value = VisualBasic.CDbl(_row.BankLimit); txtBankLimit.LockUpdateChecked = (_row.BankLimit > 0); txtCashLimit.Value = VisualBasic.CDbl(_row.CashLimit); txtCashLimit.LockUpdateChecked = (_row.CashLimit > 0); } } }