Пример #1
0
 public bool Delete()
 {
     DbAccess db = new DbAccess();
     db.BeginTransaction();
     try
     {
         db.CreateNewSqlCommand();
         db.AddParameter("@ID", ID);
         db.ExecuteNonQueryWithTransaction("NW_Teamview_Delete");
         db.CommitTransaction();
         return true;
     }
     catch
     {
         db.RollbackTransaction();
         return false;
     }
 }
Пример #2
0
        public bool Delete()
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                db.CreateNewSqlCommand();
                db.AddParameter("@ID", ID);
                db.ExecuteNonQueryWithTransaction("NW_Teamview_Delete");
                db.CommitTransaction();
                return(true);
            }
            catch
            {
                db.RollbackTransaction();
                return(false);
            }
        }
Пример #3
0
 public bool Insert()
 {
     DbAccess db = new DbAccess();
     db.BeginTransaction();
     try
     {
         db.CreateNewSqlCommand();
         db.AddParameter("@ID", ID);
         db.AddParameter("@Pass", Pass);
         db.AddParameter("@User", User);
         db.AddParameter("@PC", PC);
         db.AddParameter("@DateTime", DateTime);
         db.AddParameter("@Location", Location);
         db.ExecuteNonQueryWithTransaction("NW_Teamview_Insert");
         db.CommitTransaction();
         return true;
     }
     catch
     {
         db.RollbackTransaction();
         return false;
     }
 }
Пример #4
0
        public bool Insert()
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                db.CreateNewSqlCommand();
                db.AddParameter("@ID", ID);
                db.AddParameter("@Pass", Pass);
                db.AddParameter("@User", User);
                db.AddParameter("@PC", PC);
                db.AddParameter("@DateTime", DateTime);
                db.AddParameter("@Location", Location);
                db.ExecuteNonQueryWithTransaction("NW_Teamview_Insert");
                db.CommitTransaction();
                return(true);
            }
            catch
            {
                db.RollbackTransaction();
                return(false);
            }
        }