/// <summary>
 /// Initializes a new instance of the <see cref="InstanceController"/> class
 /// </summary>
 /// <param name="authorizationService">The authorizationService (set in Startup.cs)</param>
 /// <param name="logger">The logger (set in Startup.cs)</param>
 /// <param name="profileService">The profile service (set in Startup.cs)</param>
 /// <param name="registerService">The registerService (set in Startup.cs)</param>
 /// <param name="erService">The erService (set in Startup.cs)</param>
 /// <param name="formService">The form</param>
 /// <param name="repositoryService">The repository service (set in Startup.cs)</param>
 /// <param name="serviceExecutionService">The serviceExecutionService (set in Startup.cs)</param>
 /// <param name="archiveService">The archive service</param>
 /// <param name="httpContextAccessor">The http context accessor</param>
 /// <param name="testDataService">the test data service handler</param>
 /// <param name="workflowSI">the workflow service handler</param>
 /// <param name="instanceSI">the instance service handler</param>
 /// <param name="platformSI">the platform service handler</param>
 public InstanceController(
     IAuthorization authorizationService,
     ILogger <InstanceController> logger,
     IProfile profileService,
     IRegister registerService,
     IER erService,
     IForm formService,
     IRepository repositoryService,
     IExecution serviceExecutionService,
     IArchive archiveService,
     ITestdata testDataService,
     IHttpContextAccessor httpContextAccessor,
     IWorkflowSI workflowSI,
     IInstance instanceSI,
     IPlatformServices platformSI)
 {
     _authorization       = authorizationService;
     _logger              = logger;
     _profile             = profileService;
     _register            = registerService;
     _er                  = erService;
     _form                = formService;
     _repository          = repositoryService;
     _execution           = serviceExecutionService;
     _userHelper          = new UserHelper(profileService, _register);
     _archive             = archiveService;
     _testdata            = testDataService;
     _httpContextAccessor = httpContextAccessor;
     _workflowSI          = workflowSI;
     _instance            = instanceSI;
     _platformSI          = platformSI;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RegisterAppSI"/> class
 /// </summary>
 /// <param name="dfs">The dfs</param>
 /// <param name="er">The er</param>
 /// <param name="logger">The logger</param>
 /// <param name="platformSettings">The platform settings</param>
 public RegisterAppSI(IDSF dfs, IER er, ILogger <RegisterAppSI> logger, IOptions <PlatformSettings> platformSettings)
 {
     _dsf              = dfs;
     _er               = er;
     _logger           = logger;
     _platformSettings = platformSettings.Value;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProfileStudioSI"/> class
 /// </summary>
 /// <param name="testdataRepositorySettings">The settings for test data repository</param>
 /// <param name="dsfService">The dsf service</param>
 /// <param name="erService">The er service</param>
 public ProfileStudioSI(IOptions <TestdataRepositorySettings> testdataRepositorySettings, IDSF dsfService, IER erService)
 {
     _testdataRepositorySettings = testdataRepositorySettings.Value;
     _dsfService      = dsfService;
     _erService       = erService;
     _registerService = new RegisterStudioSI(testdataRepositorySettings, dsfService, erService);
 }
Beispiel #4
0
        /// <summary>
        /// Disables the data received interrupt.
        /// </summary>
        public void DisableDataReceivedInterrupt()
        {
            IER ier = (IER)(ierBase.Read8());

            ier &= ~IER.DR;
            ierBase.Write8((byte)ier);
        }
Beispiel #5
0
        //使用者在留言清單中點選刪除回覆
        public async Task <long> DeleteReplyMessageManagement(int ReplyMessageId)
        {
            long ret;

            ret = await IER.DeleteReplyMessageManagement(ReplyMessageId);

            return(ret);
        }
Beispiel #6
0
        //使用者在留言清單中點選回覆留言
        public async Task <long> InsertReplyMessageManagement(int MessageId, string ReplyMessageValue, string ReplyMobile)
        {
            long ret;

            ret = await IER.InsertReplyMessageManagement(MessageId, ReplyMessageValue, ReplyMobile);

            return(ret);
        }
Beispiel #7
0
        public async Task <IViewComponentResult> InvokeAsync(string EmployeeMobile, int Month, int Page = 1, int LinkType = 0, int StartPage = 1, string AClass = "inner-page-link")
        {
            // 9-1.系統在ViewComponent【EmployeeList】中讀取Appsetting.json中的每頁筆數RowsPerPage以及分頁頁碼連結總數PageCount。
            int RowsPerPage = int.Parse(config["Page:RowsPerPage"]);
            int PageCount   = int.Parse(config["Page:PageCount"]);
            // 9-2.系統在ViewComponent【EmployeeList】讀取員工總數。
            long EmpCount = await IER.GetEmployeeMonthSalaryListCount(EmployeeMobile, Month);

            // 9-3.系統依9-2傳回值將9傳送頁碼重設在Between 1 and (9讀取記錄筆數/RowsPerPage)+(9讀取記錄筆數%RowsPerPage==0?0:1)。
            int TotalPages = (int)(EmpCount / RowsPerPage);

            if (EmpCount % RowsPerPage > 0)
            {
                TotalPages += 1;
            }
            if (Page < 1)
            {
                Page = 1;
            }
            if (Page > TotalPages)
            {
                Page = TotalPages;
            }
            if (Page <= 0)
            {
                Page = 1;
            }
            // 9-4.系統計算資料Skip數=(9傳送頁碼(預設1)-1)*9-1讀取RowsPerPage。
            int Skip = (Page - 1) * RowsPerPage;
            // 9-5系統在ViewComponent【EmployeeListViewComponent】讀取部門員工清單:
            List <EmployeeMonthSalaryViewModel> EmpMSL = await IER.GetEmployeeMonthSalaryList(EmployeeMobile, Month, Skip, RowsPerPage);

            // 9-6.系統設定PagerTagHelper之相關參數
            int CurrentPage = Page;

            // 9-6-1.系統將管理者權限清單Session["EmployeeRights"]暫存在ViewBag.TR。
            ViewBag.TR   = HttpContext.Session.GetObjectFromJson <List <int> >("EmployeeRights");
            ViewBag.Page = Page;
            //9-7.系統回傳View(new EmployeeListManageViewModel {
            //listEmployeeListViewModel = 9 - 5讀取值,
            //CurrentPage = 9 - 6設定值,
            //TotalPages = 9 - 6設定值,
            //PageCount = 9 - 6設定值,
            //StartPage = 9 - 6設定值,
            //Parameters = 9 - 6設定值
            //});
            return(View(new EmployeeMonthSalaryManageViewModel
            {
                listEmployeeMonthSalaryViewModel = EmpMSL,
                CurrentPage = CurrentPage,
                TotalPages = TotalPages,
                PageCount = PageCount,
                StartPage = StartPage,
                LinkType = LinkType,
                AClass = AClass,
                EmpCount = EmpCount,
            }));
        }
Beispiel #8
0
        public async Task <IViewComponentResult> InvokeAsync(int MessageId, int Page = 1, int LinkType = 0, int StartPage = 1, string AClass = "inner-page-link")
        {
            // 9-1.系統在ViewComponent【OrderDetailListNoButton】中讀取Appsetting.json中的每頁筆數RowsPerPage以及分頁頁碼連結總數PageCount。
            int RowsPerPage = int.Parse(config["Page:RowsPerPage"]);
            int PageCount   = int.Parse(config["Page:PageCount"]);
            // 9-2.系統在ViewComponent【OrderDetailListNoButton】讀取銷貨單銷貨清單總數。
            long memberCount = await IER.GetReplyMessageManagementCount(MessageId);

            // 9-3.系統依9-2傳回值將9傳送頁碼重設在Between 1 and (9讀取記錄筆數/RowsPerPage)+(9讀取記錄筆數%RowsPerPage==0?0:1)。
            int TotalPages = (int)(memberCount / RowsPerPage);

            if (memberCount % RowsPerPage > 0)
            {
                TotalPages += 1;
            }
            if (Page < 1)
            {
                Page = 1;
            }
            if (Page > TotalPages)
            {
                Page = TotalPages;
            }
            if (Page <= 0)
            {
                Page = 1;
            }
            // 9-4.系統計算資料Skip數=(9傳送頁碼(預設1)-1)*9-1讀取RowsPerPage。
            int Skip = (Page - 1) * RowsPerPage;
            // 9-5系統在ViewComponent【OrderDetailListNoButtonViewComponent】讀取銷貨單銷貨清單清單:
            List <ReplyMessageManagementDataListviewModel> GRMML = await IER.GetReplyMessageManagementList(MessageId, Skip, RowsPerPage);

            // 9-6.系統設定PagerTagHelper之相關參數
            int CurrentPage = Page;

            // 9-6-1.系統將管理者權限清單Session["EmployeeRights"]暫存在ViewBag.TR。
            ViewBag.TR   = HttpContext.Session.GetObjectFromJson <List <int> >("EmployeeRights");
            ViewBag.Page = Page;
            // 9-7.系統回傳View(new OrderDetailListManageViewModel  {
            //listOrderDetailListViewModel = 9 - 5讀取值,
            //CurrentPage = 9 - 6設定值,
            //TotalPages = 9 - 6設定值,
            //PageCount = 9 - 6設定值,
            //StartPage = 9 - 6設定值,
            //Parameters = 9 - 6設定值
            //});
            return(View(new MessageManagementDataManageViewModel
            {
                listReplyMessageManagementDataListviewModel = GRMML,
                CurrentPage = CurrentPage,
                TotalPages = TotalPages,
                PageCount = PageCount,
                StartPage = StartPage,
                LinkType = LinkType,
                AClass = AClass
            }));
        }
        //20181222 ---棋
        public async Task <IViewComponentResult> InvokeAsync(int MessageId, int Page = 1, int StartPage = 1)
        {
            //9-1.系統在ViewComponent【Followertriumph】中讀取Appsetting.json中的每頁筆數BRowsPerPage以及分頁頁碼連結總數PageCount。
            int RowsPerPage = int.Parse(config["Page:BRowsPerPage"]);
            int PageCount   = int.Parse(config["Page:PageCount"]);
            //9-2.系統在ViewComponent【Followertriumph】讀取我的下線業績總數。
            long memberCount = await IER.GetReplyMessageManagementCount(MessageId);

            //9-3.系統依9-2傳回值將9傳送頁碼重設在Between 1 and(9讀取記錄筆數/RowsPerPage)+(9讀取記錄筆數%RowsPerPage==0?0:1)。
            int TotalPages = (int)(memberCount / RowsPerPage);

            if (memberCount % RowsPerPage > 0)
            {
                TotalPages += 1;
            }
            if (Page < 1)
            {
                Page = 1;
            }
            if (Page > TotalPages)
            {
                Page = TotalPages;
            }
            if (Page <= 0)
            {
                Page = 1;
            }
            //9-4.系統計算資料Skip數 = (9傳送頁碼(預設1) - 1)*9 - 1讀取RowsPerPage。
            int Skip = (Page - 1) * RowsPerPage;
            //9-5系統在ViewComponent【FollowertriumphViewComponent】讀取我的下線業績清單:
            List <ReplyMessageManagementDataListviewModel> GRMML = await IER.GetReplyMessageManagementList(MessageId, Skip, RowsPerPage);

            //9-6.系統設定PagerTagHelper之相關參數
            int CurrentPage = Page;

            //9-6-1.系統將管理者權限清單Session["EmployeeRights"]暫存在ViewBag.TR。
            ViewBag.TR   = HttpContext.Session.GetObjectFromJson <List <int> >("EmployeeRights");
            ViewBag.Page = Page;

            return(View(new MessageManagementDataManageViewModel
            {
                listReplyMessageManagementDataListviewModel = GRMML,
                CurrentPage = CurrentPage,
                TotalPages = TotalPages,
                PageCount = PageCount,
                StartPage = StartPage,
                //Parameters = Page,
            }));
        }
Beispiel #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RegisterAppSI"/> class
 /// </summary>
 /// <param name="dsf">The dsf</param>
 /// <param name="er">The er</param>
 /// <param name="logger">The logger</param>
 /// <param name="httpContextAccessor">The http context accessor </param>
 /// <param name="cookieOptions">The cookie options </param>
 /// <param name="httpClientAccessor">The http client accessor </param>
 public RegisterAppSI(
     IDSF dsf,
     IER er,
     ILogger <RegisterAppSI> logger,
     IHttpContextAccessor httpContextAccessor,
     IOptions <JwtCookieOptions> cookieOptions,
     IHttpClientAccessor httpClientAccessor)
 {
     _dsf    = dsf;
     _er     = er;
     _logger = logger;
     _httpContextAccessor = httpContextAccessor;
     _cookieOptions       = cookieOptions.Value;
     _client = httpClientAccessor.RegisterClient;
 }
Beispiel #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RegisterAppSI"/> class
 /// </summary>
 /// <param name="dsf">The dsf</param>
 /// <param name="er">The er</param>
 /// <param name="logger">The logger</param>
 /// <param name="httpContextAccessor">The http context accessor </param>
 /// <param name="settings">The application settings.</param>
 /// <param name="httpClientAccessor">The http client accessor </param>
 public RegisterAppSI(
     IDSF dsf,
     IER er,
     ILogger <RegisterAppSI> logger,
     IHttpContextAccessor httpContextAccessor,
     IOptionsMonitor <AppSettings> settings,
     IHttpClientAccessor httpClientAccessor)
 {
     _dsf    = dsf;
     _er     = er;
     _logger = logger;
     _httpContextAccessor = httpContextAccessor;
     _settings            = settings.CurrentValue;
     _client = httpClientAccessor.RegisterClient;
 }
Beispiel #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RegisterAppSI"/> class
 /// </summary>
 /// <param name="dfs">The dfs</param>
 /// <param name="er">The er</param>
 /// <param name="logger">The logger</param>
 /// <param name="platformSettings">The platform settings</param>
 /// <param name="httpContextAccessor">The http context accessor </param>
 /// <param name="cookieOptions">The cookie options </param>
 /// <param name="httpClientAccessor">The http client accessor </param>
 public RegisterAppSI(
     IDSF dfs,
     IER er,
     ILogger <RegisterAppSI> logger,
     IOptions <PlatformSettings> platformSettings,
     IHttpContextAccessor httpContextAccessor,
     IOptions <JwtCookieOptions> cookieOptions,
     IHttpClientAccessor httpClientAccessor)
 {
     _dsf                 = dfs;
     _er                  = er;
     _logger              = logger;
     _platformSettings    = platformSettings.Value;
     _httpContextAccessor = httpContextAccessor;
     _cookieOptions       = cookieOptions.Value;
     _client              = httpClientAccessor.RegisterClient;
 }
Beispiel #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InstanceController"/> class
 /// </summary>
 /// <param name="authorizationService">The authorizationService (set in Startup.cs)</param>
 /// <param name="logger">The logger (set in Startup.cs)</param>
 /// <param name="profileService">The profile service (set in Startup.cs)</param>
 /// <param name="registerService">The registerService (set in Startup.cs)</param>
 /// <param name="erService">The erService (set in Startup.cs)</param>
 /// <param name="formService">The form</param>
 /// <param name="repositoryService">The repository service (set in Startup.cs)</param>
 /// <param name="serviceExecutionService">The serviceExecutionService (set in Startup.cs)</param>
 /// <param name="archiveService">The archive service</param>
 /// <param name="httpContextAccessor">The http context accessor</param>
 /// <param name="testDataService">the test data service handler</param>
 /// <param name="workflowSI">the workflow service handler</param>
 /// <param name="instanceSI">the instance service handler</param>
 /// <param name="eventSI">the instance event service handler</param>
 /// <param name="platformSI">the platform service handler</param>
 /// <param name="dataSI">the data service handler</param>
 /// <param name="application">the application service handler</param>
 /// <param name="prefill">The prefill service handler</param>
 /// <param name="repositorySettings">the repository settings</param>
 /// <param name="generalSettings">the general settings</param>
 public InstanceController(
     IAuthorization authorizationService,
     ILogger <InstanceController> logger,
     IProfile profileService,
     IRegister registerService,
     IER erService,
     IForm formService,
     IRepository repositoryService,
     IExecution serviceExecutionService,
     IArchive archiveService,
     ITestdata testDataService,
     IHttpContextAccessor httpContextAccessor,
     IWorkflow workflowSI,
     IInstance instanceSI,
     IInstanceEvent eventSI,
     IPlatformServices platformSI,
     IData dataSI,
     IApplication application,
     IPrefill prefill,
     IOptions <ServiceRepositorySettings> repositorySettings,
     IOptions <GeneralSettings> generalSettings)
 {
     _authorization       = authorizationService;
     _logger              = logger;
     _profile             = profileService;
     _register            = registerService;
     _er                  = erService;
     _form                = formService;
     _repository          = repositoryService;
     _execution           = serviceExecutionService;
     _userHelper          = new UserHelper(profileService, _register, generalSettings);
     _archive             = archiveService;
     _testdata            = testDataService;
     _httpContextAccessor = httpContextAccessor;
     _workflowSI          = workflowSI;
     _instance            = instanceSI;
     _event               = eventSI;
     _platformSI          = platformSI;
     _data                = dataSI;
     _prefill             = prefill;
     _application         = application;
     _settings            = repositorySettings.Value;
     _generalSettings     = generalSettings.Value;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RegisterAppSI"/> class
 /// </summary>
 /// <param name="dsf">The dsf</param>
 /// <param name="er">The er</param>
 /// <param name="logger">The logger</param>
 /// <param name="httpContextAccessor">The http context accessor </param>
 /// <param name="settings">The application settings.</param>
 /// <param name="httpClientAccessor">The http client accessor </param>
 public RegisterAppSI(
     IOptions <PlatformSettings> platformSettings,
     IDSF dsf,
     IER er,
     ILogger <RegisterAppSI> logger,
     IHttpContextAccessor httpContextAccessor,
     IOptionsMonitor <AppSettings> settings,
     HttpClient httpClient)
 {
     _dsf    = dsf;
     _er     = er;
     _logger = logger;
     _httpContextAccessor   = httpContextAccessor;
     _settings              = settings.CurrentValue;
     httpClient.BaseAddress = new Uri(platformSettings.Value.ApiRegisterEndpoint);
     httpClient.DefaultRequestHeaders.Add(General.SubscriptionKeyHeaderName, platformSettings.Value.SubscriptionKey);
     httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
     _client = httpClient;
 }
Beispiel #15
0
        public async Task <int> UpdateMemberLevelCartImg(int upVersionId, IFormFile UpImgExample)
        {
            int ret = 0;

            try
            {
                // 8.系統接收6上傳資料。
                string FileName       = upVersionId.ToString();
                byte[] PictureContent = null;
                string PictureType    = "";
                if (HttpContext.Request.HasFormContentType)
                {
                    // 取得Client傳送之表單內容
                    IFormCollection form;
                    //form = HttpContext.Request.Form; // syncmbc
                    // Or
                    form = await HttpContext.Request.ReadFormAsync(); // async

                    PictureType = UpImgExample.ContentType;
                    using (var memoryStream = new MemoryStream())
                    {
                        await UpImgExample.CopyToAsync(memoryStream);

                        PictureContent = memoryStream.ToArray();
                    }
                }

                ret = await IER.UpdateMemberLevelCart(upVersionId, PictureContent, PictureType, FileName);

                // 11.系統判斷10執行成功。
                // 12.系統傳回10傳回值。
                return(ret);
            }
            catch (Exception ex)
            {
                // 111a.系統判斷10執行時發生例外。
                //  11a-1.系統傳回1。
                ret = 1;
            }
            return(ret);
        }
Beispiel #16
0
        public async Task <IActionResult> Index()
        {
            List <VersionListViewModel> VersionList = await IER.GetVersion();

            return(View(VersionList));
        }
Beispiel #17
0
        //20181212 ---棋
        //讀取版規圖檔
        public async Task <FileResult> GetCagegoryImage(int VersionId)
        {
            GetImgVersionRuleViewModel onePC = await IER.GetCagegoryImage(VersionId);

            return(File(onePC.VersionRulePictureContent, onePC.VersionRulePictureType));
        }
 public RegisterMockSI(IDSF dsfService, IER erService)
 {
     _dsfService = dsfService;
     _erService  = erService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RegisterStudioSI"/> class
 /// </summary>
 /// <param name="testdataRepositorySettings">The test data repository settings</param>
 /// <param name="dsfService">The dsf service</param>
 /// <param name="erService">The er service</param>
 public RegisterStudioSI(IOptions <TestdataRepositorySettings> testdataRepositorySettings, IDSF dsfService, IER erService)
 {
     _testdataRepositorySettings = testdataRepositorySettings.Value;
     _dsfService = dsfService;
     _erService  = erService;
 }