Exemplo n.º 1
0
        /// <summary>
        /// 过滤非法应用
        /// </summary>
        /// <returns></returns>
        public ResultDTO ForbitAppExt()
        {
            try
            {
                var deleteCount = 0;
                var updateCount = 0;
                var appIdList   = new List <Guid>();
                foreach (var item in AppSet.ObjectSet())
                {
                    var app = APPSV.Instance.GetNewAppById(item.AppId.Value);
                    if (app == null)
                    {
                        continue;
                    }
                    if (app.Illegal == 1)
                    {
                        item.EntityState = EntityState.Deleted;
                        ContextFactory.CurrentThreadContext.SaveObject(item);
                        appIdList.Add(item.AppId.Value);
                        deleteCount++;
                    }
                    else if (app.Illegal == 0)
                    {
                        if (item.AppName != app.Name || item.AppIcon != app.Icon)
                        {
                            item.AppName     = app.Name;
                            item.AppIcon     = app.Icon;
                            item.EntityState = EntityState.Modified;
                            ContextFactory.CurrentThreadContext.SaveObject(item);
                            updateCount++;
                        }
                    }
                }

                var comIds = Commodity.ObjectSet()
                             .Where(e => appIdList.Contains(e.AppId) && e.CommodityType == 0)
                             .Select(e => e.Id)
                             .ToList();
                var query = SetCommodityCategory.ObjectSet().Where(e => comIds.Contains(e.CommodityId));
                foreach (var item in query)
                {
                    item.EntityState = EntityState.Deleted;
                    ContextFactory.CurrentThreadContext.SaveObject(item);
                }

                ContextFactory.CurrentThreadContext.SaveChanges();
                var retMsg = string.Format("共有{0}个App被删除,共有{1}个App被修改", deleteCount, updateCount);
                return(new ResultDTO {
                    ResultCode = 0, Message = retMsg
                });
            }
            catch (Exception ex)
            {
                LogHelper.Error("AppManageBP-ForbitAppExt", ex);
                return(new ResultDTO {
                    ResultCode = -1, Message = ex.Message
                });
            }
        }
Exemplo n.º 2
0
        // GET: MyApps
        public ActionResult Index()
        {
            var mal = new AppSet();

            mal.Apps.Add(new App("Home Network", null, "https://seayside.net:8443/manage/site/default/dashboard"));
            mal.Apps.Add(new App("Sonic Boom", null, "https://app.sbwell.com/home"));
            return(View(mal));
        }
Exemplo n.º 3
0
        public void Save()
        {
            AppSet appSet = AppSet.Load();

            appSet.AppearanceStyle = this.comboBox1.Text;

            appSet.Save();
        }
        public void Save()
        {
            AppSet appSet = AppSet.Load();

            appSet.KeyboardInputIndex = this.comboBox1.SelectedIndex;

            appSet.Save();
        }
Exemplo n.º 5
0
        private void textBox1_Enter(object sender, EventArgs e)
        {
            AppSet appSet = AppSet.Load();

            //InputLanguage.CurrentInputLanguage = InputLanguage.InstalledInputLanguages[2];
            if (0 < appSet.KeyboardInputIndex)
            {
                InputLanguage.CurrentInputLanguage = InputLanguage.InstalledInputLanguages[appSet.KeyboardInputIndex];
            }
        }
Exemplo n.º 6
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            notifyIcon.Icon    = this.Icon;
            notifyIcon.Text    = this.Text;
            notifyIcon.Visible = true;

            Core.CoreData[CoreDataType.ApplicationForm] = this;

            AppSet appSet = AppSet.Load();

            this.Text = appSet.CompanyName;
        }
Exemplo n.º 7
0
        private void ly_worker_listDataGridView_CellEnter(object sender, DataGridViewCellEventArgs e)
        {
            if (4 == e.ColumnIndex || 8 == e.ColumnIndex)
            {
                AppSet appSet = AppSet.Load();

                if (0 < appSet.KeyboardInputIndex)
                {
                    InputLanguage.CurrentInputLanguage = InputLanguage.InstalledInputLanguages[appSet.KeyboardInputIndex];
                }
            }
        }
        //public ClientRepository(ILogger log)
        //{
        //    this.log = log;
        //}

        public static void MakeJsonFile(List <Clients> list)
        {
            string path = AppSet.AppTxts("pathC");

            if (!File.Exists(path))
            {
                string alumJson = JsonUtilities <Clients> .ToSerializeObject(list);

                using (StreamWriter sw = File.CreateText(path))
                    sw.WriteLine(alumJson);
            }
        }
 static void Main(string[] args)
 {
     AppSet.SetUp();
     if (AppSet.ValidationConfig)
     {
         dispatcher = new AirDispatcher();
         while (string.IsNullOrEmpty(dispatcher.IamToken))
         {
         }
         Timer t = new Timer(TimerCallback, null, 0, 2000);
         Console.WriteLine("Waiting for a task...............");
     }
     Console.ReadKey(true);
 }
Exemplo n.º 10
0
        public void SaveComanyName()
        {
            AppSet appSet = AppSet.Load();

            AppSet.companyName       = this.companyNametextBox.Text;
            AppSet.companySimpleName = this.companySimpleNametextBox.Text;
            AppSet.countday          = this.countdaycomboBox.Text;
            AppSet.getdayaccrual     = this.getdayaccrualcomboBox.Text;

            AppSet.use_postponed  = this.use_postponed_checkBox.Checked;
            AppSet.auto_postponed = this.auto_postponed_checkBox.Checked;

            AppSet.countlineDate = this.dateTimePicker1.Value.Date;

            appSet.Save();
        }
Exemplo n.º 11
0
        public CompanySetExtensionUI_Control()
        {
            InitializeComponent();

            Text   = "基本参数";
            appSet = AppSet.Load();
            this.companyNametextBox.Text       = AppSet.companyName;
            this.companySimpleNametextBox.Text = AppSet.companySimpleName;
            this.countdaycomboBox.Text         = AppSet.countday;
            this.getdayaccrualcomboBox.Text    = AppSet.getdayaccrual;

            this.use_postponed_checkBox.Checked  = AppSet.use_postponed;
            this.auto_postponed_checkBox.Checked = AppSet.auto_postponed;

            this.dateTimePicker1.Value = AppSet.countlineDate;
        }
        public IndividualSetExten_KeyboardInputIndex()
        {
            InitializeComponent();

            Text = "中文输入法";

            InputLanguageCollection ilc = InputLanguage.InstalledInputLanguages;

            foreach (InputLanguage il in ilc)
            {
                comboBox1.Items.Add(il.LayoutName);
            }

            AppSet appSet = AppSet.Load();

            this.comboBox1.SelectedIndex = appSet.KeyboardInputIndex;
        }
Exemplo n.º 13
0
        public static HttpResponseMessage GetDataWeb(string uri)
        {
            HttpResponseMessage response = null;

            try
            {
                response = GlobalVariable.client.GetAsync(
                    AppSet.AppTxts(uri)).Result;
            }
            catch (HttpRequestException ex)
            {
                //Loggin.LogError(ex.Message);
                //Loggin.LogError(ex.StackTrace);
                throw new VuelingException(Resource1.E_HTTP, ex.InnerException);
            }
            catch (ArgumentNullException ex)
            {
                //Loggin.LogError(ex.Message);
                //Loggin.LogError(ex.StackTrace);
                throw new VuelingException(Resource1.E_ARG, ex.InnerException);
            }
            return(response);
        }
Exemplo n.º 14
0
        private void IndividualSetExtensionUI_Style_Load(object sender, EventArgs e)
        {
            AppSet appSet = AppSet.Load();

            this.comboBox1.Text = appSet.AppearanceStyle;
        }