Exemple #1
0
        /// <summary>
        /// Hidden constructor
        /// </summary>
        private Resource()
        {
            try
            {
                var app = new AppSetting();
                lang = app.Language;
            }
            catch { }

            switch (lang)
            {
                case Languages.pl:
                    {
                        resource = (new LearnByError.Internazional.Lang.Polish()).Resource;
                    }break;
                case Languages.en:
                    {
                        resource = (new LearnByError.Internazional.Lang.English()).Resource;
                    }break;
                default:
                    {
                        resource = (new LearnByError.Internazional.Lang.English()).Resource;
                    }break;
            }
        }
Exemple #2
0
 public WebConfigParser(string fileName)
 {
     _xmlDoc = new XmlDocument();
     _xmlDoc.Load(fileName);
     _appSettings = new AppSetting(_xmlDoc);
     _connStrings = new ConnectionString(_xmlDoc);
 }
        public AppSetting Create(AppSetting entity)
        {
            DomainObjectValidator.ThrowIfInvalid(entity);
            var existingEntity = FindByName(entity.Name);
            if (existingEntity != null)
                throw new InvalidOperationException("The setting already exists.");

            entity = context.AppSettings.Add(entity);
            clearCache();
            return entity;
        }
Exemple #4
0
 public AppSettingDescriptor(AppSetting coll, Attribute[] attrs)
     : base(coll.Key, attrs)
 {
     this.ass = coll;
 }
 public AppSettingDto(AppSetting appSetting)
 {
     _SettingKey = appSetting.ID;
     _SettingValue = appSetting.SettingValue;
 }
        private void FormStructureManagement_Load(object sender, EventArgs e)
        {
            this.AppSetting = appSettingXml.Load();
            LoadStructure();

            EditMode(false);
            bsListStructure.DataSource = sourceStructures;
            bsListStructure.CurrentChanged += bsListStructure_CurrentChanged;
            listStructure.DataSource = bsListStructure;
            listStructure.DisplayMember = "Name";
            gridPropertyTemplate.AutoGenerateColumns = false;
            gridPropertyTemplate.DataSource = bsPropertyTemplate;
        }
Exemple #7
0
 public EventController(IEvent ievent, IMapper mapper, IOptions <AppSetting> appSettingsOptions)
 {
     this.appSettings = appSettingsOptions.Value;
     this._ievent     = ievent;
     this.mapper      = mapper;
 }
Exemple #8
0
    private void form2obj(AppSetting obj)
    {
        obj.KeySet = DropKeySet.SelectedValue;
        obj.KeyName = TxtKeyName.Text;
        obj.KeyTitle = TxtKeyTitle.Text;
        //obj.KeyValue = TxtKeyValue.Text;
        obj.KeyInfo = TxtKeyInfo.Text;

        obj.KeyValue = FormBuilder.GetControlValue(this.CurrentXmlType, PanelValue);
    }
Exemple #9
0
 public void Remove(AppSetting ddz)
 {
     this.List.Remove(ddz);
 }
 public AppSetting Update(AppSetting entity)
 {
     DomainObjectValidator.ThrowIfInvalid(entity);
     clearCache();
     return entity;
 }
Exemple #11
0
    /*
     * required: app_key
     */
    public void Authorize(RequestParams rp)
    {
        string url = AppSetting.getInstance().serverUrl + "/api/authorize";

        StartCoroutine(NetUtil.Post(url, rp.data, rp.callback));
    }
 public UserClient(AppSetting configuration)
 {
     ApiEndPoint = configuration.PGTData + "/api/User";
 }
        /// <summary>
        /// 获取 WeaponList 全部数据
        /// </summary>
        /// Create By zhouqi
        /// 2015/11/26 18:03:57
        /// <returns></returns>
        public List <WeaponUserList> GetWeaponAllUserList(ref DataPage dp, WeaponUserList weaponuserlist)
        {
            DbCommand             cmd            = DB.GetStoredProcCommand("WeaponList_GetAllUsers");
            string                websitepath    = AppSetting.GetString("WebsitePath");
            List <WeaponUserList> weaponListList = new List <WeaponUserList>();

            //翻页参数
            DB.AddInParameter(cmd, DataPage.PageSizeField, DbType.Int32, dp.PageSize);
            DB.AddInParameter(cmd, DataPage.PageIndexField, DbType.Int32, dp.PageIndex);
            DB.AddParameter(cmd, DataPage.RowCountField, DbType.Int64, ParameterDirection.InputOutput, String.Empty, DataRowVersion.Default, dp.RowCount);
            DB.AddInParameter(cmd, WeaponUserList.AreaIDField, DbType.Int32, weaponuserlist.AreaID);
            DB.AddInParameter(cmd, WeaponUserList.StatusIDField, DbType.Int32, weaponuserlist.StatusID);
            DB.AddInParameter(cmd, WeaponUserList.UserIDField, DbType.Int64, weaponuserlist.UserID);
            DB.AddInParameter(cmd, WeaponUserList.WeaponNameField, DbType.String, weaponuserlist.WeaponName);
            using (IDataReader dr = DB.ExecuteReader(cmd))
            {
                if (dr.FieldCount > 0)
                {
                    int coWeaponID      = dr.GetOrdinal(WeaponUserList.WeaponIDField);
                    int coWeaponName    = dr.GetOrdinal(WeaponUserList.WeaponNameField);
                    int coContactMethod = dr.GetOrdinal(WeaponUserList.ContactMethodField);
                    int coWeaponDesc    = dr.GetOrdinal(WeaponUserList.WeaponDescField);
                    int coShowPraise    = dr.GetOrdinal(WeaponUserList.ShowPraiseField);
                    int coPicAddress    = dr.GetOrdinal(WeaponUserList.PicAddressField);
                    int coSpicAddress   = dr.GetOrdinal(WeaponUserList.SpicAddressField);
                    int coLength        = dr.GetOrdinal(WeaponUserList.LengthField);
                    int coWidth         = dr.GetOrdinal(WeaponUserList.WidthField);
                    int coSLength       = dr.GetOrdinal(WeaponUserList.SLengthField);
                    int coSWidth        = dr.GetOrdinal(WeaponUserList.SWidthField);
                    int coCreateTS      = dr.GetOrdinal(WeaponUserList.CreateTSField);
                    int coUpdateTS      = dr.GetOrdinal(WeaponUserList.UpdateTSField);
                    int coStatusID      = dr.GetOrdinal(WeaponUserList.StatusIDField);
                    int coAvatarName    = dr.GetOrdinal(WeaponUserList.AvatarNameField);
                    int coAreaName      = dr.GetOrdinal(WeaponUserList.AreaNameField);
                    int coStatusType    = dr.GetOrdinal(WeaponUserList.StatusTypeField);
                    int coUserID        = dr.GetOrdinal(WeaponUserList.UserIDField);
                    int coReason        = dr.GetOrdinal(WeaponUserList.ReasonField);
                    int coWeaType       = dr.GetOrdinal(WeaponUserList.WeaTypeField);
                    int coAreaID        = dr.GetOrdinal(WeaponUserList.AreaIDField);
                    int coLoginName     = dr.GetOrdinal(WeaponUserList.LoginNameField);
                    int coFistName      = dr.GetOrdinal(WeaponUserList.FirstNameField);
                    int coGender        = dr.GetOrdinal(WeaponUserList.GenderField);
                    while (dr.Read())
                    {
                        WeaponUserList weaponuserList = new WeaponUserList();
                        weaponuserList.WeaponID      = dr.IsDBNull(coWeaponID) ? (int)0 : dr.GetInt32(coWeaponID);
                        weaponuserList.WeaponName    = dr.IsDBNull(coWeaponName) ? string.Empty : dr.GetString(coWeaponName);
                        weaponuserList.ContactMethod = dr.IsDBNull(coContactMethod) ? string.Empty : dr.GetString(coContactMethod);
                        weaponuserList.WeaponDesc    = dr.IsDBNull(coWeaponDesc) ? string.Empty : dr.GetString(coWeaponDesc);
                        weaponuserList.ShowPraise    = dr.IsDBNull(coShowPraise) ? (int)0 : dr.GetInt32(coShowPraise);
                        weaponuserList.PicAddress    = dr.IsDBNull(coPicAddress) ? string.Empty : (websitepath + dr.GetString(coPicAddress));
                        weaponuserList.SpicAddress   = dr.IsDBNull(coSpicAddress) ? string.Empty : (websitepath + dr.GetString(coSpicAddress));
                        weaponuserList.Length        = dr.IsDBNull(coLength) ? (int)0 : dr.GetInt32(coLength);
                        weaponuserList.Width         = dr.IsDBNull(coWidth) ? (int)0 : dr.GetInt32(coWidth);
                        weaponuserList.SLength       = dr.IsDBNull(coSLength) ? (int)0 : dr.GetInt32(coSLength);
                        weaponuserList.SWidth        = dr.IsDBNull(coSWidth) ? (int)0 : dr.GetInt32(coSWidth);
                        weaponuserList.CreateTS      = dr.IsDBNull(coCreateTS) ? (DateTime)SqlDateTime.Null : dr.GetDateTime(coCreateTS);
                        weaponuserList.UpdateTS      = dr.IsDBNull(coUpdateTS) ? (DateTime)SqlDateTime.Null : dr.GetDateTime(coUpdateTS);
                        weaponuserList.StatusID      = dr.IsDBNull(coStatusID) ? (int)0 : dr.GetInt32(coStatusID);
                        weaponuserList.AvatarName    = dr.IsDBNull(coAvatarName) ? string.Empty : dr.GetString(coAvatarName);
                        weaponuserList.AreaName      = dr.IsDBNull(coAreaName) ? string.Empty : dr.GetString(coAreaName);
                        weaponuserList.StatusType    = dr.IsDBNull(coStatusType) ? string.Empty : dr.GetString(coStatusType);
                        weaponuserList.UserID        = dr.IsDBNull(coUserID) ? (long)0 : dr.GetInt64(coUserID);
                        weaponuserList.Reason        = dr.IsDBNull(coReason) ? string.Empty : dr.GetString(coReason);
                        weaponuserList.WeaType       = dr.IsDBNull(coWeaType) ? string.Empty : dr.GetString(coWeaType);
                        weaponuserList.AreaID        = dr.IsDBNull(coAreaID) ? (int)0 : dr.GetInt32(coAreaID);
                        weaponuserList.LoginName     = dr.IsDBNull(coLoginName) ? string.Empty : dr.GetString(coLoginName);
                        weaponuserList.FirstName     = dr.IsDBNull(coFistName) ? string.Empty : dr.GetString(coFistName);
                        weaponuserList.Gender        = dr.IsDBNull(coGender) ? string.Empty : dr.GetString(coGender);
                        weaponListList.Add(weaponuserList);
                    }
                }
            }
            //获取翻页
            dp.RowCount = Convert.ToInt64(DB.GetParameterValue(cmd, DataPage.RowCountField));
            return(weaponListList);
        }
Exemple #14
0
 public void SaveInput(ConnElement ce)
 {
     AppSetting.UpdateAppConfig("ip", ce.ip);
     AppSetting.UpdateAppConfig("db", ce.db);
     AppSetting.UpdateAppConfig("user", ce.user);
 }
 public MovementRequestProcces(IOptions <AppSetting> serviceSettings) : base(serviceSettings)
 {
     _serviceSettings = serviceSettings.Value;
 }
Exemple #16
0
 public ParentAppSetting(AppSetting appSetting)
 {
     DisplayKey = appSetting.DisplayKey;
     Key        = appSetting.Key;
     Value      = appSetting.Value;
 }
 public static void AddDomains(this IServiceCollection services, AppSetting appSetting = null)
 {
     services.AddSingleton <ConnectionPool>();
 }
        public ICollection<AppSetting> GetAppSettings()
        {
            ICollection<AppSetting> _returnResults = new List<AppSetting>();
            UsingContext(ctx =>
            {
                Stopwatch _timespan = Stopwatch.StartNew();
                try
                {
                    var _web = ctx.Web;
                    ctx.Load(_web);
                    if (!_web.ListExists(SPDataConstants.LIST_TITLE_APPSETTINGS))
                    {
                        var _message = String.Format("The List {0} does not exist in Site {1}",
                         SPDataConstants.LIST_TITLE_APPSETTINGS,
                         ctx.Url);

                        Log.Fatal("SPAppSettingsManager.GetAppSettings", _message);
                        throw new DataStoreException(_message);
                    }

                    var _camlQuery = CamlQuery.CreateAllItemsQuery();

                    var _list = ctx.Web.Lists.GetByTitle(SPDataConstants.LIST_TITLE_APPSETTINGS);
                    var _listItemCollection = _list.GetItems(_camlQuery);
                    ctx.Load(_listItemCollection,
                        eachItem => eachItem.Include(
                            item => item,
                            item => item["ID"],
                            item => item["SP_Key"],
                            item => item["SP_Value"],
                            item => item["SP_Description"]));
                    ctx.ExecuteQuery();

                    _timespan.Stop();
                    Log.TraceApi("SharePoint", "SPAppSettingsManager.GetAppSettings", _timespan.Elapsed);

                    foreach (ListItem _item in _listItemCollection)
                    {
                        var _setting = new AppSetting()
                        {
                            Id = _item.BaseGetInt("ID"),
                            Key = _item.BaseGet("SP_Key"),
                            Value = _item.BaseGet("SP_Value"),
                            Description = _item.BaseGet("SP_Description")
                        };
                        _returnResults.Add(_setting);
                    }

                }
                catch (ServerException ex)
                {
                    //TODO LOG
                }
                catch (DataStoreException ex)
                {
                    throw;
                }

            });
            return _returnResults;
        }
 public void Delete(AppSetting entity)
 {
     context.AppSettings.Remove(entity);
     clearCache();
 }
Exemple #20
0
 public void Add(AppSetting ddz)
 {
     this.List.Add(ddz);
 }
        public void Update(int Id,string AppName,bool? Active,string AppSummary)
        {
            AppSetting item = new AppSetting();
            item.MarkOld();
            item.IsLoaded = true;

            item.Id = Id;

            item.AppName = AppName;

            item.Active = Active;

            item.AppSummary = AppSummary;

            item.Save(UserName);
        }
 public Thread AutoDispatching(IWebDriver driver, AppSetting appSetting, bool dispatch, Main form)
 {
     return(new Thread(async() => await AutoDispatch(driver, appSetting, dispatch, form)));
 }
Exemple #23
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        LblErr.Text = "";
        LblOk.Text = "";

        try
        {
            var man = new AppSettingsManager2();
            var item = new AppSetting();

            string keySet = getKeySetFromArgument(this.CurrentKey);
            string keyName = getKeyNameFromArgument(this.CurrentKey);

            item = man.GetByKey(keySet, keyName);

            form2obj(item);
            if (string.IsNullOrEmpty(keyName))
            {
                item = man.Insert(item);
            }
            else
            {
                man.Update(item);
            }
            loadGroupsList(item.KeySet);
            LblOk.Text = RenderSuccess(Utility.GetLabel("RECORD_SAVED_MSG"));
            MultiView1.ActiveViewIndex = 0;
        }
        catch (Exception e1)
        {
            LblErr.Text = RenderError(Utility.GetLabel("RECORD_ERR_MSG") + "<br />" + e1.ToString());
        }
        finally
        {
        }
    }
Exemple #24
0
 public SQLAccess(ILogger <SQLAccess> logger, IOptions <AppSetting> appSetting)
 {
     _logger     = logger;
     _appSetting = appSetting.Value;
 }
 public App(IOptions <AppSetting> config, TimeService service)
 {
     _config  = config.Value;
     _service = service;
 }
Exemple #26
0
 public JwtService(IOptions <AppSetting> appSetting)
 {
     _appSetting = appSetting.Value;
 }
 private void FormAppSetting_Load(object sender, EventArgs e)
 {
     this.appSetting = xmlData.Load();
     textLocation.Text = this.appSetting.ProfilePath;
 }
        public void Insert(string AppName,bool? Active,string AppSummary)
        {
            AppSetting item = new AppSetting();

            item.AppName = AppName;

            item.Active = Active;

            item.AppSummary = AppSummary;

            item.Save(UserName);
        }
Exemple #29
0
 public bool Delete(AppSetting appSetting)
 {
     return(Delete(appSetting.Id));
 }
Exemple #30
0
    private void editRow(string keySet, string keyName)
    {
        LblOk.Text = "";
        LblErr.Text = "";

        var man = new AppSettingsManager2();
        var obj = new AppSetting();

        clearForm();
        this.currentXmlType = null;
        this.CurrentKey = keySet + "|" + keyName;
        if (keyName != string.Empty)
        {
            obj = man.GetByKey(keySet, keyName);
            DropKeySet.Enabled = false;
            TxtKeyName.Enabled = false;
        }
        else
        {
            DropKeySet.Enabled = true;
            TxtKeyName.Enabled = true;
        }
        obj2form(obj);

        MultiView1.ActiveViewIndex = 1;
    }
Exemple #31
0
 public UserManager(IOptions <AppSetting> appSettings)
 {
     _appSettings = appSettings.Value;
     basemanager  = new BaseManager();
 }
Exemple #32
0
    private void obj2form(AppSetting obj)
    {
        Utility.SetDropByValue(DropKeySet, obj.KeySet);
        TxtKeyName.Text = obj.KeyName;
        TxtKeyTitle.Text = obj.KeyTitle;
        //TxtKeyValue.Text = obj.KeyValue;
        TxtKeyInfo.Text = obj.KeyInfo;

        PanelValue.Controls.Clear();
        Control control2Add = FormBuilder.RenderControl(
            this.CurrentXmlType, obj.KeyValue, "form-control");
        PanelValue.Controls.Add(control2Add);
    }
Exemple #33
0
 public SettingsModule(ProgramState currentState, AppSetting settings) : base(currentState)
 {
     _settings = settings;
     _knownsettings = FillKnownSettings();
 }