private void nav_TBarClick(object sender, ToolBarButtonClickEventArgs e) { if (e.Button.Equals(nav.cmd_save)) { try { TextBoxAndVS.D_GetDataFromTextBox(groupBox1, vs); if ((int)vs.Rows[vs.Row].UserData != 2) { vs.Rows[vs.Row].UserData = 1; } nav.ToolBar_Click(e); return; } catch (Exception) {} } if (e.Button.Equals(nav.cmd_refresh)) { nav.ToolBar_Click(e); show_data(); return; } if (e.Button.Equals(nav.cmd_delete)) { nav.DeleteRow(vs.Row); return; } nav.ToolBar_Click(e); }
private void nav_TBarClick(object sender, ToolBarButtonClickEventArgs e) { if (e.Button.Equals(nav.cmd_add)) { frmTaAddColPayroll dlg = new frmTaAddColPayroll(); if (dlg.ShowDialog() == DialogResult.OK) { nav.Show_VS("1=1 order by SEQ_NO"); } return; } if (e.Button.Equals(nav.cmd_delete)) { if (vs.Rows[vs.Row]["LCK_BT"] + "" == "True") { MessageBox.Show(PublicFunction.L_Get_Msg("msg", 178)); return; } if (MessageBox.Show(this, PublicFunction.L_Get_Msg("msg", 92) + " [" + vs.Rows[vs.Row]["COL_NM"] + "]?", this.Text, MessageBoxButtons.YesNo) == DialogResult.Yes) { if (MessageBox.Show(this, PublicFunction.L_Get_Msg("msg", 93) + "", this.Text, MessageBoxButtons.YesNo) == DialogResult.Yes) { string sCol = vs.Rows[vs.Row]["COL_NM"].ToString(); if (nav.DeleteRow(vs.Row, false)) { try { DropColumn("FILD02A", sCol); DropColumn("FILD03A", sCol); DropColumn("FILA19A", sCol); } catch (SqlException ex) { MessageBox.Show(ex.Message); } } } } return; } if (e.Button.Equals(nav.cmd_save)) { for (int i = 1; i < vs.Rows.Count; i++) { vs.Rows[i]["SEQ_NO"] = i; vs.Rows[i].UserData = 1; } } nav.ToolBar_Click(e); }
private void nav_TBarClick(object sender, ToolBarButtonClickEventArgs e) { if (e.Button.Equals(nav.cmd_add)) { if (vs.Rows.Count >= 2) { return; } if (vs.Rows.Count == 1 || (int)vs.Rows[vs.Rows.Count - 1].UserData != 2) { nav.ToolBar_Click(e); } TextBoxAndVS.D_AddNewOrEdit(groupBox1, false); vs.Rows[vs.Rows.Count - 1]["ACT_BT"] = 1; textBox1.Text = T_String.GetMax("MAX(COM_ID)", "FILA01A") + ""; return; } if (e.Button.Equals(nav.cmd_save)) { try { TextBoxAndVS.D_GetDataFromTextBox(groupBox1, vs); if ((int)vs.Rows[vs.Row].UserData != 2) { vs.Rows[vs.Row].UserData = 1; } nav.ToolBar_Click(e); return; } catch (Exception) {} } if (e.Button.Equals(nav.cmd_refresh)) { nav.ToolBar_Click(e); show_data(); return; } if (e.Button.Equals(nav.cmd_delete)) { nav.DeleteRow(vs.Row); return; } nav.ToolBar_Click(e); }
private void nav_TBarClick(object sender, ToolBarButtonClickEventArgs e) { if (e.Button.Equals(nav.cmd_add)) { if (vs.Rows.Count == 1 || (int)vs.Rows[vs.Rows.Count - 1].UserData != 2) { nav.ToolBar_Click(e); } TextBoxAndVS.D_AddNewOrEdit(groupBox1, false); return; } if (e.Button.Equals(nav.cmd_save)) { try { TextBoxAndVS.D_GetDataFromTextBox(groupBox1, vs); if ((int)vs.Rows[vs.Row].UserData != 2) { vs.Rows[vs.Row].UserData = 1; } else { vs.Rows[vs.Row]["RPT_ID"] = T_String.GetMax("MAX(RPT_ID)", "FILE07A") + ""; vs2.Rows.Count++; int row = vs2.Rows.Count - 1; vs2.Rows[row].UserData = 2; vs2.Rows[row][0] = row; vs2.Rows[row]["SEQ_NO"] = row.ToString("000"); vs2.Rows[row]["RPT_ID"] = vs.Rows[vs.Row]["RPT_ID"]; vs2.Rows[row]["COL_ID"] = "EMP_ID"; vs2.Rows[row]["COL_NM"] = "WID"; vs2.Rows[row]["TAB_DR"] = "FILB01A"; vs2.Rows[row]["SHO_BT"] = 1; vs2.Rows[row]["WID_VL"] = 80; nav2.SaveRow(row); vs2.Rows.Count++; row = vs2.Rows.Count - 1; vs2.Rows[row].UserData = 2; vs2.Rows[row][0] = row; vs2.Rows[row]["SEQ_NO"] = row.ToString("000"); vs2.Rows[row]["RPT_ID"] = vs.Rows[vs.Row]["RPT_ID"]; vs2.Rows[row]["COL_ID"] = "EMP_NM"; vs2.Rows[row]["COL_NM"] = "Name"; vs2.Rows[row]["TAB_DR"] = "FILB01A"; vs2.Rows[row]["SHO_BT"] = 1; vs2.Rows[row]["WID_VL"] = 80; nav2.SaveRow(row); vs2.AutoSizeCols(); } nav.ToolBar_Click(e); return; } catch (Exception) {} } if (e.Button.Equals(nav.cmd_refresh)) { nav.ToolBar_Click(e); show_data(); return; } if (e.Button.Equals(nav.cmd_delete)) { nav.DeleteRow(vs.Row); return; } nav.ToolBar_Click(e); }