Example #1
0
        private void btnWorkflow_Click(object sender, EventArgs e)
        {
            //数据模型
            DataBusiness.SyncTable("OT_BizObjectSchemaDraft");
            DataBusiness.SyncTable("OT_BizObjectSchemaPublished");
            DataBusiness.SyncTable("OT_BizObjectAcl");
            DataBusiness.SyncTable("OT_BizQuery");
            DataBusiness.SyncTable("OT_BizQueryAction");
            DataBusiness.SyncTable("OT_BizQueryColumn");
            DataBusiness.SyncTable("OT_BizQueryItems");
            DataBusiness.SyncTable("OT_BizListener");
            //流程表单
            DataBusiness.SyncTable("OT_BizSheet");

            //流程图
            DataBusiness.SyncTable("OT_WorkflowClause");
            DataBusiness.SyncTable("OT_WorkflowAcl");
            DataBusiness.SyncTable("OT_WorkflowClauseSeqNo");
            DataBusiness.SyncTable("OT_WorkflowTemplateDraft");
            DataBusiness.SyncTable("OT_WorkflowTemplatePublished");
            DataBusiness.SyncTable("OT_ActivityConfig");

            //流程测试用例
            DataBusiness.SyncTable("OT_InstanceSimulation");
            DataBusiness.SyncTable("OT_InstanceSimulationDataItem");
            DataBusiness.SyncTable("OT_InstanceSimulationList");
            DataBusiness.SyncTable("OT_InstanceSimulationLog");

            //重启引擎
            StartService("H3SharedService");
        }
Example #2
0
        private void btnPara_Click(object sender, EventArgs e)
        {
            //常用流程
            DataBusiness.SyncTable("OT_FavoriteWorkflow");
            //
            DataBusiness.SyncTable("OT_FrequentlyUsedComment");

            DataBusiness.SyncTable("OT_Signature");

            //
            DataBusiness.SyncTable("OT_Agency");
            //
            DataBusiness.SyncTable("OT_Consultancy");

            //系统管理员
            DataBusiness.SyncTable("OT_SystemAcl");
            //组织权限
            DataBusiness.SyncTable("OT_SystemOrgAcl");
            //文件储存
            DataBusiness.SyncTable("OT_FileServer");
            //工作日历
            DataBusiness.SyncTable("OT_WorkingCalendar");
            DataBusiness.SyncTable("OT_WorkingDay");
            DataBusiness.SyncTable("OT_WorkingTimeSpan");

            //数据字典
            DataBusiness.SyncTable("OT_EnumerableMetadata");
        }
        public async Task <IActionResult> Book([Bind("FlightId,FlightName,OutboundDate,ArrivalDate,AirportFrom,AirportTo,TravellerFirstName,TravellerLastName,OneWay")] BookingViewModel book)
        {
            if (ModelState.IsValid)
            {
                var service = new DataBusiness(_repository);

                var customer = new Customer {
                    CustomerId = Guid.NewGuid(),
                    CityId     = service.ListAllCities().FirstOrDefault().CityId,
                    FirstName  = book.TravellerFirstName,
                    LastName   = book.TravellerLastName,
                };

                var result = service.AddCustomer(customer);
                var travel = new Travel {
                    OutboundFlightId = book.FlightId,
                    CustomerId       = customer.CustomerId,
                    OutboundDate     = book.OutboundDate,
                    OneWay           = true,

                    Traveller = customer
                };

                await service.AddTravelAsync(travel);

                return(RedirectToAction(nameof(Index), "Travel", travel));
            }

            return(View(book));
        }
        public void TestGetDistanceBetweenToPoints()
        {
            var mockRepository = new Mock <IRepository>();
            var result         = DataBusiness.GetDistanceBetweenToPoints(43.9067, 4.90194, 51.1894, 4.46028, "K");

            Assert.Equal(Math.Round(810.434262225298, 2), Math.Round(result, 2));
        }
Example #5
0
        static void Main(string[] args)
        {
            //Input data as message.
            InputText inputAction = new InputText();
            var       items       = inputAction.InputString();

            //Create data from input string.
            DataBusiness createBusiness = new DataBusiness();
            var          data           = createBusiness.CreateData(items);

            //Display data.
            DisplayData displayData = new DisplayData();

            displayData.Display(data);

            //Input action to see remaining data as input string.
            var inputString = inputAction.InputActionsString();

            //Caculate data remaining.
            var dataRemaining = createBusiness.RemainingData(inputString, data);

            //Display data remaining.
            displayData.Display(dataRemaining);

            Console.WriteLine("Press any key to exits");
            Console.ReadKey();
        }
Example #6
0
        public void TestAddEmptyAirline()
        {
            var mockRepository = new Mock <IRepository>();
            var service        = new DataBusiness(mockRepository.Object);
            var result         = service.AddAirLine(null);

            Assert.Equal(CommandRresult.ReturnCode.ImpossibleToAddAnEmptyAirlineCompany, result.ResultCode);
        }
Example #7
0
        private void CreateDBScript(string TableName)
        {
            var temp = DataBusiness.GetTableCols(TableName);

            DataBusiness.CreateType(temp);
            DataBusiness.CreateProc(temp);
            LogHelper.Info("创建脚本:" + TableName);
        }
Example #8
0
        public void TestAddAirlineWithNoKey()
        {
            var mockRepository = new Mock <IRepository>();
            var service        = new DataBusiness(mockRepository.Object);
            //var airline = new Airline();
            var result = service.AddAirLine(new Airline());

            Assert.Equal(CommandRresult.ReturnCode.TheAirlineCompanyIdIsMissing, result.ResultCode);
        }
Example #9
0
        public void TestAddAirlineWithNoName()
        {
            var mockRepository = new Mock <IRepository>();
            var service        = new DataBusiness(mockRepository.Object);
            var result         = service.AddAirLine(new Airline {
                AirlineId = Guid.NewGuid()
            });

            Assert.Equal(CommandRresult.ReturnCode.YouMustSpecifyTheAirlineCompanyName, result.ResultCode);
        }
Example #10
0
        public void TestAddAirlineWithSuccess()
        {
            var mockRepository = new Mock <IRepository>();
            var service        = new DataBusiness(mockRepository.Object);
            var result         = service.AddAirLine(new Airline {
                AirlineId = Guid.NewGuid(), Name = "Testing Airline Company"
            });

            Assert.Equal(CommandRresult.ReturnCode.TheAirlineCompanyHasBeenAdded, result.ResultCode);
        }
        public IActionResult Index()
        {
            var service = new DataBusiness(_repository);
            var model   = new SearchViewModel(service.ListAllAirports())
            {
                DisplaySearchResult = true,
                Flights             = service.ListAllFlights()
            };

            return(View(model));
        }
Example #12
0
            public Object Get()
            {
                var            dataBusiness = new DataBusiness();
                List <dynamic> Result       = dataBusiness.Get();

                if (Result != null)
                {
                    return(Result);
                }

                return(null);
            }
Example #13
0
 private void btnBizService_Click(object sender, EventArgs e)
 {
     //业务数据库的链接
     DataBusiness.SyncTable("OT_BizDbConnectionConfig");
     //业务服务
     DataBusiness.SyncTable("OT_BizService");
     DataBusiness.SyncTable("OT_BizServiceMethod");
     DataBusiness.SyncTable("OT_BizServiceSetting");
     //业务规则
     DataBusiness.SyncTable("OT_BizRule");
     DataBusiness.SyncTable("OT_BizRuleAcl");
 }
Example #14
0
        private void btnApp_Click(object sender, EventArgs e)
        {
            DataBusiness.SyncTable("OT_AppNavigation");
            var WorkflowClauses = OThinker.H3.Controllers.AppUtility.Engine.Query.QueryClause(null);

            //foreach (string item in WorkflowClauses)
            //{

            //    UpdateWorkflow(item);
            //}
            UpdateWorkflow("SAPJurisdictionChange");
        }
Example #15
0
            public Object Save(dynamic Data)
            {
                DataBusiness dataBusiness = new DataBusiness();
                string       Result       = dataBusiness.Add(Data);

                if (Result != null)
                {
                    return(Result);
                }

                return(null);
            }
        public IActionResult Book(Guid id)
        {
            var service = new DataBusiness(_repository);
            var flight  = service.ListAllFlights().FirstOrDefault(f => f.FlightId == id);

            var model = new BookingViewModel
            {
                FlightId     = flight.FlightId,
                FlightName   = flight.Name,
                OutboundDate = flight.OutboundDate,
                AirportFrom  = flight.DepartureAirport.Name,
                AirportTo    = flight.DestinationAirport.Name,
            };

            return(View(model));
        }
Example #17
0
        public async void GetTemperatureTest()
        {
            //Arrange
            Mock <IWeatherLogic> mockrepo = new Mock <IWeatherLogic>();
            IDataBusiness        business = new DataBusiness(mockrepo.Object);

            decimal response = 22.1m;

            mockrepo.Setup(x => x.GetTemperature("buenos aires")).ReturnsAsync(response);

            //Act
            decimal result = await business.GetTemperature("buenos aires");

            //Assert
            Assert.Equal(response, result);
        }
Example #18
0
        public async void GetBeersByTemp3()
        {
            //Arrange
            Mock <IWeatherLogic> mockrepo = new Mock <IWeatherLogic>();
            IDataBusiness        business = new DataBusiness(mockrepo.Object);

            decimal response = 22.5m;

            mockrepo.Setup(x => x.GetTemperature("buenos aires")).ReturnsAsync(response);

            //Act
            int result = await business.GetHowManyBeers("buenos aires", 9);

            //Assert
            Assert.Equal(2, result);
        }
Example #19
0
        private void btnObjectData_Click(object sender, EventArgs e)
        {
            DataBusiness.SyncTable("OT_InstanceContext");

            DataBusiness.SyncTable("OT_WorkItem");

            DataBusiness.SyncTable("OT_Comment");

            DataBusiness.SyncTable("OT_Timer");

            DataBusiness.SyncTable("OT_Token");

            DataBusiness.SyncTable("OT_Urgency");

            //
        }
        public async Task <IActionResult> Index([Bind("AirportFromId,CustomerId,OutboundDate,OneWay,AirportToId,ReturnDate")] SearchViewModel travel)
        {
            if (ModelState.IsValid)
            {
                var service = new DataBusiness(_repository);
                var flights = await service.ListAllFlightsAsync().ToList();

                travel.DisplaySearchResult = true;
                travel.Airports            = service.ListAllAirports();
                travel.Flights             = flights.Where(f =>
                                                           f.DepartureAirport.AirportId == travel.AirportFromId &&
                                                           f.DestinationAirport.AirportId == travel.AirportToId);

                //return RedirectToAction(nameof(Book), travel);
                return(View(travel));
            }

            return(View(travel));
        }
Example #21
0
        private void btnSyncOrg_Click(object sender, EventArgs e)
        {
            //组织类型
            DataBusiness.SyncTable(new string[] { "OT_OrgCategory", "OT_Category" });
            //OU表
            DataBusiness.SyncTable("OT_OrganizationUnit");
            //用户
            DataBusiness.SyncTable("OT_User");

            //组
            DataBusiness.SyncTable("OT_Group");

            //组成员
            DataBusiness.SyncTable("OT_GroupChild");
            //重启引擎
            StartService("H3SharedService");

            //MessageBox.Show("组织架构导入完成,请重启引擎");
            SyncRole();
        }
Example #22
0
        private void CreateCustomerTable()
        {
            var sqltable = string.Format(@"SELECT
	*
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
AND Table_Name  LIKE 'I_%'");

            var dt = H3DBHelper.GetDataTable(sqltable);

            foreach (DataRow item in dt.Rows)
            {
                var TableName = item["TABLE_NAME"].ToString();

                var temp = DataBusiness.GetTableCols(TableName);

                DataBusiness.CreateTable(temp);
                DataBusiness.CreateType(temp);
                DataBusiness.CreateProc(temp);
            }
        }
Example #23
0
 public ChatHubT(ILogger <ChatHubT> logger, DataBusiness dataBusiness)
 {
     _logger       = logger;
     _dataBusiness = dataBusiness;
 }
Example #24
0
 public UserConcreteObject()
 {
     _dataBusiness = new DataBusiness();
 }
Example #25
0
 public HomeController(ILogger <HomeController> logger, DataBusiness dataBusiness)
 {
     _logger       = logger;
     _dataBusiness = dataBusiness;
 }
        public GameModel GetGameById(string id)
        {
            var model = new DataBusiness().GetGameById(id);

            return(model);
        }