示例#1
0
        public bool CreateTransaction(T_Transaction transaction, long idBug, long idUser)
        {
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
            {
                transaction.T_Bug.id = idBug;
                transaction.T_User.id = idUser;
                bugtrack.AddToT_Transaction(transaction);
                bugtrack.SaveChanges();

                var test = from b in bugtrack.T_Transaction
                           where b.id == transaction.id
                           select b;

                return (test.Count() > 0);
            }
        }
示例#2
0
        public bool UpdateTransaction(T_Transaction transaction)
        {
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
            {
                T_Transaction trans = bugtrack.T_Transaction.Where(t => t.id == transaction.id).FirstOrDefault();

                if (trans != null)
                {
                    trans = transaction;
                    bugtrack.SaveChanges();
                    return true;
                }
                else
                {
                    return false;
                }

            }
        }
示例#3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the T_Transaction EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToT_Transaction(T_Transaction t_Transaction)
 {
     base.AddObject("T_Transaction", t_Transaction);
 }
示例#4
0
 /// <summary>
 /// Create a new T_Transaction object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="statut">Initial value of the statut property.</param>
 public static T_Transaction CreateT_Transaction(global::System.Int64 id, global::System.Int32 statut)
 {
     T_Transaction t_Transaction = new T_Transaction();
     t_Transaction.id = id;
     t_Transaction.statut = statut;
     return t_Transaction;
 }