public void Test_InsertAppName()
        {
            //Arrange
            WisAppList wisAppList = new WisAppList
            {
                AppID          = "TESTAPPID",
                AppName        = "TEST",
                Development    = "TEST",
                LastUpdateUser = "",
                LastUpdateDT   = DateTime.Now,
                CreateDT       = DateTime.Now,
                CompanyApp     = true,
            };

            List <WisAppUserList> wisAppUserList = new List <WisAppUserList>
            {
                new WisAppUserList {
                    AppID = "TESTAPPID", UserID = "TESTUSERID"
                }
            };

            //Act
            _targetObj.InsertAppName(wisAppList, wisAppUserList);

            IConnectionProvider connectionProvider = new SqlConnectionProvider(_configContext.McpDb);

            //做完後必須刪除假資料
            using (McpDataBaseRepository mcpDataBaseRepository = new McpDataBaseRepository(connectionProvider))
            {
                mcpDataBaseRepository.WisAppListTable.Delete("TESTAPPID");
                mcpDataBaseRepository.WisAppUserListTable.DeleteByAppID("TESTAPPID");
                mcpDataBaseRepository.Commit();
            }
        }
Beispiel #2
0
 public void DeletePhotosByAppIDAndOsType(string appID, int osTpye)
 {
     using (IMcpDataBaseRepository Db = new McpDataBaseRepository(_connectionProvider))
     {
         Db.WisAppPhotoTable.DeleteAppPhotoByAppID(appID, osTpye);
         Db.Commit();
     }
 }
Beispiel #3
0
 public void InsertSecurityUserAccount(SecurityUserAccount securityUserAccount)
 {
     using (IMcpDataBaseRepository Db = new McpDataBaseRepository(_connectionProvider))
     {
         Db.SecurityUserAccountTable.Insert(securityUserAccount);
         Db.Commit();
     }
 }
Beispiel #4
0
 public void InsertPhotosByOsType(List <WisAppPhoto> wisAppPhotos)
 {
     using (IMcpDataBaseRepository Db = new McpDataBaseRepository(_connectionProvider))
     {
         Db.WisAppPhotoTable.InsertAppPhoto(wisAppPhotos);
         Db.Commit();
     }
 }
Beispiel #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="appID"></param>
        /// <returns></returns>
        public bool DeleteApp(string appID)
        {
            bool deleted = false;

            using (IMcpDataBaseRepository Db = new McpDataBaseRepository(_connectionProvider))
            {
                deleted = Db.WisAppListTable.DeleteAppByAppId(appID);
                Db.Commit();
            }
            return(deleted);
        }
Beispiel #6
0
        public bool EnableOrDisableApp(string appOSID, string status)
        {
            bool updated = false;

            using (IMcpDataBaseRepository Db = new McpDataBaseRepository(_connectionProvider))
            {
                updated = Db.WisAppOsTable.EnableOrDisableApp(appOSID, status);
                Db.Commit();
            }
            return(updated);
        }
        public bool DeleteAppFilePath(string appOsId)
        {
            bool deleted = false;

            using (IMcpDataBaseRepository Db = new McpDataBaseRepository(_connectionProvider))
            {
                deleted = Db.WisAppOsTable.DeleteFilePathByAppOsId(appOsId);
                Db.Commit();
            }
            return(deleted);
        }
Beispiel #8
0
        public bool InsertAppOs(WisAppOs wisAppOs)
        {
            bool inserted = false;

            using (IMcpDataBaseRepository Db = new McpDataBaseRepository(_connectionProvider))
            {
                Db.WisAppOsTable.Insert(wisAppOs);
                Db.Commit();
                inserted = true;
            }
            return(inserted);
        }
Beispiel #9
0
        public bool DeleteAppFileMultiple(string appID, string appOsId)
        {
            bool deleted = false;

            using (IMcpDataBaseRepository Db = new McpDataBaseRepository(_connectionProvider))
            {
                Db.WisAppOsOtherTable.DeleteAppOsOther(appID, appOsId);
                Db.Commit();
                deleted = true;
            }
            return(deleted);
        }
Beispiel #10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="wisAppList"></param>
        /// <param name="wisAppUserList">更新授權名單 清單</param>
        /// <returns></returns>
        public bool ModifyAppName(WisAppList wisAppList, List <WisAppUserList> wisAppUserList)
        {
            bool isModified;

            using (IMcpDataBaseRepository Db = new McpDataBaseRepository(_connectionProvider))
            {
                isModified = Db.WisAppListTable.Update(wisAppList);
                Db.WisAppUserListTable.DeleteByAppID(wisAppList.AppID);
                Db.WisAppUserListTable.Insert(wisAppUserList);
                Db.Commit();
            }
            return(isModified);
        }
        public bool InsertAppName(WisAppList wisAppList, List <WisAppUserList> wisAppUserList)
        {
            bool inserted = false;

            using (IMcpDataBaseRepository Db = new McpDataBaseRepository(_connectionProvider))
            {
                inserted = Db.WisAppListTable.Insert(wisAppList);
                Db.WisAppUserListTable.DeleteByAppID(wisAppList.AppID);
                Db.WisAppUserListTable.Insert(wisAppUserList);
                Db.Commit();
                inserted = true;
            }
            return(inserted);
        }
        public bool DisableAppOsStatusAndInsertAppOsAndPhotoAndOsOther(WisAppOs wisAppOs, List <WisAppPhoto> wisAppPhotos, List <WisAppOsOther> wisAppOsOthers)
        {
            bool inserted = false;

            using (IMcpDataBaseRepository Db = new McpDataBaseRepository(_connectionProvider))
            {
                Db.WisAppOsTable.DisabledAppOsStatus(wisAppOs.AppID, wisAppOs.OSType);
                int getAppOsID = Db.WisAppOsTable.Insert(wisAppOs);
                Db.WisAppPhotoTable.DeleteAppPhotoByAppID(wisAppOs.AppID, wisAppOs.OSType);
                Db.WisAppPhotoTable.InsertAppPhoto(wisAppPhotos);
                //多載點新增
                wisAppOsOthers.ForEach(p => p.AppOsID = getAppOsID);
                Db.WisAppOsOtherTable.InsertAppOsOther(wisAppOsOthers);
                Db.Commit();
                inserted = true;
            }
            return(inserted);
        }
Beispiel #13
0
        public bool DisableAppOsStatusAndModifyAppOsAndPhotoAndOsOther(WisAppOs wisAppOs, List <WisAppPhoto> wisAppPhotos, List <WisAppOsOther> wisAppOsOthers)
        {
            bool isModify = false;

            using (IMcpDataBaseRepository Db = new McpDataBaseRepository(_connectionProvider))
            {
                Db.WisAppOsTable.DisabledAppOsStatus(wisAppOs.AppID, wisAppOs.OSType);
                isModify = Db.WisAppOsTable.Update(wisAppOs);
                Db.WisAppPhotoTable.DeleteAppPhotoByAppID(wisAppOs.AppID, wisAppOs.OSType);
                Db.WisAppPhotoTable.InsertAppPhoto(wisAppPhotos);

                //多載點更新
                Db.WisAppOsOtherTable.DeleteAppOsOther(wisAppOs.AppID, wisAppOs.AppOSID.ToString());
                Db.WisAppOsOtherTable.InsertAppOsOther(wisAppOsOthers);

                Db.Commit();
            }
            return(isModify);
        }
        public void Test_InsertAppOs()
        {
            //Arrange
            WisAppOs wisAppOs = new WisAppOs
            {
                AppID            = "TESTAPPID",
                OSType           = 1,
                Version          = "TEST",
                PackageName      = "TEST",
                Status           = true,
                MultipleDownload = false
            };

            //Act
            _targetObj.InsertAppOs(wisAppOs);

            IConnectionProvider connectionProvider = new SqlConnectionProvider(_configContext.McpDb);

            using (McpDataBaseRepository mcpDataBaseRepository = new McpDataBaseRepository(connectionProvider))
            {
                mcpDataBaseRepository.WisAppOsTable.DeleteAppOs("TESTAPPID");
                mcpDataBaseRepository.Commit();
            }
        }