public int AddBon(long SerialNumber) { COM.Bon bon = new COM.Bon() { SerialNumber = SerialNumber }; int result = BLL.Bon.AddBon(bon); return(result); }
public static int AddBon(COM.Bon bon) { try { using (var ent = DB.Entity) { ent.Bons.Add(bon); ent.SaveChanges(); return(bon.BID); } } catch (Exception e) { Log.DoLog(COM.Action.AddBonSerial, bon.SerialNumber.ToString(), -100, e.Message); return(-100); } }