Ejemplo n.º 1
0
 /// <summary>
 /// edit column
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void tsbEdit_Click(object sender, EventArgs e)
 {
     if (this.dgvData.Rows.Count > 0)
     {
         //get selected row in datagrid
         int selectedLineNumber = GetSelectedRowIndex(this.dgvData);
         //if there are no selected rows
         if (selectedLineNumber == -1)
         {
             MessageBox.Show(StringParser.Parse("${res:FanHai.Hemera.Addins.BasicData.BasicSettingsDetail.MsgWetherSelectOneDeletedRow}"));
             return;
         }
         //call window of edit column
         //call the window of add column
         ColumnAddOrEdit columnAddOrEdit = new ColumnAddOrEdit("edit", treeNode.Tag.ToString(), this.dgvData.Rows[selectedLineNumber].Cells[0].Value.ToString());
         //Show Dialog
         columnAddOrEdit.ShowDialog();
         if (columnAddOrEdit.outDataSet.Tables.Count > 0)
         {
             if (columnAddOrEdit.outDataSet.Tables[0].Rows.Count > 0)
             {
                 //update datagridview
                 UpdateDataGridView("edit", columnAddOrEdit.outDataSet);
             }
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// add column
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsbNew_Click(object sender, EventArgs e)
        {
            //call the window of add column
            ColumnAddOrEdit columnAddOrEdit = new ColumnAddOrEdit("add", treeNode.Tag.ToString(), "");

            //Show Dialog
            columnAddOrEdit.ShowDialog();
            //update datagridview
            if (columnAddOrEdit.outDataSet.Tables.Count > 0)
            {
                if (columnAddOrEdit.outDataSet.Tables[0].Rows.Count > 0)
                {
                    UpdateDataGridView("add", columnAddOrEdit.outDataSet);
                }
            }
        }