public static PackTransaction Add(Guid packID, Pack.StatusX fromStatus, Pack.StatusX toStatus, PackTransaction.TypeX type, string note) { //Always run SOD before new transaction RedBloodSystemBLL.SOD(); RedBloodDataContext db = new RedBloodDataContext(); if (fromStatus == toStatus) { throw new Exception("Can not add pack transaction if not change pack status."); } PackTransaction e = new PackTransaction(); e.FromStatus = fromStatus; e.ToStatus = toStatus; e.PackID = packID; e.Type = type; e.Actor = RedBloodSystem.CurrentActor; e.Note = note.Trim(); db.PackTransactions.InsertOnSubmit(e); db.SubmitChanges(); return(e); }
void Application_Start(object sender, EventArgs e) { // Code that runs on application startup RedBloodSystemBLL.SOD(); }