private void dgvList_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e) { if (e.StateChanged != DataGridViewElementStates.Selected) { return; } if (dgvList.SelectedRows.Count != 0) { try { DataGridViewRow row = this.dgvList.SelectedRows[0]; one = (CnfCotizacion)row.DataBoundItem; } catch (Exception ex) { //MessageBox.Show(ex.Message); MetroFramework.MetroMessageBox.Show(this.MdiParent, ex.Message, "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning); } btnEdit.Visible = true; } else { btnEdit.Visible = false; } }
private void btnAdd_Click(object sender, EventArgs e) { CnfCotizacion _one = new CnfCotizacion(); _one = srv.GetOne(Globals.logEmpresa.id, "0"); frmCnfCotizacionesDetail fDetalle = new frmCnfCotizacionesDetail(_one); if (ConfigUI.LaunchDialogForm(fDetalle) == DialogResult.OK) { GetList(); MetroFramework.MetroMessageBox.Show(this.MdiParent, "Registro agregado con éxito", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public frmCnfCotizacionesDetail(CnfCotizacion obj) { InitializeComponent(); one = obj; //lblTitle.Text = obj.nombre; CrearBindings(); //DETALLE _listaDetalle = srv.GetListDetail(one.id); bList = new BindingList <CnfCotizacionDetalle>(_listaDetalle); bs.DataSource = bList; dgvList.DataSource = bs; ConfigGrid(); if (bList.Count > 0) { btnAdd.Visible = false; } }
public string SetOne(CnfCotizacion one, List <CnfCotizacionDetalle> detail) { string _id = srv.SetOne(one, detail); return(_id); }
public CnfCotizacion GetOne(string idEmpresa, string id) { CnfCotizacion _one = srv.GetOne(idEmpresa, id); return(_one); }