Exemplo n.º 1
0
        public void ShouldCreateApplicationWithNationalComponentsFromCorrectVersion()
        {
            int nationalComponentMatrikkel = 42;
            int nationalComponentIdporten  = 47;

            var nationalComponentOther = 21;

            var common = new CommonApplication
            {
                Versions = new List <CommonApplicationVersion>()
                {
                    new CommonApplicationVersion()
                    {
                        VersionNumber = VersionNumber,
                        SupportedNationalComponents = new List <CommonApplicationVersionNationalComponent>()
                        {
                            new CommonApplicationVersionNationalComponent()
                            {
                                NationalComponentId = nationalComponentMatrikkel
                            },
                            new CommonApplicationVersionNationalComponent()
                            {
                                NationalComponentId = nationalComponentIdporten
                            }
                        }
                    },
                    new CommonApplicationVersion()
                    {
                        VersionNumber = "0.9-beta",
                        SupportedNationalComponents = new List <CommonApplicationVersionNationalComponent>()
                        {
                            new CommonApplicationVersionNationalComponent()
                            {
                                NationalComponentId = nationalComponentOther
                            },
                        }
                    }
                }
            };

            var app = common.CreateApplicationForOrganization(OrganizationId, VersionNumber);

            app.Version.Should().Be(VersionNumber);

            app.ApplicationNationalComponent
            .Any(anc => anc.NationalComponentId == nationalComponentIdporten)
            .Should().BeTrue();

            app.ApplicationNationalComponent
            .Any(anc => anc.NationalComponentId == nationalComponentMatrikkel)
            .Should().BeTrue();

            app.ApplicationNationalComponent
            .Any(anc => anc.NationalComponentId == nationalComponentOther)
            .Should().BeFalse();
        }
Exemplo n.º 2
0
        public async Task <Application> CreateApplicationForOrganization(int commonApplicationId, string versionNumber, int organizationId)
        {
            CommonApplication commonApplication = await Get(commonApplicationId);

            Application application = commonApplication.CreateApplicationForOrganization(organizationId, versionNumber);

            _context.Application.Add(application);
            await _context.SaveChangesAsync(_securityService.GetCurrentUser().FullName());

            return(application);
        }
Exemplo n.º 3
0
        public async Task SubmitApplication(int applicationId, int submittedOrganizationId, string submittedUserId)
        {
            var application = await _context.Application
                              .SingleOrDefaultAsync(a => a.Id == applicationId);

            CommonApplication commonApplication = application.CopyToCommonApplication();

            commonApplication.SubmittedByOrganizationId = submittedOrganizationId;
            commonApplication.SubmittedByUserId         = submittedUserId;

            _context.CommonApplications.Add(commonApplication);
            await _context.SaveChangesAsync();
        }
Exemplo n.º 4
0
        public void ShouldCreateApplicationWithoutDataset()
        {
            var common = new CommonApplication
            {
                Name     = Name,
                VendorId = VendorId,
                Id       = CommonApplicationId
            };

            var app = common.CreateApplicationForOrganization(OrganizationId, VersionNumber);

            app.Name.Should().Be(Name);
            app.VendorId.Should().Be(VendorId);
            app.OrganizationId.Should().Be(OrganizationId);
            app.CreatedFromCommonApplicationId.Should().Be(CommonApplicationId);
        }
Exemplo n.º 5
0
    public void GetDataSource(string ShipmentNo, string code)
    {
        string[] str = ShipmentNo.Split(new string[] { "◆" }, StringSplitOptions.RemoveEmptyEntries);
        LitNo = str[0].ToString();

        SqlParameter[] arParms = new SqlParameter[5];
        arParms[0]           = new SqlParameter("@UserCode", SqlDbType.VarChar, 10);
        arParms[0].Value     = CommonApplication.GetUserCode();
        arParms[1]           = new SqlParameter("@InOut", SqlDbType.VarChar, 20);
        arParms[1].Value     = code;
        arParms[2]           = new SqlParameter("@FPDepotInOutNo", SqlDbType.VarChar, 1000);
        arParms[2].Value     = ShipmentNo;
        arParms[3]           = new SqlParameter("@intRetVal", SqlDbType.Int, 4);
        arParms[3].Direction = ParameterDirection.ReturnValue;
        arParms[4]           = new SqlParameter("@strMessage", SqlDbType.VarChar, 50);
        arParms[4].Direction = ParameterDirection.Output;
        DataSet ds = Selection.exeProc("bp_pd_FPDepotPackDetail240", arParms);

        if (!arParms[3].Value.ToString().Trim().Equals("0"))
        {
            Response.Write("<script language=javascript>alert('" + arParms[4].Value.ToString().Trim() + "');window.returnValue='OK';parent.close();</script>");
            return;
        }

        if (ds.Tables[0].Rows.Count > 0)
        {
            NW     = ds.Tables[0].Rows[0]["总净重"].ToString().Trim();
            GW     = ds.Tables[0].Rows[0]["总重量"].ToString().Trim();
            ROLLS  = ds.Tables[0].Rows[0]["总匹数"].ToString().Trim();
            METERS = ds.Tables[0].Rows[0]["总米数"].ToString().Trim();
            planno = ds.Tables[0].Rows[0]["指示单号"].ToString().Trim();
            P_Code = ds.Tables[0].Rows[0]["产品号"].ToString().Trim();
        }
        if (ds.Tables[1].Rows.Count > 0)
        {
            jsonData = DataTableToJson(ds.Tables[1]);
        }
        Repeater1.DataSource = ds.Tables[4];
        Repeater1.DataBind();
    }
Exemplo n.º 6
0
    protected void FillTableInput(string name)
    {
        SqlParameter[] arParms = new SqlParameter[3];
        arParms[0]       = new SqlParameter("@guid", SqlDbType.VarChar, 32);
        arParms[0].Value = "17966DCFABE5470B9051FFF441511C9F";
        arParms[1]       = new SqlParameter("@usercode", SqlDbType.VarChar, 10);
        arParms[1].Value = CommonApplication.GetUserCode();
        arParms[2]       = new SqlParameter("@propName", SqlDbType.VarChar, 255);
        arParms[2].Value = name;
        TableInput1.FillTable("bp_sys_getPageConfigParam", arParms);
        //TableInput1.FillTableByHeaderString("项目◆");
        //设置列控件类型
        TableInput1.ColumnControlType = "1,1,1,1,3,1,1,1,1";//列中控件类型字符串组合(1-输入框,2-时间框,3-下拉框),中间以逗号分隔
        ////绑定下拉框数据源
        string sql1 = "select Code,Name from xc_Code where flag='MobileParam' and Valid='Y'";

        TableInput1.FillSelectBySql(sql1);                    //重量单位下拉框数据源
        //设置列读写类型
        TableInput1.ColumnPropertys   = "0,0,1,1,1,1,1,1,1";  // 列读写属性字符串组合(0-只读,1-读写),中间以逗号分隔
        TableInput1.ColumnHiddens     = "1,0,0,0,0,0,0,0,0";
        TableInput1.ColumnValidations = "0,0,0,13,0,0,0,0,0"; // 验证方式
        //设置列掩藏类型
        //设置列默认值
        TableInput1.ColumnDefaultValues = "◆我◆是◆5◆车◆王◆";//列默认值字符串组合(空-无默认值,其它-默认值),中间以◆分隔
        //复制列
        TableInput1.ColumnCopys = "0,1,1,0,0,0,0,0,0,0,0,0,0";
        //设置合计列
        TableInput1.ColumnSummaryString = "总订单数量◇3";//列合计字符串(显示合计名称1◇第几列◆显示合计名称2◇第几列),中间以◆分隔
        //设置计算列

        TableInput1.ColumnComputeFormulaString = "2,{5}={2}+{3}◆3,{5}={2}+{3}";
        //TableInput1.ColumnComputeFormulaString = "7,{8}=Math.round({7}/" + xs + ")◆7,{9}=Math.round({7}/" + xs + "/" + ps + ")◆7,{10}=Math.ceil({7}/" + xs + "/" + ps + "/" + juanshu + ")◆7,{11}=({7}/" + xs + "/" + ps + "/" + juanshu + ")";
        //设置复选
        //2◇../public/ChoosePlanProduct.aspx◇2,-1,5,6◆5◇../public/ChoosePlanProduct.aspx◇2,5,6
        //打开选择窗口的列 ◇ 连接窗口的地址 ◇ 返回值填充列(2[第0个返回值填充第2列],-1[第1个返回值不填充任何列],5[第2个返回值填充第5列],6[[第3个返回值填充第6列]])
        //TableInput1.ColumnChooseString = "3◇../../public/ChoosePlanProduct.aspx◇3,6,7,-1,-1,-1,-1";
        //设置列宽度
        //在TableInput1外面套一个父元素DIV,指定宽度,如果不指定,宽度默认为页面宽度,TableInput1的父元素width要大于TableInput1的宽度,否则会被压缩
        TableInput1.ColumnWidths = "50px,80px,130px,80px,60px,60px,70px,70px,70px,50px,70px,70px,70px";
    }
Exemplo n.º 7
0
        public void ShouldCreateApplicationWithDatasetWithoutFields()
        {
            var datasetName        = "DatasetName";
            var datasetDescription = "DatasetDescription";
            var datasetPurpose     = "DatasetPurpose";

            var common = new CommonApplication
            {
                Name           = Name,
                VendorId       = VendorId,
                CommonDatasets = new List <CommonDataset>
                {
                    new CommonDataset()
                    {
                        Name                     = datasetName,
                        Description              = datasetDescription,
                        Purpose                  = datasetPurpose,
                        HasPersonalData          = true,
                        HasSensitivePersonalData = true,
                        HasMasterData            = true
                    }
                }
            };

            var app = common.CreateApplicationForOrganization(OrganizationId, VersionNumber);

            app.Name.Should().Be(Name);
            app.VendorId.Should().Be(VendorId);
            app.ApplicationDatasets.Count.Should().Be(1);
            app.ApplicationDatasets[0].Dataset.Name.Should().Be(datasetName);
            app.ApplicationDatasets[0].Dataset.Description.Should().Be(datasetDescription);
            app.ApplicationDatasets[0].Dataset.Purpose.Should().Be(datasetPurpose);
            app.ApplicationDatasets[0].Dataset.HasPersonalData.Should().BeTrue();
            app.ApplicationDatasets[0].Dataset.HasSensitivePersonalData.Should().BeTrue();
            app.ApplicationDatasets[0].Dataset.HasMasterData.Should().BeTrue();
            app.ApplicationDatasets[0].Dataset.OrganizationId.Should().Be(OrganizationId);
        }
Exemplo n.º 8
0
        public void Initialize(CommonApplication application)
        {
            _tabManager.RegisterView(new ViewEntry(AppConstants.RadioManagerViewModelName, string.Empty, true));
            _tabManager.RegisterView(new ViewEntry(AppConstants.RadioPlayerViewModelName, string.Empty, true));

            MenuItemService.RegisterNotify(new GenericMenuItem(i =>
            {
                if (_programManager.MainWindow.IsVisible == false) _programManager.MainWindow.Show();
            }) {Id = "ViewMainWindow", Label = RadioStreamerResources.ViewMainWindowMenuLabel});

            MenuItemService.RegisterNotify(
                FillThemeMenu(new GenericMenuItem {Id = "ThemeMenu", Label = RadioStreamerResources.ThemeMenu}));
            MenuItemService.RegisterNotify(
                new GenericMenuItem(i => _programManager.ShowWindow(AppConstants.AddInViewModel, true))
                {
                    Label = RadioStreamerResources.ViewAddinManagerLabel
                });
            MenuItemService.RegisterNotify(
                new GenericMenuItem(i => _programManager.ShowWindow(AppConstants.OptionsViewModel, true))
                {
                    Label = RadioStreamerResources.ViewOptionsLabel
                });
            MenuItemService.RegisterNotify(new GenericMenuItem(i =>
            {
                _programManager.Shutdown = true;
                if (_programManager.MainWindow.IsVisible == true)
                    _programManager.MainWindow.Close();
                else
                    CommonApplication.Current.Shutdown();
            }) {Label = RadioStreamerResources.QuitLabel});

            string oGeneralRoot = RadioStreamerResources.OptionsPathGenral;
            string oPlayerRoot = RadioStreamerResources.OptionsPathPlayer;
            string oRecordingRoot = oPlayerRoot.CombinePath(RadioStreamerResources.OptionsPathRecording);
            string oEncoderRoot = oRecordingRoot.CombinePath(RadioStreamerResources.OptionsPathEncoder);

            _optionsManager.RegisterOption(oGeneralRoot,
                new Option(null, new CheckBoxHelper(StartWithWindowsOption), "StartWithWindows", false,
                    RadioStreamerResources.StartOnWindowsOtpion) {IsNameVisibly = false});

            _optionsManager.RegisterOption(oGeneralRoot,
                new Option(null, new CheckBoxHelper(null), "PlayAfterStart", false,
                    RadioStreamerResources.PlayAfterStartOption) {IsNameVisibly = false});

            _optionsManager.RegisterOption(oGeneralRoot,
                new Option(null, new CheckBoxHelper(AutoUpdateCallBack), "AutoUpdate", false,
                    RadioStreamerResources.AutoUpdateOption) {IsNameVisibly = false});

            _optionsManager.RegisterOption(oGeneralRoot,
                new Option(null, new CheckBoxHelper(null), "Minimizeintray", false,
                    RadioStreamerResources.MinimizeintrayOption) {IsNameVisibly = false});

            BuildDeviceOptions(oGeneralRoot);

            _optionsManager.RegisterOption(oPlayerRoot,
                new Option(null, new CheckBoxHelper(null), "Delete90SecTitles", true,
                    RadioStreamerResources.OptionsDelete90SecTitlesText) { IsNameVisibly = false });

            _optionsManager.RegisterOption(oRecordingRoot,
                new Option(null, new DefaultProfileHelper(), string.Empty, string.Empty,
                    RadioStreamerResources.DefaultProfileOptionName));

            _optionsManager.RegisterOption(oRecordingRoot,
                new Option(null, new TextBoxHelper(true, true, _dialogFactory), "RecodingPath", string.Empty,
                    RadioStreamerResources.OptionsRecordingPath));

            _optionsManager.RegisterOption(oRecordingRoot,
                new Option(null,
                    new ComboboxHelper(
                        new ComboboxHelperItem(nameof(FileExisBehavior.Override),
                            RadioStreamerResources.OptionsFileExisBehaviorOverrideText),
                        new ComboboxHelperItem(nameof(FileExisBehavior.ReName),
                            RadioStreamerResources.OptionsFileExisBehaviorRenameText),
                        new ComboboxHelperItem(nameof(FileExisBehavior.Skip),
                            RadioStreamerResources.OptionsFileExisBehaviorSkipText)), "FileExisBehavior",
                    nameof(FileExisBehavior.Override), RadioStreamerResources.OptionsFileExisBehavior));

            _optionsManager.RegisterOption(oEncoderRoot,
                new Option(null, new EncodingEditorHelper(), string.Empty,
                    ViewModelBase.ResolveViewModel(AppConstants.CommonEncoderUI), "ProfileOption")
                {
                    IsNameVisibly = false
                });

            CommandBinder.Register(ApplicationCommands.Save);

            CommandBinder.Register(MediaCommands.Play);
            CommandBinder.Register(MediaCommands.Stop);
            CommandBinder.Register(MediaCommands.Record);
            CommandBinder.Register(MediaCommands.MuteVolume);

            CommandBinder.Register(RadioStreamerResources.ViewMetadataLebel, "Metadata");
            CommandBinder.Register(RadioStreamerResources.AddFavoritesLabel, "AddFavorites");
            CommandBinder.Register(RadioStreamerResources.RemoveFavoritesLabel, "RemoveFavorites");

            SimpleLocalize.Register(RadioStreamerResources.ResourceManager, GetType().Assembly);
        }
 /// <summary>
 ///     Initializes a new instance of the <see cref="CommandLineProcessor" /> class.
 ///     Initialisiert eine neue Instanz der <see cref="CommandLineProcessor" /> Klasse.
 ///     Initializes a new instance of the <see cref="CommandLineProcessor" /> class.
 /// </summary>
 /// <param name="application">
 ///     The application.
 /// </param>
 public CommandLineProcessor([NotNull] CommonApplication application)
 {
     Contract.Requires<ArgumentNullException>(application != null, "application");
     _application = application;
     ParseCommandLine();
 }
Exemplo n.º 10
0
 public void Initialize(CommonApplication application)
 {
 }
Exemplo n.º 11
0
        public async Task <IActionResult> Details(int id)
        {
            CommonApplication commonApplication = await _appRegistry.Get(id);

            return(View(commonApplication));
        }
Exemplo n.º 12
0
 private void Init()
 {
     if (mParam == "{}")
     {
         DataSet ds = Selection.exeSql("select dConfig from bas_y2TableConfig where href='" + Request.RawUrl.ToString() + "' and userCode='" + CommonApplication.GetUserCode() + "' ");
         if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
         {
             mParam = ds.Tables[0].Rows[0]["dConfig"].ToString().Trim();
         }
     }
     if (mds != null && mds.Tables.Count > 0)
     {
         json = JsonConvert.SerializeObject(mds.Tables[0]);//DtSelectTop(100, mds.Tables[0])
         if (IsTotal)
         {
             if (mds.Tables.Count > 1 && mds.Tables[1].Rows.Count > 0)
             {
                 setSumCols(mds.Tables[1].Rows[0][0].ToString().Trim());
             }
         }
     }
 }
Exemplo n.º 13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (mParam == "{}")
     {
         DataSet ds = Selection.exeSql("select dConfig from bas_y2TableConfig where href='" + Request.RawUrl.ToString() + "' and userCode='" + CommonApplication.GetUserCode() + "' ");
         if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
         {
             mParam = ds.Tables[0].Rows[0]["dConfig"].ToString().Trim();
         }
     }
 }