public int AddDIPENDENTI(int D_ID, int A_ID, string D_NOMECOGN) { int rowsAffected = 0; if (D_ID <= 0) { D_ID = GetLastID() + 1; } maddant.src.DAL.dsmaddant.DIPENDENTIDataTable TDIPENDENTI = new maddant.src.DAL.dsmaddant.DIPENDENTIDataTable(); maddant.src.DAL.dsmaddant.DIPENDENTIRow ObjRow = TDIPENDENTI.NewDIPENDENTIRow(); { var withBlock = ObjRow; withBlock.D_ID = D_ID; withBlock.A_ID = A_ID; withBlock.D_NOMECOGN = D_NOMECOGN; } TDIPENDENTI.AddDIPENDENTIRow(ObjRow); try { rowsAffected = Adapter.Update(TDIPENDENTI); } catch (Exception ex) { Utils.RaiseBllError(ex.Message); } return(D_ID); }
public int DelDIPENDENTIByID(int Original_D_ID ) { maddant.src.DAL.dsmaddant.DIPENDENTIDataTable DTDIPENDENTI = Adapter.GetDIPENDENTIByID(Original_D_ID); if (DTDIPENDENTI.Count == 0) { // nessun risultato, ritorno false Utils.RaiseBllError(Utils.NON_TROVATO); } maddant.src.DAL.dsmaddant.DIPENDENTIRow ObjRow = DTDIPENDENTI[0]; int rowsAffected; try { rowsAffected = Adapter.Delete(Original_D_ID); } catch (Exception ex) { Utils.RaiseBllError(ex.Message); } return(0); }