private void Recursive(DevComponents.AdvTree.Node _nd) { ic.accountC _acc = _nd.Tag as ic.accountC; iGRow _row = null; foreach (var t in _nd.Nodes.Cast <DevComponents.AdvTree.Node>()) { _row = fGrid.Rows.Add(); _row.Level = t.Level - 1; _row.Font = new Font("georgia", 12, FontStyle.Regular); _row.ReadOnly = iGBool.True; _row.Cells["Account Name"].Value = t.Text; _row.Cells["Alias"].Value = null; _row.Cells["section_index"].Value = _acc.account_dept_type.ToByte(); _row.Cells["section_name"].Value = _acc.account_dept_type.ToStringNullable(); _row.Key = _acc.account_id.ToStringNullable(); _row.AutoHeight(); if (t.Nodes.Count == 0) { continue; } _row.TreeButton = iGTreeButtonState.Visible; Recursive(t); } }
private void RecursiveLoad(int parent_id) { iGRow _row = null; var nlist = from k in datam.DATA_DEPARTMENT.Values where k.parent_id == parent_id orderby k.index select k; if (nlist.Count() > 0) { foreach (var obj in nlist) { _row = fGrid.Rows.Add(); _row.Font = new Font("verdana", 9, FontStyle.Bold); _row.Cells["gp_name"].Col.Width = 220; _row.Cells["mem_cnt"].Col.Width = 100; _row.Cells["gp_name"].Value = obj.dept_name; _row.Cells["gp_name"].TextAlign = iGContentAlignment.MiddleLeft; _row.Cells["mem_cnt"].ValueType = typeof(int); _row.Key = obj.dept_id.ToStringNullable(); _row.ForeColor = Color.Purple; _row.AutoHeight(); _row.Cells["mem_cnt"].Value = obj.MemberCount; _row.Tag = obj; _row.TreeButton = iGTreeButtonState.Hidden; _row.Level = 1; } fGrid.Rows[parent_id.ToString()].TreeButton = iGTreeButtonState.Visible; } }
public void CreateNewRow(ic.expense_accountC _obj, bool update_mode) { iGRow _row = null; fGrid.BeginUpdate(); _row = fGrid.Rows.Add(); _row.Font = new Font("georgia", 12, FontStyle.Regular); _row.TextAlign = iGContentAlignment.BottomLeft; _row.ReadOnly = iGBool.True; _row.Cells["exp_name"].Value = _obj.exp_acc_name.ToProperCase(); if (_obj.objCategory != null) { _row.Cells["category"].Value = _obj.objCategory.exp_cat_name; } if ((_obj.dept_id > 0 | _obj.dept_id == -5000)) { _row.Cells["dept"].Value = datam.DATA_DEPARTMENT[_obj.dept_id].dept_name; } _row.Cells["exp_type"].Value = fnn.GetExpenseTypeName(_obj.exp_acc_type); _row.Cells["exp_type"].AuxValue = _obj.exp_acc_type.ToByte(); _row.Cells["colSearch"].Value = string.Format("{0} {1} {2} {3}", _obj.exp_acc_name.ToLower(), _row.Cells["exp_type"].Text, _row.Cells["dept"].Text, _row.Cells["category"].Text).ToLower();; _row.Tag = _obj; _row.Key = _obj.exp_acc_id.ToStringNullable(); _row.AutoHeight(); _row.Height += 2; fGrid.EndUpdate(); }
void LoadGrid(int cols) { iGRow _row = null; iGrid1.BeginUpdate(); iGrid1.Rows.Clear(); var _nlist = (from h in datam.DATA_MEMBER.Values where h.objPicture != null select h).ToList(); int y = 0; while (y < _nlist.Count) { _row = iGrid1.Rows.Add(); _row.Height = 150; for (int j = 0; j < cols; j++) { if (y == _nlist.Count) { break; } if (!iGrid1.Cols[j].Visible) { iGrid1.Cols[j].Visible = true; } _row.Cells[j].Value = _nlist[y].objPicture.SmallLabelPicture; iGrid1.Cols[j].Width = 102; y++; } } iGrid1.AutoResizeCols = false; iGrid1.EndUpdate(); }
public void EditRow(ic.expense_accountC _obj) { if (_obj == null) { return; } fGrid.BeginUpdate(); iGRow _row = null; try { _row = fGrid.Rows[_obj.exp_acc_id.ToString()]; } catch (Exception) { CreateNewRow(_obj, true); fGrid.EndUpdate(); return; } _row.Cells["exp_name"].Value = _obj.exp_acc_name.ToProperCase(); if (_obj.objCategory != null) { _row.Cells["category"].Value = _obj.objCategory.exp_cat_name; } if (_obj.dept_id > 0) { _row.Cells["dept"].Value = datam.DATA_DEPARTMENT[_obj.dept_id].dept_name; } _row.Cells["exp_type"].Value = fnn.GetExpenseTypeName(_obj.exp_acc_type); _row.Cells["colSearch"].Value = string.Format("{0} {1} {2} {3}", _obj.exp_acc_name.ToLower(), _row.Cells["exp_type"].Text, _row.Cells["dept"].Text, _row.Cells["category"].Text).ToLower();; fGrid.Cols.AutoWidth(); fGrid.AutoResizeCols = false; fGrid.EndUpdate(); }
private void CollapseOther() { return; if (fGrid.Rows.Count == 0) { return; } iGRow _r = null; int count = 0; fGrid.BeginUpdate(); foreach (var i in OtherGroups) { count = 0; _r = fGrid.Rows[i]; if (_r.Type == iGRowType.AutoGroupRow) { count = GetGroupRowCount(m_group_col, _r.RowTextCell.Text); _r.Expanded = false; _r.RowTextCell.Value = string.Format("{0} = {1}", _r.RowTextCell.Text, count); } } fGrid.EndUpdate(); }
private void OrderBoxForm_Load(object sender, EventArgs e) { if (Common.CurrentOrder != null) { iGrid1.BeginUpdate(); iGrid1.Cols[0].Width = (int)((iGrid1.Width - iGrid1.Margin.Left - iGrid1.Margin.Right) * 0.5); iGrid1.Cols[1].Width = (int)((iGrid1.Width - iGrid1.Margin.Left - iGrid1.Margin.Right) * 0.2); iGrid1.Cols[2].Width = (int)((iGrid1.Width - iGrid1.Margin.Left - iGrid1.Margin.Right) * 0.15); iGrid1.Cols[3].Width = (int)((iGrid1.Width - iGrid1.Margin.Left - iGrid1.Margin.Right) * 0.15); foreach (OrderClass o in Common.CurrentOrder) { iGRow r = iGrid1.Rows.Add(); r.Key = o.Code; r.Cells["Title"].Value = o.Title; r.Cells["Price"].Value = o.Price; r.Cells["Quantity"].Value = o.Quantity; CalcSum(r); } iGrid1.Refresh(); iGrid1.EndUpdate(); CalcTotal(); } else { DialogResult = DialogResult.Abort; } }
private void CalcSum(iGRow curRow) { if (curRow != null) { curRow.Cells["Summ"].Value = Convert.ToDecimal(curRow.Cells["Quantity"].Value) * Convert.ToDecimal(curRow.Cells["Price"].Value); } }
private void AddRowX(iGrid _grid) { if (_grid.Rows.Cast <iGRow>().Count(j => j.Cells[0].Value == null) > 0) { _grid.Focus(); var _cell = _grid.Rows.Cast <iGRow>().Where(j => j.Cells[0].Value == null).Select(v => v.Cells[0]).FirstOrDefault(); if (_cell != null) { _cell.Selected = true; } return; } iGRow _row = null; _grid.Focus(); _row = _grid.Rows.Add(); _row.Cells[0].Col.Width = 290; _row.Cells[1].Col.Width = 22; _row.Font = new Font("verdana", 11, FontStyle.Regular); _row.ForeColor = Color.DarkBlue; _row.AutoHeight(); _row.Height += 1; _grid.SetCurCell(_grid.Rows.Count - 1, 0); SendKeys.Send("{ENTER}"); _grid.AutoResizeCols = false; }
private void button5_Click(object sender, EventArgs e) { iGRow r = grdMain.Rows.Add(); r.Cells[0].Value = "Groove/Stripe"; r.Cells[1].Value = "Harlan 2"; r.Cells[2].Value = DateTime.Now.AddDays(1).ToString("d"); }
private void LoadMainGrid() { iGRow _row = null; if (datam.DATA_DEPARTMENT == null) { return; } if (datam.DATA_DEPARTMENT.Keys.Count == 0) { return; } string _key = null; if (fGrid.Rows.Count > 0) { _key = fGrid.CurCell == null ? null : fGrid.CurCell.Row.Key; fGrid.Rows.Clear(); fGrid2.Rows.Clear(); } fGrid.BeginUpdate(); var nlist = from d in datam.DATA_DEPARTMENT.Values where d.dept_type == em.dept_typeS.main orderby d.dept_id select d; foreach (var obj in nlist) { _row = fGrid.Rows.Add(); _row.Font = new Font("verdana", 10, FontStyle.Bold); _row.Cells["gp_name"].Col.Width = 220; _row.Cells["mem_cnt"].Col.Width = 100; _row.Cells["gp_name"].Value = obj.dept_name; _row.Cells["gp_name"].TextAlign = iGContentAlignment.MiddleLeft; _row.Cells["mem_cnt"].ValueType = typeof(int); _row.Key = obj.dept_id.ToStringNullable(); _row.AutoHeight(); _row.Cells["mem_cnt"].Value = obj.MemberCount; _row.Tag = obj; _row.TreeButton = iGTreeButtonState.Hidden; _row.Level = 0; // RecursiveLoad(obj.dept_id); } if (!string.IsNullOrEmpty(_key)) { try { fGrid.Rows[_key].Cells[0].Selected = true; } catch (Exception ex) { } } fGrid.Cols.AutoWidth(); fGrid.AutoResizeCols = false; fGrid.EndUpdate(); }
private void LoadMainGrid() { fGrid.BeginUpdate(); iGRow _row = null; _row = fGrid.Rows.Add(); _row.Height = 4; _row.BackColor = Color.Lavender; _row.Selectable = false; int group_index = 1; string group_name = "New Account Information"; // _row = CreateNewRow("Pledge Name", "pledge_name", typeof(string), group_index, group_name); _row = fGrid.Rows.Add(); _row.Height = 4; _row.BackColor = Color.Lavender; _row.Selectable = false; _row = CreateNewRow("Bind To Account", "account", typeof(string), group_index, group_name); _row.Cells[0].TextAlign = iGContentAlignment.MiddleRight; _row.Cells[1].Font = new Font("verdana", 15, FontStyle.Regular); _row.ForeColor = Color.Maroon; _row.Height += 4; // _row = fGrid.Rows.Add(); _row.Height = 4; _row.BackColor = Color.Lavender; _row.Selectable = false; // // var _dropdown = new fnn.DropDownCalenderX(); _row = CreateNewRow("Start Date", "start_date", typeof(string), group_index, group_name); _row.Cells["desc"].TypeFlags = iGCellTypeFlags.ComboPreferValue | iGCellTypeFlags.NoTextEdit; _row.Cells["desc"].FormatString = "{0:D}";// {0:d} for short date string _row.Cells["desc"].DropDownControl = new fnn.DropDownCalenderX(); _row.Cells["desc"].ForeColor = Color.DarkBlue; _row.Cells["desc"].Value = null; _row.Cells["desc"].Enabled = iGBool.False; // _row = CreateNewRow("End Date", "end_date", typeof(string), group_index, group_name); _row.Cells["desc"].TypeFlags = iGCellTypeFlags.ComboPreferValue | iGCellTypeFlags.NoTextEdit; _row.Cells["desc"].FormatString = "{0:D}";// {0:d} for short date string _row.Cells["desc"].Value = null; _row.Cells["desc"].DropDownControl = new fnn.DropDownCalenderX(); _row.Cells["desc"].Enabled = iGBool.False; // _row = fGrid.Rows.Add(); _row.Height = 5; _row.BackColor = Color.Lavender; _row.Selectable = false; // fGrid.EndUpdate(); }
private void FillGrid() { ClearAllGrids(); if (datam.DATA_MEM_STATS == null) { return; } byte _index = 0; byte _counter = 0; iGrid _grid = null; iGRow _row = null; foreach (var g in m_grids) { g.BeginUpdate(); } foreach (var c in datam.DATA_MEM_STATS.Values.OrderBy(j => j.cat_index)) { _grid = m_grids[_index]; foreach (var t in c.TypeCollection.Values) { if (c.is_optional & t.count == 0) { continue; } _row = _grid.Rows.Add(); _row.ReadOnly = iGBool.True; _row.Font = new Font("verdana", 11, FontStyle.Regular); _row.Cells["name"].Value = t.type_name; _row.Cells["category"].Value = c.cat_name; _row.Cells["value"].Value = t.count == 0 ? null : t.count.ToStringNullable(); _row.Cells["svalue"].Value = c.cat_index; _row.Cells[1].ForeColor = Color.Black; _row.Cells[0].ForeColor = Color.DarkGreen; _row.AutoHeight(); } _counter++; if (_counter == 5 & _index != 2) { _index++; _counter = 0; } } SortAndGroup(); foreach (var g in m_grids) { g.Cols[0].Width = ((3 * g.ClientSize.Width) / 4); g.Cols[1].AutoWidth(); g.AutoResizeCols = false; g.EndUpdate(); } }
private void LoadMainGrid() { fGrid.BeginUpdate(); iGRow _row = null; _row = fGrid.Rows.Add(); _row.Height = 7; _row.BackColor = Color.Lavender; _row.Selectable = false; int group_index = 1; string group_name = "New Account Information"; // _row = CreateNewRow("Data Entrant ", "data_entrant", typeof(string), group_index, group_name); _row.Cells[1].ForeColor = Color.DarkBlue; var icombo = fnn.CreateCombo(); foreach (var b in m_DataEntrants) { try { icombo.Items.Add(new fnn.iGComboItemEX() { Value = sdata.GetUserName(b), Tag = b, ID = b }); } catch (Exception) { continue; } } _row.Cells[1].DropDownControl = icombo; _row.Cells[1].Value = null; _row = fGrid.Rows.Add(); _row.Height = 5; _row.BackColor = Color.Lavender; _row.Selectable = false; _row = CreateNewRow("Batch No", "batch_no", typeof(string), group_index, group_name); _row = CreateNewRow("Batch Record Count", "batch_count", typeof(string), group_index, group_name); _row = CreateNewRow("Batch Total (Ugx)", "batch_total", typeof(decimal), group_index, group_name); _row.Cells[1].FormatString = "{0:N0}"; _row = fGrid.Rows.Add(); _row.Height = 5; _row.BackColor = Color.Lavender; _row.Selectable = false; fGrid.EndUpdate(); }
private void LoadMainGrid() { fGrid.BeginUpdate(); clear_grid_data(); iGRow _row = null; iGDropDownList icombo = null; int group_index = 1; string group_name = "Personal Information"; _row = CreateNewRow("Account Alias", "alias", typeof(string), group_index, group_name); _row = CreateNewRow("Account ID", "account_id", typeof(string), group_index, group_name); _row.Enabled = iGBool.False; _row = CreateNewRow("Account Status", "account_status", typeof(string), group_index, group_name); icombo = CreateCombo(); icombo.Items.Add(new fnn.iGComboItemEX() { Tag = 1, Text = "Enabled", Value = "Enabled" }); icombo.Items.Add(new fnn.iGComboItemEX() { Tag = 0, Text = "Disabled", Value = "Disabled" }); _row.Cells["desc"].DropDownControl = icombo; _row.Cells["desc"].Value = null; _row.Enabled = iGBool.False; // is system account _row = CreateNewRow("Is System Account", "is_sys_account", typeof(string), group_index, group_name); icombo = CreateCombo(); icombo.Items.Add(new fnn.iGComboItemEX() { Tag = 1, Text = "Yes", Value = "Yes" }); icombo.Items.Add(new fnn.iGComboItemEX() { Tag = 0, Text = "No", Value = "No" }); _row.Cells["desc"].DropDownControl = icombo; _row.Cells["desc"].Value = null; _row.Enabled = iGBool.False; // _row = CreateNewRow("Map ID", "map_id", typeof(int), group_index, group_name); fGrid.EndUpdate(); }
private void LoadMainGrid(IEnumerable <ic.foreign_exchange_convC> _list) { fGrid.BeginUpdate(); fGrid.Rows.Clear(); if (_list == null) { fGrid.EndUpdate(); return; } iGRow _row = null; foreach (var n in _list) { _row = fGrid.Rows.Add(); _row.ReadOnly = iGBool.True; _row.Font = new Font("georgia", 12, FontStyle.Regular); _row.Cells["date"].Value = n.fs_date.ToMyShortDate(); _row.Cells["currency"].Value = datam.DATA_FOREIGN_CURRENCY[n.currency_id].fr_currency_name; _row.Cells["amount"].Value = n.exchanged_amount; _row.Cells["amount"].TextAlign = iGContentAlignment.MiddleCenter; // _row.Cells["rate"].Value = n.used_exch_rate; _row.Cells["sys_rate"].Value = n.curr_sys_exch_rate; // _row.Cells["ug_amount"].Value = n.converted_ug_amount; _row.Cells["ug_amount"].TextAlign = iGContentAlignment.MiddleCenter; if (n.exch_loss > 0) { _row.Cells["loss"].Value = n.exch_loss; } _row.Cells["loss"].ForeColor = Color.Maroon; if (n.exch_gain > 0) { _row.Cells["gain"].Value = n.exch_gain; } _row.Cells["gain"].ForeColor = Color.DarkGreen; _row.Cells["pc_us_id"].Value = sdata.GetUserName(n.pc_us_id); _row.Key = n.un_id.ToStringNullable(); _row.Tag = n; _row.AutoHeight(); n.is_updated = false; } fGrid.EndUpdate(); fGrid.Cols.AutoWidth(); fGrid.AutoResizeCols = false; }
private void ts_delete_Click(object sender, EventArgs e) { using (var _fm = new SdaHelperManager.ConfirmWPwd()) { _fm.ShowDialog(); if (_fm.DialogResult != DialogResult.OK) { return; } } string _str = "Are You Sure You Want To Delete The Expense Account ??"; iGRow _row = fGrid.SelectedRows[0]; var _obj = fGrid.SelectedRows[0].Tag as ic.expense_accountC; if (_obj == null) { return; } if (dbm.ExecuteScalarInt(string.Format("select TOP 1 exp_acc_id from acc_expense_trans_tb where exp_acc_id={0}", _obj.exp_acc_id)) > 0) { MessageBox.Show("Cannot Delete This Expense Account Since Has Important Attachements To Other Records Already", "Delete Failure"); return; } if (!dbm.WarningMessage(_str, "Delete Warning")) { return; } using (var xd = new xing()) { xd.SingleDeleteCommandExp("acc_expense_accounts_tb", new string[] { "exp_acc_id", "lch_id" }, new int[] { _obj.exp_acc_id, datam.LCH_ID }); _row.Tag = null; fGrid.Rows.RemoveAt(_row.Index); datam.DATA_EXPENSE_ACCOUNTS.Remove(_obj.exp_acc_id); // xd.SingleDeleteCommandExp("accounts_tb", new string[] { "account_id", }, new int[] { _obj.sys_account_id }); // datam.DATA_ACCOUNTS.Remove(_obj.sys_account_id); xd.CommitTransaction(); sdata.ClearFormCache(em.fm.chart_of_accounts.ToInt16()); } }
private void buttonX1_Click(object sender, EventArgs e) { int _index = 0; int _col_width = 0; try { _index = fGrid2.Rows["othersxxx"].Index; _col_width = fGrid2.Cols[0].Width; } catch (Exception ex) { MessageBox.Show(ex.Message); return; } if (fGrid2.Rows.Cast <iGRow>().Where(i => i.Index > _index).Count(j => j.Cells[1].Value == null) > 0) { fGrid2.Focus(); fGrid2.SetCurCell(fGrid2.Rows.Count - 1, 1); SendKeys.Send("{ENTER}"); return; } fGrid2.BeginUpdate(); iGRow _row = CreateNewRow2(); var icombo = fnn.CreateCombo(); icombo.MaxVisibleRowCount = 6; var nlist = from t in datam.DATA_MEMBER.Values where t.IsCurrentMember & (t.DepartmentCollection.Count(k => k.dept_id == m_dept.dept_id) == 0) select t; foreach (var m in nlist) { icombo.Items.Add(new fnn.iGComboItemEX() { Tag = m, Text = m.mem_name, Value = m.mem_name }); } _row.Cells[1].DropDownControl = icombo; fGrid2.Focus(); fGrid2.SetCurCell(fGrid2.Rows.Count - 1, 1); SendKeys.Send("{ENTER}"); fGrid2.Cols[0].Width = _col_width; fGrid2.EndUpdate(); }
private void LoadMainGrid() { fGrid.BeginUpdate(); fGrid.Rows.Clear(); iGRow _row = null; float _total = 0f; float _paid = 0f; float _percent = 0f; var _list = from j in datam.DATA_CURRENT_PLEDGES.Values where j.pls_id == m_pledge_settings.pls_id & j.pledge_status != em.pledge_statusS.deleted select j; foreach (var n in _list) { _row = fGrid.Rows.Add(); _row.Font = new Font("verdana", 12, FontStyle.Regular); _row.ReadOnly = iGBool.True; _row.Cells["no"].Value = fGrid.Rows.Count; _row.Cells["pledge"].Value = n.source_name; _row.Cells["pledge_amount"].Value = n.amount_pledged; _row.Cells["paid"].Value = n.amount_paid; _row.Cells["phone"].Value = n.source_phone; if (n.balance > 0) { _row.Cells["balance"].Value = n.balance; } if (n.amount_paid > 0) { _total = n.amount_pledged; _paid = n.amount_paid; _percent = ((_paid / _total) * 100); _row.Cells["p_comp"].Value = string.Format(" {0} %", Math.Round(_percent, 1)); } else { _row.Cells["p_comp"].Value = string.Format(" {0} %", 0); } _row.Tag = n; _row.Key = string.Format("{0}", n.pl_id); _row.AutoHeight(); _row.Height += 2; } fGrid.Cols.AutoWidth(); fGrid.AutoResizeCols = false; fGrid.EndUpdate(); }
public void NewRecord(ic.pledgeC n) { fGrid.BeginUpdate(); iGRow _row = null; float _total = 0f; float _paid = 0f; float _percent = 0f; _row = fGrid.Rows.Add(); _row.Font = new Font("verdana", 12, FontStyle.Regular); _row.ReadOnly = iGBool.True; _row.Cells["no"].Value = fGrid.Rows.Count; _row.Cells["pledge"].Value = n.source_name; _row.Cells["pledge_amount"].Value = n.amount_pledged; _row.Cells["paid"].Value = n.amount_paid; _row.Cells["phone"].Value = n.source_phone; if (n.balance > 0) { _row.Cells["balance"].Value = n.balance; } if (n.amount_paid > 0) { _total = n.amount_pledged; _paid = n.amount_paid; _percent = ((_paid / _total) * 100); _row.Cells["p_comp"].Value = string.Format(" {0} %", Math.Round(_percent, 1)); } else { _row.Cells["p_comp"].Value = string.Format(" {0} %", 0); } _row.Key = string.Format("{0}", n.pl_id); _row.AutoHeight(); _row.Height += 2; _row.Tag = n; fGrid.Cols.AutoWidth(); fGrid.AutoResizeCols = false; fGrid.EndUpdate(); if (this.Tag != null) { this.Tag = null; } }
private bool AddTask(string Line, string Task) { if (TaskExists(Task)) { MessageBox.Show("Task already exists and will not be added!", "Add Task", MessageBoxButtons.OK); return(false); } iGRow r = grdMain.Rows.Add(); r.Cells[0].Value = Task; r.Cells[1].Value = Line; r.Cells[2].Value = DateTime.Now.AddDays(1).ToString("d"); return(true); }
private void LoadMainGrid(IEnumerable <ic.pledgeC> _list) { fGrid.BeginUpdate(); fGrid.Rows.Clear(); if (_list == null) { fGrid.EndUpdate(); return; } iGRow _row = null; float _total = 0f; float _paid = 0f; float _percent = 0f; foreach (var n in _list) { _row = fGrid.Rows.Add(); _row.Font = new Font("verdana", 12, FontStyle.Regular); _row.ReadOnly = iGBool.True; _row.Cells["pledge"].Value = n.source_name; _row.Cells["pledge_amount"].Value = n.amount_pledged; _row.Cells["paid"].Value = n.amount_paid; _row.Cells["phone"].Value = n.source_phone; if (n.balance > 0) { _row.Cells["balance"].Value = n.balance; } if (n.amount_paid > 0) { _total = n.amount_pledged; _paid = n.amount_paid; _percent = ((_paid / _total) * 100); _row.Cells["p_comp"].Value = string.Format(" {0} %", Math.Round(_percent, 1)); } else { _row.Cells["p_comp"].Value = string.Format(" {0} %", 0); } _row.Key = string.Format("P-{0}", n.pl_id); _row.AutoHeight(); _row.Height += 2; } fGrid.Cols.AutoWidth(); fGrid.AutoResizeCols = false; fGrid.EndUpdate(); }
private void reEnableAccountToolStripMenuItem_Click(object sender, EventArgs e) { string _str = "Are You Sure You Want To Re-Enable This Income Account ??"; iGRow _row = fGrid.SelectedRows[0]; var _obj = fGrid.SelectedRows[0].Tag as ic.accountC; if (_obj == null) { return; } using (var _fm = new SdaHelperManager.ConfirmWPwd()) { _fm.ShowDialog(); if (_fm.DialogResult != DialogResult.OK) { return; } } if (!dbm.WarningMessage(_str, "Re-Enable Warning")) { return; } using (var xd = new xing()) { xd.SingleUpdateCommandALL("accounts_tb", new string[] { "account_status_id", "account_id" }, new object[] { em.account_statusS.Enabled.ToByte(), _obj.account_id }, 1); _obj.account_status = em.account_statusS.Enabled; xd.CommitTransaction(); sdata.ClearFormCache(em.fm.chart_of_accounts.ToInt16()); sdata.ClearFormCache(em.fm.accounts_balances_manager.ToInt16()); sdata.ClearFormCache(em.fm.analyze_offering_weekly.ToInt16()); sdata.ClearFormCache(em.fm.offering_range_1.ToInt16()); sdata.ClearFormCache(em.fm.sabbath_cash_statement.ToInt16()); sdata.ClearFormCache(em.fm.quarter_cash.ToInt16()); } (this.Owner as IncomeAccountsManager).EditRow(_obj); fGrid.Rows.RemoveAt(fGrid.Rows[_obj.account_id.ToString()].Index); }
private void LoadMainGrid(IEnumerable <ic.cash_transferC> _list) { fGrid.BeginUpdate(); fGrid.Rows.Clear(); if (_list == null) { fGrid.EndUpdate(); return; } iGRow _row = null; ic.accountC _acc = null; foreach (var n in _list) { _row = fGrid.Rows.Add(); _row.ReadOnly = iGBool.True; _row.Font = new Font("georgia", 12, FontStyle.Regular); _row.Cells["date"].Value = n.fs_date.Value.ToMyShortDate(); _acc = datam.DATA_ACCOUNTS[n.source_id]; _row.Cells["from_account"].Value = _acc.account_name; // _acc = datam.DATA_ACCOUNTS[n.destination_id]; _row.Cells["to_account"].Value = _acc.account_name; if (_acc.account_id == -2355) { _row.Cells["to_account"].Value = "LCB"; } // _row.Cells["amount"].Value = n.amount; _row.Cells["amount"].TextAlign = iGContentAlignment.MiddleCenter; _row.Cells["amount"].ForeColor = Color.DarkBlue; // _row.Cells["details"].Value = n.transfer_reason; // _row.Key = n.un_id.ToStringNullable(); _row.Tag = n; _row.AutoHeight(); n.is_updated = false; } fGrid.EndUpdate(); fGrid.Cols.AutoWidth(); fGrid.AutoResizeCols = false; }
private void LoadCategoryGrid() { iGRow _row = null; iGridCategory.BeginUpdate(); foreach (var r in datam.DATA_CG_TYPES.Values) { _row = iGridCategory.Rows.Add(); _row.Cells[0].Col.Width = 290; _row.Cells[1].Col.Width = 22; _row.Font = new Font("verdana", 11, FontStyle.Regular); _row.ForeColor = Color.DarkBlue; _row.AutoHeight(); _row.Height += 1; _row.Tag = r; _row.Cells[0].Value = r.cg_type_name; } iGridCategory.EndUpdate(); }
public void load_items() { fGrid.Rows.Clear(); if (datam.DATA_EXPENSE_ACCOUNTS == null || datam.DATA_EXPENSE_ACCOUNTS.Count == 0) { return; } iGRow _row = null; fGrid.BeginUpdate(); var nlist = from s in datam.DATA_EXPENSE_ACCOUNTS.Values where s.exp_acc_status == em.exp_acc_statusS.valid & s.isActualExpense select s; foreach (var _obj in nlist) { _row = fGrid.Rows.Add(); _row.Font = new Font("georgia", 12, FontStyle.Regular); _row.TextAlign = iGContentAlignment.BottomLeft; _row.ReadOnly = iGBool.True; _row.Cells["exp_name"].Value = _obj.exp_acc_name.ToProperCase(); if (_obj.objCategory != null) { _row.Cells["category"].Value = _obj.objCategory.exp_cat_name; } if (_obj.dept_id > 0 | _obj.dept_id == -5000) { _row.Cells["dept"].Value = datam.DATA_DEPARTMENT[_obj.dept_id].dept_name; } _row.Cells["exp_type"].Value = fnn.GetExpenseTypeName(_obj.exp_acc_type); _row.Cells["exp_type"].AuxValue = _obj.exp_acc_type.ToByte(); _row.Cells["colSearch"].Value = string.Format("{0} {1} {2} {3}", _obj.exp_acc_name.ToLower(), _row.Cells["exp_type"].Text, _row.Cells["dept"].Text, _row.Cells["category"].Text).ToLower();; _row.Tag = _obj; _row.Key = _obj.exp_acc_id.ToStringNullable(); _row.AutoHeight(); _row.Height += 2; } fGrid.Cols.AutoWidth(); fGrid.AutoResizeCols = false; fGrid.EndUpdate(); }
private void ExpandSingle() { if (fGrid.Rows.Count == 0) { return; } iGRow _r = null; fGrid.BeginUpdate(); foreach (var i in OtherGroups) { _r = fGrid.Rows[i]; if (_r.Type == iGRowType.AutoGroupRow & _r.RowTextCell.Text == combofilter.SelectedItem.ToString()) { _r.Expanded = true; } } ResizeGrid(); fGrid.EndUpdate(); }
private void checkBox1_CheckedChanged_1(object sender, EventArgs e) { checkBox1.Text = checkBox1.Checked ? "UnCheck To Show Sub Departments" : "Hide Sub Departments"; foreach (var _grid in new iGrid[] { fGrid, fGridnormal }) { _grid.BeginUpdate(); ic.accountC _acc = null; iGRow _row = null; var _row_list = from _r in _grid.Rows.Cast <iGRow>() where _r.Level == 0 & _r.Cells["has_children"].Value != null select _r; foreach (var k in _row_list) { try { _row = k; _row.Expanded = false; _row.TreeButton = checkBox1.Checked ? iGTreeButtonState.Absent : iGTreeButtonState.Visible; } catch (Exception ex) { continue; } // if ((_row.Index + 1) >= _grid.Rows.Count - 1) { break; } for (int j = (_row.Index + 1); j < _grid.Rows.Count; j++) { if (_grid.Rows[j].Level == _row.Level) { break; } _grid.Rows[j].Visible = checkBox1.Checked ? false : true; } } _grid.EndUpdate(); } }
private void LoadMainGrid() { fGrid.BeginUpdate(); iGRow _row = null; _row = fGrid.Rows.Add(); _row.Height = 4; _row.BackColor = Color.Lavender; _row.Selectable = false; int group_index = 1; string group_name = "New Account Information"; // _row = CreateNewRow("Account Name", "account_name", typeof(string), group_index, group_name); // _row = CreateNewRow("Reconciliation Type", "account_type", typeof(string), group_index, group_name); var icombo = fnn.CreateCombo(); foreach (var t in datam.DATA_ENUM_BANK_RECONCILIATION_TYPES) { icombo.Items.Add(new fnn.iGComboItemEX() { Value = t.Value, ID = t.Key.ToInt16() }); } _row.Cells["desc"].DropDownControl = icombo; _row.Cells["desc"].Value = null; // _row = fGrid.Rows.Add(); _row.Height = 4; _row.BackColor = Color.Lavender; _row.Selectable = false; // fGrid.EndUpdate(); }
private void LoadMainGrid() { iGRow _row = null; if (datam.DATA_CHURCH_GROUPS == null) { return; } if (datam.DATA_CHURCH_GROUPS.Keys.Count == 0) { return; } fGrid.BeginUpdate(); foreach (var obj in datam.DATA_CHURCH_GROUPS.Values) { _row = fGrid.Rows.Add(); _row.Font = new Font("verdana", 10, FontStyle.Bold); _row.Cells["gp_name"].Col.Width = 220; _row.Cells["mem_cnt"].Col.Width = 100; _row.Cells["gp_name"].Value = obj.cg_name; _row.Cells["gp_name"].TextAlign = iGContentAlignment.BottomRight; _row.Cells["mem_cnt"].ValueType = typeof(int); _row.Key = obj.cg_id.ToStringNullable(); _row.AutoHeight(); _row.Cells["type_id"].Value = obj.cg_type_id; _row.Cells["mem_cnt"].Value = obj.MemberCount; _row.Tag = obj; } fGrid.SortObject.Add("type_id"); fGrid.Sort(); fGrid.GroupObject.Add("type_id"); fGrid.Group(); fGrid.Cols.AutoWidth(); fGrid.AutoResizeCols = false; fGrid.PerformAction(iGActions.CollapseAll); if (fGrid.Rows.Count > 0) { fGrid.Rows[0].Expanded = true; } fGrid.EndUpdate(); }