private void tb_fec_cha_ValueChanged(object sender, EventArgs e) { try { if (cb_mon_eda.SelectedIndex == 0) { tb_tip_cam.Text = "1.00"; } else { c_adm013 objTipo = new c_adm013(); DataTable dtTipo = objTipo._05(tb_fec_cha.Value.ToShortDateString()); if (dtTipo.Rows.Count == 0) { tb_tip_cam.Text = "0.00"; MessageBox.Show("Fecha Seleccionada sin Tipo de Cambio", "Error"); } else { tb_tip_cam.Text = ((DataRow)dtTipo.Rows[0])["va_val_bus"].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } }
public string fu_ver_dat() { if (DateTime.TryParse(tb_fec_tcm.Text, out Dtemp) == false) { tb_fec_tcm.Focus(); return("La fecha es invalida"); } decimal temp; if (decimal.TryParse(tb_val_tcm.Text, out temp) == false) { tb_val_tcm.Focus(); return("Dato no valido, el T.C. debe ser numerico"); } if (Convert.ToDecimal(tb_val_tcm.Text) > 10) { return("Dato no valido, el T.C. debe ser menor que 10"); } tab_adm013 = o_adm013._05(tb_fec_tcm.Text); if (tab_adm013.Rows.Count != 0) { //--** si esa fecha ya tiene valor vv_ban_tcm = 1; } else { //--** si esa fecha aun no tiene valor vv_ban_tcm = 0; } return(null); }