private void popupbtn_Click(object sender, EventArgs e) { DataTable dt = SubGroup.ViewSubGroup(); ArrayList arr = GetSelectedItem.ItemSelect( dt, new int[] { 1 }, new int[] { 0 }); if (arr == null) { return; } string tacc_code = arr[0].ToString(); DataTable dts = SubGroup.GetSubGroup(tacc_code); if (dts.Rows.Count == 0) { GUIutils.ShowMessage("Account code doesnt exist"); return; } DataRow dr = dts.Rows[0]; this.AccCodetxt.Text = dr["S_CODE"].ToString(); this.AccDestxt.Text = dr["S_DESC"].ToString(); string sname = dr["S_TYPE"].ToString(); string s_type = ""; DataTable dtt = Group.ListGroup(); foreach (DataRow rw in dtt.Rows) { if (sname == rw[0].ToString()) { s_type = rw[1].ToString().ToUpper(); break; } } this.AccTypeCombo.SelectedItem = s_type; this.AccTypeCombo.Refresh(); /*if (s_type == "A") * { * this.AccTypeCombo.SelectedItem = "ASSET"; * } * else if (s_type == "L") * { * this.AccTypeCombo.SelectedItem = "LIABILITY"; * } * else if (s_type == "E") * { * this.AccTypeCombo.SelectedItem = "EXPENSE"; * } * else if (s_type == "I") * { * this.AccTypeCombo.SelectedItem = "INCOME"; * }*/ this.OPBALTXT.Text = dr["S_OPBAL"].ToString(); this.DRCRCombo.SelectedItem = dr["S_DRCR"].ToString(); }
/// <summary> /// Populating the datagrid and /// retrieving the next journal /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void JournalAdd_Load(object sender, EventArgs e) { DataTable dt = SubGroup.ViewSubGroup(); /////////////////////////////////// //// Account name DataGridViewComboBoxColumn cw = new DataGridViewComboBoxColumn(); cw.DataSource = dt; cw.DisplayMember = "S_DESC"; cw.HeaderText = "ACCOUNT NAME"; this.JournalGridView.Columns.Add(cw); /////////////////////////////////////// ////// debit or Credit ////// DataTable myDataTable = new DataTable(); DataColumn myDataColumn; myDataColumn = new DataColumn(); myDataColumn.DataType = System.Type.GetType("System.String"); myDataColumn.ColumnName = "Account"; myDataColumn.ReadOnly = false; myDataColumn.Unique = true; myDataTable.Columns.Add(myDataColumn); DataRow dr = myDataTable.NewRow(); dr["Account"] = "DR"; myDataTable.Rows.Add(dr); myDataTable.AcceptChanges(); dr = myDataTable.NewRow(); dr["Account"] = "CR"; myDataTable.Rows.Add(dr); myDataTable.AcceptChanges(); cw = new DataGridViewComboBoxColumn(); cw.DataSource = myDataTable; cw.DisplayMember = "Account"; this.JournalGridView.Columns.Add(cw); ////////////////////////////////////// //// Amount Column //// DataGridViewTextBoxColumn ct = new DataGridViewTextBoxColumn(); this.JournalGridView.Columns.Add(ct); /////////////////////////////////////// ///// Retrieve next journal id ///// int rst = JournalPoster.NextJournal(); this.journalidtxt.Text = rst.ToString(); }
private void Choosebtn_Click(object sender, EventArgs e) { DataTable dt = SubGroup.ViewSubGroup(); ArrayList arr = GetSelectedItem.ItemSelect( dt, new int[] { 1 }, new int[] { 0, 1 }); if (arr == null) { return; } _acc_code = arr[0].ToString(); acctxt.Text = _acc_code; _acc_string = arr[1].ToString(); }
private void AddSap_Load(object sender, EventArgs e) { DataTable dt = SubGroup.ViewSubGroup(); DataGridViewComboBoxColumn cb = new DataGridViewComboBoxColumn(); cb.DataSource = dt; cb.HeaderText = "Account Name"; cb.DisplayMember = "S_DESC"; JournalGridView1.Columns.Add(cb); DataTable mytable = new DataTable(); DataColumn mycolumn = new DataColumn(); mycolumn.DataType = System.Type.GetType("System.String"); mycolumn.ReadOnly = false; mycolumn.Unique = true; mycolumn.ColumnName = "Account"; mytable.Columns.Add(mycolumn); DataRow dr = mytable.NewRow(); dr["Account"] = "DR"; mytable.Rows.Add(dr); mytable.AcceptChanges(); dr = mytable.NewRow(); dr["Account"] = "CR"; mytable.Rows.Add(dr); mytable.AcceptChanges(); cb = new DataGridViewComboBoxColumn(); cb.DisplayMember = "Account"; cb.DataSource = mytable; cb.HeaderText = "Debit/Credit"; JournalGridView1.Columns.Add(cb); DataGridViewTextBoxColumn tc = new DataGridViewTextBoxColumn(); tc.HeaderText = "Amount"; JournalGridView1.Columns.Add(tc); }
private void Report2() { CHTMLDocument ds = new CHTMLDocument(); CHTMLText txt = new CHTMLText("Chart Of Accounts"); txt.setItalic(true); CHTMLHorizontalRule hr = new CHTMLHorizontalRule(); CHTMLInput input = new CHTMLInput(); // // // CHTMLTable table = new CHTMLTable(); table.setBorder(1); table.setCaption(new CHTMLText("Chart Of Accounts")); CHTMLTableRow row = null; row = new CHTMLTableRow(); CHTMLTableCell cell = null; cell = new CHTMLTableCell(alignment.HEADING); cell.addObject(new CHTMLText(" Code ")); row.addObject(cell); cell = new CHTMLTableCell(alignment.HEADING); cell.addObject(new CHTMLText(" Name ")); row.addObject(cell); row.backgroundColor = "red"; table.addObject(row); DataTable dt = SubGroup.ViewSubGroup(); foreach (DataRow dr in dt.Rows) { row = new CHTMLTableRow(); cell = new CHTMLTableCell(alignment.HEADING); cell.addObject(new CHTMLText(dr["S_CODE"].ToString())); row.addObject(cell); cell = new CHTMLTableCell(alignment.HEADING); cell.addObject(new CHTMLText(dr["S_DESC"].ToString())); row.addObject(cell); table.addObject(row); } ds.addObject(table); string rs = ds.toHTML(); FileStream fs = new FileStream(@"C:\temp\a.html", FileMode.Create); StreamWriter st = new StreamWriter(fs); st.Write(rs); st.Close(); webBrowser1.Navigate(new Uri(@"file://c:\temp\a.html")); webBrowser1.Refresh(); }