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(); }