Example #1
0
 public void AutoExecute()
 {
     CodeTrackFactory.Level = CodeTrackLevel.All;
     using (CodeTrackFactory.TrackReport("AutoExecute", CodeTrackLevel.Bussiness, null, "EFCore", "BeetleX"))
     {
         using (NorthwindContext db = new NorthwindContext())
         {
             DBValueList <string>        values = (db, "select customerid from customers");
             DBObjectList <CustomerName> items  = (db, "select CustomerID,CompanyName from customers");
             DBExecute <string>          id     = (db, "select CompanyName from customers where CustomerID='ALFKI'");
             DBExecute execute = (db, "delete from customers", " delete from orders");
         }
     }
     this.Console.WriteLine(CodeTrackFactory.Activity?.GetReport());
 }
Example #2
0
        public void DataBase()
        {
            var dataSouce = @"C:\Code\Automation\MiddlewareTests\Tests\TestCaseData\SLT1.json";

            _.FetchTestData(dataSouce, "SLT1ValidateRetrieveApplication", "1");
            var connectionString = new DBExecute(_.Environment["DbConnUnsecured"]);
            var result           = connectionString.ExecuteQuery(_.TestData["DbQuery"]);

            Assert.IsTrue(result != null);
            var result2 = connectionString.ExecuteQuery(_.TestData["DbQuery"]);

            Assert.IsTrue(result2 != null);
            connectionString.CloseDB();
            Assert.IsTrue(result != null);
        }
Example #3
0
        public int BackUp(string Name)
        {
            var DBBackupPath = ConfigurationManager.AppSettings["DBBackupPath"];

            var fileName = string.Format("{0}_{1}.bak", Name, DateTime.Now.ToFileTime());
            var filePath = string.Format("{0}\\{1}", DBBackupPath, fileName);

            var backSql = string.Format(@"
                Backup database [5.0]
                To disk='{1}'
                With Copy_only", Name, filePath);

            var connectionString = ConfigurationManager.ConnectionStrings[Name].ConnectionString;

            DBExecute.ExecuteNonQuery(connectionString, backSql);

            FileInfo fi = new FileInfo(filePath);

            return(_IImageGetter.Add(fi));
        }
Example #4
0
 public PageBLL()
 {
     _db = new SQLExecute();
 }
 public ProductBLL()
 {
     _db = new SQLExecute();
 }
 public OrderBLL()
 {
     _db = new SQLExecute();
 }
 public CustomerBLL()
 {
     _db = new SQLExecute();
 }
Example #8
0
 public Brand_ProductBLL()
 {
     _db = new SQLExecute();
 }
Example #9
0
 public NewsBLL()
 {
     _db = new SQLExecute();
 }
Example #10
0
        public static ArrayList executeQuery(string sql)
        {
            DBExecute exec = DBExecFactory.GetInstance().getExecuteor();

            return(exec.Query(sql));
        }
Example #11
0
        public static void executeNonQuery(string sql)
        {
            DBExecute exec = DBExecFactory.GetInstance().getExecuteor();

            exec.Execute(sql);
        }
Example #12
0
 public BrandBLL()
 {
     _db = new SQLExecute();
 }
Example #13
0
 public CategoryBLL()
 {
     _db = new SQLExecute();
 }
 public PaymenMethodsBLL()
 {
     _db = new SQLExecute();
 }