Esempio n. 1
0
        ServiceSynchro.Article[] Articles = new ServiceSynchro.Article[] { }; //tous les articles (actifs)
        public Stock_user(int idUser)
        {
            //chargement du CurrentUser
            ServiceSynchro.ServiceSynchroClient ssc = new ServiceSynchro.ServiceSynchroClient();
            ServiceSynchro.User[] Allusers          = ssc.GetUsers(true);
            foreach (ServiceSynchro.User user in Allusers)
            {
                if (user.Id == idUser)
                {
                    CurrentUser = user;
                }
            }

            //téléchargement des données de la bdd au lancement
            Families = Synchro.DownloadFamilies();
            Articles = Synchro.DownloadArticles();

            InitializeComponent();

            //chargement des familles dans la combo
            foreach (ServiceSynchro.Family family in Families)
            {
                input_family.Items.Add(family);
            }
            input_family.DisplayMember = "name";
        }
Esempio n. 2
0
        private static string GetDocumentId <Tmodel>(this Synchro <Tmodel> model)
        {
            var db = ContextFactory.GetDBContext();

            var document = db.Documents.FirstOrDefault(d => d.DocumentType == model.Model.GetType());

            return(document != null ? document.ObjType : string.Empty);
        }
Esempio n. 3
0
        protected override void OnStartup(StartupEventArgs e)
        {
            try
            {
                Mutex.OpenExisting("InfoTask.Controller");
                MessageBox.Show("Нельзя запустить более одного контроллера одновременно");
                Current.Shutdown();
            }
            catch
            {
                if (new DbVersion().ACheck("Controller") < 1)
                {
                    Current.Shutdown();
                }
                Mutex = new Mutex(false, "InfoTask.Controller");
            }
            try
            {
                General.Initialize();
                Synchro        = new Synchro();
                MonitorHistory = new MonitorHistory
                {
                    Inf = SysTabl.ValueS(General.ControllerFile, "MonitorHistoryProps")
                };
                using (var rec = new ReaderAdo(General.ControllerFile, "SELECT * FROM Threads WHERE ApplicationType='Controller' ORDER BY ThreadId"))
                    while (rec.Read())
                    {
                        AddThread(rec);
                    }

                Window = new MainCalc();
                Window.Show();
                Window.App         = this;
                Window.DataContext = this;
            }
            catch (Exception ex)
            {
                ex.MessageError();
            }
        }
 public AnonymousClassLock1(Synchro enclosingInstance, bool locked, int waitTime)
 {
     this.enclosingInstance = enclosingInstance;
     this.locked = locked;
     this.waitTime = waitTime;
 }
Esempio n. 5
0
 private void btn_synchro_Click(object sender, EventArgs e)
 {
     Synchro.Upload(Articles, CurrentUser.Id);
     this.Close();
 }
 public AnonymousClassLock1(Synchro enclosingInstance, bool locked, int waitTime)
 {
     this.enclosingInstance = enclosingInstance;
     this.locked            = locked;
     this.waitTime          = waitTime;
 }
Esempio n. 7
0
 public static void UpgradeVersion <Tmodel>(Synchro <Tmodel> item)
 {
     var docId = item.GetDocumentId();
 }