partial void DeleteInfoProd(InfoProd instance);
partial void InsertInfoProd(InfoProd instance);
partial void UpdateInfoProd(InfoProd instance);
public void InsertInfoProd(String NomProduit, int NBPart, int ValNom) { var val = (from nam in myDbdc.InfoProd select nam).ToArray(); if (val.Length == 0) { InfoProd inf = new InfoProd { NomProd = NomProduit, NbPartAchetes = NBPart.ToString(), ValNominale = ValNom.ToString() }; myDbdc.InfoProd.InsertOnSubmit(inf); } else { foreach (InfoProd inf in val) { inf.NomProd = NomProduit; inf.NbPartAchetes = NBPart.ToString(); inf.ValNominale = ValNom.ToString(); } } try { myDbdc.SubmitChanges(); } catch (Exception e) { Console.WriteLine(e); // Provide for exceptions. } }