private void CargarDatos(Int32 CodComision) { Clases.cFunciones fun = new Clases.cFunciones(); Clases.cComisionVendedor com = new Clases.cComisionVendedor(); DataTable trdo = com.GetComisionesxCodigo(CodComision); if (trdo.Rows.Count > 0) { txtNombre.Text = trdo.Rows[0]["Nombre"].ToString(); txtApellido.Text = trdo.Rows[0]["Apellido"].ToString(); txtPatente.Text = trdo.Rows[0]["Patente"].ToString(); txtImporte.Text = trdo.Rows[0]["Importe"].ToString(); if (trdo.Rows[0]["FechaPago"].ToString() != "") { DateTime fecha = Convert.ToDateTime(trdo.Rows[0]["FechaPago"].ToString()); txtFecha.Text = fecha.ToShortDateString(); } txtImporte.Text = fun.SepararDecimales(txtImporte.Text); txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text); if (trdo.Rows[0]["FechaPago"].ToString() == "") { btnAnular.Enabled = false; btnGrabar.Enabled = true; } else { btnAnular.Enabled = true; btnGrabar.Enabled = false; } } }