Ejemplo n.º 1
0
        private void btnEmployeesEditRow_Click(object sender, System.EventArgs e)
        {
            DataRow row = SelectedRow(DataGrid1);

            if (row != null)
            {
                string sEmployeeID = row["EmployeeID", DataRowVersion.Current].ToString();

                if (sEmployeeID != string.Empty)
                {
                    EmployeesEdit empEdit = new EmployeesEdit(Convert.ToInt32(sEmployeeID));
                    DialogResult  result  = empEdit.ShowDialog();
                    if (result == DialogResult.OK)
                    {
                        // Employees Grid
                        emps = new Employees();
                        emps.Query.Load();
                        this.DataGrid1.DataSource = emps.DefaultView;
                    }
                }
            }
        }
Ejemplo n.º 2
0
		private void btnEmployeesEditRow_Click(object sender, System.EventArgs e)
		{
			DataRow row = SelectedRow(DataGrid1);
			if ( row != null)
			{
				string sEmployeeID = row["EmployeeID", DataRowVersion.Current].ToString();

				if(sEmployeeID != string.Empty)
				{
					EmployeesEdit empEdit = new EmployeesEdit(Convert.ToInt32(sEmployeeID));
					DialogResult result = empEdit.ShowDialog();
					if(result == DialogResult.OK)
					{
						// Employees Grid
						emps = new Employees();
						emps.Query.Load();
						this.DataGrid1.DataSource = emps.DefaultView;
					}
				}
			}
		}