Example #1
0
        public static void Register(HttpConfiguration config)
        {
            // Web API configuration and services
            config.MessageHandlers.Add(new OptionsHttpMessageHandler());

            // Web API routes
            config.MapHttpAttributeRoutes();

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );

            AppFactory appFactory = new AppFactory(true);

            CommonControllerModel = new CommonControllerModel()
            {
                AppFactory          = new AppFactory(),
                AppRootFilePath     = appFactory.AppPath,
                SiteCommonFilePath  = appFactory.SiteCommonPath,
                ServiceRootFilePath = appFactory.SiteCommonPath + "../",
                Source = "API",
            };

            Constants.BpstDeploymentIdDatabase = ConfigurationManager.ConnectionStrings["BpstDeploymentIdDatabase"].ToString();
            Constants.BpstNotifierUrl          = ConfigurationManager.ConnectionStrings["BpstNotifierUrl"].ToString();

            var appXmlType = config.Formatters.XmlFormatter.SupportedMediaTypes.FirstOrDefault(t => t.MediaType == "application/xml");

            config.Formatters.XmlFormatter.SupportedMediaTypes.Remove(appXmlType);
            //config.Services.Add(typeof(IExceptionLogger), new AiExceptionLogger());
        }
Example #2
0
        private void RunTest(string json, string testName, long startAt, string[] expectedOrder)
        {
            using (FirebaseApp app = AppFactory.FromJson(json))
            {
                ManualResetEvent fired = new ManualResetEvent(false);
                var query = app.Child("/")
                            .OrderByChild(testName)
                            .StartAt(startAt)
                            .On("value", (snap, previous, context) =>
                {
                    Assert.IsNotNull(snap.Children, testName);
                    var children = snap.Children.ToList();

                    Assert.AreEqual(expectedOrder.Length, children.Count, testName);

                    for (int i = 0; i < expectedOrder.Length; i++)
                    {
                        Assert.AreEqual(expectedOrder[i], children[i].Key, testName);
                    }

                    fired.Set();
                });

                Assert.IsTrue(fired.WaitOne(TimeSpan.FromSeconds(5)), "callback did not fire during " + testName);
            }
        }
Example #3
0
        public JsonResult MsgSecCheck(RequestContext <MsgSecCheckRequest> request)
        {
            RequestHead head = default;

            try
            {
                if (request == null)
                {
                    return(ErrorJsonResult(ErrCodeEnum.ParametersIsNotValid_Code));
                }
                if (!CheckAuth(request.Head))
                {
                    return(ErrorJsonResult(ErrCodeEnum.InvalidRequestHead));
                }
                head = request.Head;
                if (request.Data == null || request.Data.TextContent.IsNullOrEmpty())
                {
                    return(ErrorJsonResult(ErrCodeEnum.InvalidRequestBody));
                }
                var  response = new Response();
                bool msgOk    = AppFactory.Factory(request.Head.Platform).MsgSecCheck(request.Data.TextContent);
                if (!msgOk)
                {
                    response.ResultCode    = ErrCodeEnum.MessageCheckError;
                    response.ResultMessage = ErrCodeEnum.MessageCheckError.ToDescription();
                }
                return(new JsonResult(response));
            }
            catch (Exception ex)
            {
                return(ErrorJsonResult(ErrCodeEnum.InnerError, head, "CommonController.MsgSecCheck", ex));
            }
        }
        static async Task Main(string[] args)
        {
            while (true)
            {
                try
                {
                    Console.Write("Date: ");
                    var requestedDate = DateHelper.Parse(Console.ReadLine());

                    if (requestedDate != null)
                    {
                        var app = AppFactory.GetInstance();

                        app.Dates.Add(requestedDate);
                        app.Dates.Add(DateHelper.GetPrevious());

                        await app.GetExchangeDataAsync();

                        var printer = ConsolePrinterFactory.GetPrinter();
                        printer.Print(app.GetExchangeResults());

                        break;
                    }

                    Console.WriteLine("Try again: valid date is any between 1993-06-26 and 2014-12-31.");
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            }
        }
Example #5
0
        public Response AskAction(RequestContext <AskActionRequest> request)
        {
            var applyInfo = applyInfoDao.GetByApplyId(request.Data.ApplyId);

            if (applyInfo == null)
            {
                return(new Response(ErrCodeEnum.DataIsnotExist, "申请不存在"));
            }
            string remark      = string.Empty;
            bool   sendMsg     = false;
            bool   joinSuccess = true;

            if (string.Equals(request.Data.Action, "cancel"))
            {
                applyInfoDao.UpdateState(ApplyStateEnum.申请已撤销, applyInfo.ApplyId);
                remark = "撤销活动申请";
            }
            if (string.Equals(request.Data.Action, "reask"))
            {
                applyInfoDao.UpdateState(ApplyStateEnum.申请中, applyInfo.ApplyId);
                remark = "重新申请加入活动";
            }
            if (string.Equals(request.Data.Action, "pass"))
            {
                applyInfoDao.UpdateState(ApplyStateEnum.申请通过, applyInfo.ApplyId);
                momentDao.UpdateApplyCount(applyInfo.MomentId);
                remark  = "通过了活动申请";
                sendMsg = true;
            }
            if (string.Equals(request.Data.Action, "black"))
            {
                applyInfoDao.UpdateState(ApplyStateEnum.永久拉黑, applyInfo.ApplyId);
                remark      = "拉黑了活动申请";
                sendMsg     = true;
                joinSuccess = false;
            }
            if (string.Equals(request.Data.Action, "refuse"))
            {
                applyInfoDao.UpdateState(ApplyStateEnum.被拒绝, applyInfo.ApplyId);
                if (!string.IsNullOrEmpty(request.Data.Remark))
                {
                    remark = request.Data.Remark;
                }
                sendMsg     = true;
                joinSuccess = false;
            }
            InsertDetail(applyInfo.MomentId, request.Data.ApplyId, request.Head.UId, remark);

            UserInfoEntity userInfo   = uerInfoBiz.GetUserInfoByUid(applyInfo.UId);
            MomentEntity   momentInfo = momentDao.GetMomentByMomentId(applyInfo.MomentId);

            if (sendMsg && userInfo != null && momentInfo != null)
            {
                //发送通知
                AppFactory.Factory(userInfo.Platform).Send_Activity_Join_MsgAsync(momentInfo, userInfo.UId, joinSuccess, remark);
            }
            return(new Response(ErrCodeEnum.Success, "提交成功"));
        }
Example #6
0
        private string GetAdminConnectionString()
        {
            AppFactory appFactory = new AppFactory();

            string server;
            int    port;

            return(appFactory.GetExternalAvailableInstanceConnectionString(SqlProduct.MySql, out server, out port));
        }
Example #7
0
        public void Update(Models.Bug model)
        {
            var appDbEntity = _appRepository.Get(model.Version);
            var appModel    = AppFactory.Create(appDbEntity);

            model.App = appModel;
            var entity = BugFactory.Create(model);

            _bugRepository.Update(entity);
        }
Example #8
0
        public void Add(App model)
        {
            var entity = AppFactory.Create(model);

            _appFileRepository.Add(entity.File);
            model.File.Id = entity.Id;

            _appRepository.Add(entity);
            model.Id = entity.Id;
        }
 private bool isUploadAllowed(UserInfo UserInfo)
 {
     if (AppFactory.GetAccessRoles(UserInfo).Contains("editpage"))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #10
0
 public void PushPackage(ipp_Package[] package, string receiver)
 {
     AppFactory.GetAppServer("iTripIMPushServer").GetSessions(s => s.Account == receiver).ToList().ForEach(
         delegate(TripSession session)
     {
         package.ForEach(delegate(ipp_Package pk)
         {
             byte[] bytes = pk.ToClientBytes();
             session.Send(bytes, 0, bytes.Length);
         });
     });
 }
Example #11
0
        /// <summary>
        /// 验证api
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private async Task <bool> VerifyApi(HttpContext context)
        {
            Endpoint endpoint = context.GetEndpoint();
            Result   result   = new Result();

            if (endpoint == null)
            {
                result.result = false;
                result.status = 404;
                result.msg    = "未知请求";
                await context.Response.WriteBodyAsync(result);

                return(false);
            }

            //身份验证
            LoginResult user = await AppFactory.Get <IUserApp>().GetLoginUser(context.Request.GetToken());

            if (!await IDentityVerify(context, user))
            {
                Result res = new Result
                {
                    msg    = "无权访问",
                    status = 401
                };
                await context.Response.WriteBodyAsync(res);

                return(false);
            }

            //不需要验证用户
            if (user == null || user.user_id == 1)
            {
                return(true);
            }

            ////token 续期
            //IUserServer userServer = new UserServerImpl();
            //await userServer.TokenRenewalAsync(user.token, user);

            //验证权限
            //if (!await PrivilegeVerify(context, user))
            //{
            //    Result res = new Result
            //    {
            //        code = ErrorCodeConst.ERROR_1035,
            //        status = ErrorCodeConst.ERROR_400
            //    };
            //    await context.Response.WriteBodyAsync(res);
            //    return false;
            //}
            return(true);
        }
Example #12
0
 private static Task <AppSession> createSession(AppFactory factory, AppUser user)
 {
     return(factory.Sessions().Create
            (
                "JustCreated",
                user,
                DateTimeOffset.UtcNow,
                "Testing",
                "UserAgent",
                "127.0.0.1"
            ));
 }
Example #13
0
        public Response Publish(RequestContext <PublishMomentRequest> request)
        {
            bool msgSec = AppFactory.Factory(request.Head.Platform).MsgSecCheck(request.Data.Content);

            if (!msgSec)
            {
                return(new Response(ErrCodeEnum.MessageCheckError));
            }
            var response = new Response();
            var moment   = new MomentEntity()
            {
                MomentId       = Guid.NewGuid(),
                UId            = request.Head.UId,
                IsDelete       = false,
                IsHide         = request.Data.IsHide,
                IsOffLine      = request.Data.IsOffLine,
                HidingNickName = request.Data.HidingNickName,
                State          = MomentStateEnum.审核中,
                NeedCount      = request.Data.NeedCount,
                Place          = request.Data.Place,
                Address        = request.Data.Address,
                Latitude       = request.Data.Latitude,
                Longitude      = request.Data.Longitude,
                ExpectGender   = request.Data.ExpectGender,
                ShareType      = request.Data.ShareType,
                Title          = request.Data.Title,
                Content        = request.Data.Content,
                CreateTime     = DateTime.Now,
                UpdateTime     = DateTime.Now
            };

            if (!string.IsNullOrEmpty(request.Data.StopTime))
            {
                moment.StopTime = DateTime.Parse(request.Data.StopTime);
            }
            if (!string.IsNullOrEmpty(request.Data.Mobile))
            {
                userInfoDao.UpdateMobile(request.Head.UId, request.Data.Mobile);
            }
            if (!string.IsNullOrEmpty(request.Data.WeChatNo))
            {
                userInfoDao.UpdateWeChatNo(request.Head.UId, request.Data.WeChatNo);
            }
            if (!string.IsNullOrEmpty(request.Data.QQNo))
            {
                userInfoDao.UpdateQQNo(request.Head.UId, request.Data.QQNo);
            }
            momentDao.Insert(moment);
            return(response);
        }
Example #14
0
        public void Add(BugModel model)
        {
            var appDbEntity = _appRepository.Get(model.Version);

            model.App = AppFactory.Create(appDbEntity);

            var entity = BugFactory.Create(model);

            entity.App = appDbEntity;

            _bugRepository.Add(entity);

            model.Id = entity.Id;
        }
Example #15
0
        public static void Register(HttpConfiguration config)
        {
            // Web API configuration and services
            config.MessageHandlers.Add(new OptionsHttpMessageHandler());

            // Web API routes
            config.MapHttpAttributeRoutes();

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );

            AppFactory appFactory = new AppFactory(true);

            CommonControllerModel = new CommonControllerModel()
            {
                AppFactory          = new AppFactory(),
                AppRootFilePath     = appFactory.AppPath,
                SiteCommonFilePath  = appFactory.SiteCommonPath,
                ServiceRootFilePath = appFactory.SiteCommonPath + "../",
                Source = "API",
            };

            Constants.BpstDeploymentIdDatabase         = ConfigurationManager.ConnectionStrings["BpstDeploymentIdDatabase"].ToString();
            Constants.BpstNotifierUrl                  = ConfigurationManager.ConnectionStrings["BpstNotifierUrl"].ToString();
            Constants.AxLocatorClientId                = ConfigurationManager.ConnectionStrings["AxLocatorClientId"].ToString();
            Constants.AxLocatorSecret                  = ConfigurationManager.ConnectionStrings["AxLocatorSecret"].ToString();
            Constants.FacebookClientSecret             = ConfigurationManager.ConnectionStrings["FacebookSecret"].ToString();
            Constants.InformaticaRegistrationCode      = ConfigurationManager.ConnectionStrings["InformaticaRegistrationCode"].ToString();
            Constants.SocialGistProvisionKeyUserName   = ConfigurationManager.ConnectionStrings["SocialGistRedditUserName"].ToString();
            Constants.SocialGistProvisionKeyPassphrase = ConfigurationManager.ConnectionStrings["SocialGistRedditPassphrase"].ToString();

            //Cuna settings
            Constants.CunaTokenUrl                 = ConfigurationManager.ConnectionStrings["CunaTokenUrl"].ToString();
            Constants.CunaApiUrl                   = ConfigurationManager.ConnectionStrings["CunaApiUrl"].ToString();
            Constants.CunaApiAadInstance           = ConfigurationManager.ConnectionStrings["CunaApiAadInstance"].ToString();
            Constants.CunaApiAadTenantId           = ConfigurationManager.ConnectionStrings["CunaApiAadTenantId"].ToString();
            Constants.CunaApiAadClientId           = ConfigurationManager.ConnectionStrings["CunaApiAadClientId"].ToString();
            Constants.CunaApiAadResourceId         = ConfigurationManager.ConnectionStrings["CunaApiAadResourceId"].ToString();
            Constants.CunaApiAadSecret             = ConfigurationManager.ConnectionStrings["CunaApiAadSecret"].ToString();
            Constants.CunaTokenValidateCertificate = ConfigurationManager.ConnectionStrings["CunaTokenValidateCertificate"].ToString();

            var appXmlType = config.Formatters.XmlFormatter.SupportedMediaTypes.FirstOrDefault(t => t.MediaType == "application/xml");

            config.Formatters.XmlFormatter.SupportedMediaTypes.Remove(appXmlType);
            //config.Services.Add(typeof(IExceptionLogger), new AiExceptionLogger());
        }
Example #16
0
        public void TestActionsWithObjectTypes()
        {
            AppFactory appFactory = new AppFactory(true);

            Assert.IsTrue(appFactory.Apps.Count > 0);

            var result = appFactory.Actions["Microsoft-MockAction"].ExecuteActionAsync(null).Result;

            Assert.IsTrue(result.Status == ActionStatus.Success);

            var jobject = JObject.FromObject(result);

            Assert.IsNotNull(jobject);
            Assert.IsNotNull(jobject["Body"]["Value"].ToString());
        }
Example #17
0
        protected virtual HttpClient OnCreateClient(AppFactory <TStartUp> factory)
        {
            var result = factory
                         .WithWebHostBuilder(b =>
            {
                b.ConfigureTestContainer <ContainerBuilder>(
                    cb => { });
            })
                         .CreateClient(new WebApplicationFactoryClientOptions
            {
                AllowAutoRedirect = true
            });

            return(result);
        }
Example #18
0
        public static void AssemblyInit(TestContext context)
        {
            AppFactory            factory = new AppFactory(true);
            CommonControllerModel model   = new CommonControllerModel()
            {
                AppFactory          = factory,
                AppRootFilePath     = factory.AppPath,
                SiteCommonFilePath  = factory.SiteCommonPath,
                ServiceRootFilePath = factory.SiteCommonPath + "../",
                Source = "TEST",
            };

            Controller = new CommonController(model);
            Credential.Load();
        }
Example #19
0
 public void Setup()
 {
     _app     = AppFactory.App();
     _command = new UpdateAppDetails
     {
         Id          = _app.Id,
         Name        = "New Name",
         Description = "New Description",
         Folder      = "New Folder"
     };
     _validatorMock = new Mock <IValidator <UpdateAppDetails> >();
     _validatorMock.Setup(x => x.Validate(_command)).Returns(new ValidationResult());
     _app.UpdateDetails(_command, _validatorMock.Object);
     _event = _app.Events.OfType <AppDetailsUpdated>().SingleOrDefault();
 }
Example #20
0
        public AppUser CreateNewAccount(AUser user)
        {
            //get role
            var role = context.Roles.SingleOrDefault(e => e.Id == (int)SupportLayer.Enum.RoleType.Admin);
            //create App
            var pipe    = new DefualtPipeForCreateApp();
            var app     = new CDefualtApp();
            var factory = AppFactory.CreateApp <DefaultAppBuilder>(pipe);

            factory.CreateApp(app);
            //create User
            var cum = new CUserManager();

            cum.AddUser(user, app);
            cum.AddUserRole(user, role);
            cum.Save();
        }
Example #21
0
        public void TestSentimentReplacement()
        {
            var appPath        = new AppFactory(true).AppPath;
            var jsonDefinition = File.ReadAllText(appPath + "\\Microsoft\\Released\\Microsoft-RedditTemplate\\Service\\AzureML\\RedditML.json");

            // if the model is no longer used, you should stop using DeployRedditAzureMLServiceFromFile and use DeployAzureMLServiceFromFile.
            // if the model is used, but the title has changed, you need to update this test so that the name is no longer expected to be "Mini Twitter..."
            Assert.IsTrue(jsonDefinition.Contains("Mini Twitter sentiment analysis [trained model] - Copy"), "The AzureML webservice file has changed and no longer contains the trained model asset.  Is the AzureML webservice file correct?  Is the model no longer in use?  Did it's name change?");
            Assert.IsTrue(!jsonDefinition.Contains("https://foo.com/bar.txt"));
            var newJsonDefinition = DeployRedditAzureMLWebServiceFromFile.ReplaceSentimentModel(
                "https://foo.com/bar.txt",
                "Mini Twitter sentiment analysis [trained model] - Copy",
                jsonDefinition
                );

            Assert.IsTrue(newJsonDefinition.Contains("https://foo.com/bar.txt"), "Sentiment model URI was not replaced!");
        }
        internal static List <IUIData> GetData(UserInfo UserInfo, PortalSettings PortalSetting, string Identifier)
        {
            Dictionary <string, IUIData> Settings = new Dictionary <string, IUIData>();
            string WorkFlowId       = Managers.SettingManager.GetValue(PortalSetting.PortalId, 0, AppFactory.Identifier.setting_workflow.ToString(), "WorkflowID", GetViews());
            int    WorkflowId       = string.IsNullOrEmpty(WorkFlowId) ? 0 : int.Parse(WorkFlowId);
            string ResourceFilePath = AppFactory.SharedResourceFile();

            Settings.Add("ddlWorkFlows", new UIData {
                Name = "ddlWorkFlows", Options = Managers.WorkflowManager.GetDDLWorkflow(PortalSetting.PortalId, false), OptionsText = "Text", OptionsValue = "Value", Value = WorkflowId.ToString()
            });
            Settings.Add("MaxRevisions", new UIData {
                Name = "MaxRevisions", Value = Managers.WorkflowManager.GetMaxRevisions().ToString()
            });
            Settings.Add("IsAdmin", new UIData {
                Name = "IsAdmin", Options = UserInfo.IsInRole("Administrators") || UserInfo.IsSuperUser
            });
            Settings.Add("WorkflowStateInfo", new UIData {
                Name = "WorkflowStateInfo", Value = Managers.WorkflowManager.GetWorkflowStatesInfo(WorkflowId)
            });
            Settings.Add("WorkflowId", new UIData {
                Name = "WorkflowId", Value = WorkflowId.ToString()
            });
            Core.Data.Entities.Workflow workflow      = Managers.WorkflowManager.GetWorkflow(WorkflowId);
            List <WorkflowState>        WorkflowState = Managers.WorkflowManager.GetWorkflowStates(WorkflowId);

            Settings.Add("Workflows", new UIData {
                Name = "Workflows", Options = Managers.WorkflowManager.GetAll(PortalSetting.PortalId, true)
            });
            Settings.Add("Workflow", new UIData {
                Name = "Workflow", Options = workflow
            });
            Settings.Add("WorkflowScope", new UIData {
                Name = "WorkflowScope", Options = Managers.WorkflowManager.GetAllWorkflowScope(ResourceFilePath), OptionsText = "Text", OptionsValue = "Value"
            });
            Settings.Add("WorkflowStates", new UIData {
                Name = "WorkflowStates", Options = WorkflowState
            });
            Settings.Add("workflowPermission", new UIData {
                Name = "workflowPermission", Options = Managers.WorkflowManager.GetPermission()
            });

            Settings.Add("Permissions", new UIData {
                Name = "Permissions", Options = Managers.WorkflowManager.GetWorkflowPermission(0, PortalSetting.PortalId)
            });
            return(Settings.Values.ToList());
        }
Example #23
0
        public static void Main(string[] args)
        {
            setConsoleOptions();

            var commandLineOptions = parseCommandLineOptions(args);

            initializeLogger(commandLineOptions.MinimumLogLevel, commandLineOptions.LogFile);

            var appConfig = loadConfigurationOrExitApplicationOnError(commandLineOptions.ConfigurationFile);

            var app = AppFactory.Create(appConfig);

            app.Start();

            Console.CancelKeyPress += (sender, e) => { app.Stop(); };

            Application.Run();
        }
Example #24
0
        public MenuPage()
        {
            _viewModel = AppFactory.GetInstance <MenuViewModel>();
            InitializeComponent();

            ListViewMenu.SelectedItem  = _viewModel.MenuItems[0];
            ListViewMenu.ItemSelected += (sender, e) =>
            {
                if (e.SelectedItem == null)
                {
                    return;
                }

                var id = ((HomeMenuItem)e.SelectedItem).Id;
                _viewModel.NavigateToCommand.Execute(id);
            };

            BindingContext = _viewModel;
        }
Example #25
0
        public void TestActionWithCommonController()
        {
            AppFactory            factory = new AppFactory(true);
            CommonControllerModel model   = new CommonControllerModel()
            {
                AppFactory = factory
            };
            CommonController commonController = new CommonController(model);
            UserInfo         info             = new UserInfo();

            info.ActionName = "Microsoft-MockAction";
            info.AppName    = "TestApp";
            var result = commonController.ExecuteAction(info, new ActionRequest()
            {
                DataStore = new DataStore()
            }).Result;

            Assert.IsTrue(result.Status == ActionStatus.Success);
        }
Example #26
0
        public App()
        {
            InitializeComponent();

            IAppServices services  = new AppServices();
            IAppFactory  factory   = new AppFactory();
            IMessenger   messenger = new Messenger();

            #region Locator
            ViewModelLocator.LoginViewModel = new LoginViewModel(services, factory, messenger);

            #endregion

            var loginView = new LoginView
            {
                BindingContext = ViewModelLocator.LoginViewModel
            };

            MainPage = loginView;
        }
Example #27
0
        protected override HttpClient OnCreateClient(AppFactory <Startup> factory)
        {
            var result = factory
                         .WithWebHostBuilder(b =>
            {
                b.ConfigureTestContainer <ContainerBuilder>(
                    cb =>
                {
                    cb.RegisterInstance(_urlMock.Value.Object).As <IUrlEncryptionSettings>();
                    cb.RegisterInstance(Profiler).As <IProfiler>();
                    cb.RegisterInstance(_platformSettingsMock.Value.Object).As <IPlatformSettings>();
                });
            })
                         .CreateClient(new WebApplicationFactoryClientOptions
            {
                AllowAutoRedirect = true,
            });

            result.Timeout = TimeSpan.FromHours(2);
            return(result);
        }
Example #28
0
        public IMemberApp Add(User creator, String name, int appinfoId)
        {
            //创建应用
            IApp app = AppFactory.Create(appinfoId, creator, AccessStatus.Public);

            // 创建控制面板中的 程序
            IMemberApp userApp = New();

            userApp.AppInfoId    = appinfoId;
            userApp.AppOid       = app.Id;
            userApp.OwnerId      = creator.Id;
            userApp.OwnerUrl     = creator.Url;
            userApp.OwnerType    = creator.GetType().FullName;
            userApp.Creator      = creator;
            userApp.CreatorUrl   = creator.Url;
            userApp.Name         = name;
            userApp.AccessStatus = (int)AccessStatus.Public;

            Insert(userApp);

            return(userApp);
        }
Example #29
0
        public virtual IMemberApp Add(User creator, IMember owner, string name, long appinfoId, AccessStatus accessStatus)
        {
            // 创建应用实例
            IApp app = AppFactory.Create(appinfoId, owner, accessStatus);

            // 创建控制面板中的 程序
            IMemberApp userApp = New();

            userApp.AppInfoId    = appinfoId;
            userApp.AppOid       = app.Id;
            userApp.OwnerId      = owner.Id;
            userApp.OwnerUrl     = owner.Url;
            userApp.OwnerType    = owner.GetType().FullName;
            userApp.Creator      = creator;
            userApp.CreatorUrl   = creator.Url;
            userApp.Name         = name;
            userApp.AccessStatus = (int)accessStatus;

            Insert(userApp);

            return(userApp);
        }
        public WizAltBoletimProfViewModel(Falta falta, BaseSingleton baseSingleton)
        {
            Falta = falta;
            Base_ = baseSingleton;

            Turmas = new ObservableCollection <TurmaFalta>();
            var t = new AppFactory().NewTurmaFalta();

            t.Turma            = falta.Turma;
            t.Falta.NFaltas    = falta.NFaltas;
            t.Professores      = new AppFactory().NewProfessor().Get(2);
            t.Professor        = falta.ProfSubs;
            t.Falta.NAulasSubs = falta.NAulasSubs;
            t.Selected         = true;


            Turmas.Add(t);

            SetProperties();

            Base_.HeaderWizard = "Alteração de Falta de Professor";
        }