示例#1
0
        private void btnNovaCausa_Click(object sender, EventArgs e)
        {
            DataRow r;

            r = dtCausa.NewRow();
            r[bsCausas.icampoPrimaryKey] = FbSequence.Generator(bsCausas.igen_id, bsCausas.ifbConnection);
            r["insumo_id"] = (resultadoProcura.linha as DataGridViewRow).Cells["INSUMO_ID"].Value;
            r["insumo"]    = (resultadoProcura.linha as DataGridViewRow).Cells["INSUMO"].Value;
            r["Unid"]      = (resultadoProcura.linha as DataGridViewRow).Cells["UNID"].Value;
            dtCausa.Rows.InsertAt(r, 0);
            bsCausas.EndEdit();

            bsCausas.Find("sgi_material_controlado_id", r[bsCausas.icampoPrimaryKey]);
        }
示例#2
0
 protected override void OnTableNewRow(DataTableNewRowEventArgs e)
 {
     e.Row["CAUSA_CRITERIO_ID"] = FbSequence.Generator("GEN_CAUSA_CRITERIO_ID", ifbcommandSelect.Connection);
     base.OnTableNewRow(e);
 }