Пример #1
0
        private async Task CheckForUpdates()
        {
            var   service    = DataServiceFactory.Create();
            var   appUrl     = String.Empty;
            float appVersion = 0;

            try
            {
                var appInfo = await service.GetAppInfoAsync("addin_office");

                appVersion = float.Parse(appInfo.version);
                appUrl     = appInfo.files.FirstOrDefault(f => f.name.StartsWith("wepo_addins_setup")).url;
            }
            catch (Exception)
            {
                //Silent exception;
            }

            var currentAppVersion = float.Parse(System.Configuration.ConfigurationManager.AppSettings.Get("AppVersion"));

            if (appVersion > currentAppVersion)
            {
                if (MessageBox.Show("Hay disponible una nueva versión de DokuFlex Addins for Office!\n\n ¿Desea descargarla?", "DokuFlex",
                                    MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                {
                    System.Diagnostics.Process.Start(appUrl);
                }
            }
        }
Пример #2
0
 public ProgressForm()
 {
     InitializeComponent();
     _log         = LogManager.GetLogger("FileImporter");
     _fileId      = string.Empty;
     _dataService = DataServiceFactory.Create();
 }
 public ImportFolderManager()
 {
     dataService = DataServiceFactory.Create();
     viewModel   = new ImportFolderViewModel(dataService)
     {
         Model = LoadModelFromStore()
     };
 }
Пример #4
0
 public AJImportController(ILoginService loginService, IMainForm mainForm)
 {
     this.loginService = loginService;
     dataService       = DataServiceFactory.Create();
     this.mainForm     = mainForm;
     ClearResources();
     InitialzeTempFolder();
 }
Пример #5
0
        public MainForm(string psFilename, string outputPdf, string documentDirectory)
        {
            InitializeComponent();

            this._psFilename  = psFilename;
            this._outputPdf   = outputPdf;
            this._documentDir = documentDirectory;
            this._dataService = DataServiceFactory.Create();
        }
Пример #6
0
 public ImportTextManager()
 {
     log         = LogManager.GetLogger(GetType());
     dataService = DataServiceFactory.Create();
     viewModel   = new ImportTextViewModel(dataService)
     {
         Model = new ImportTextModel()
     };
 }
Пример #7
0
        public MainForm(string inputFile)
        {
            InitializeComponent();

            var fileName = String.Format("{0}.pdf", DateTime.Now.ToString("s").Replace(":", String.Empty));

            _inputFile   = inputFile;
            _outputFile  = String.Format("{0}\\{1}", System.IO.Path.GetTempPath(), fileName);
            _dataService = DataServiceFactory.Create();
        }
Пример #8
0
        public DownloadProgressForm(string sessionId, string communityId, string folderPath, ref List <FileFolder> files)
        {
            InitializeComponent();

            // TODO: Complete member initialization
            this.dataService = DataServiceFactory.Create();
            this.sessionId   = sessionId;
            this.communityId = communityId;
            this.folderPath  = folderPath;
            this.files       = files;
        }
Пример #9
0
        public UploadProgressForm(string ticketId, string communityId,
                                  string folderId, string folderName, string[] paths)
        {
            InitializeComponent();

            this.uploadDirectory = false;
            this.dataService     = DataServiceFactory.Create();
            this.ticketId        = ticketId;
            this.communityId     = communityId;
            this.folderId        = folderId;
            this.folderName      = folderName;
            this.paths           = paths;
            this.taskCanceled    = false;
        }
Пример #10
0
        public BOBase(UserInfo userInfo)
        {
            this.MyUserInfo  = userInfo;
            this.UserSite    = this.MyUserInfo.SiteCode;
            this.UserBU      = this.MyUserInfo.BUCode;
            this.UserLang    = this.MyUserInfo.Lang;
            this.UserCode    = this.MyUserInfo.UserCode;
            this.IsAdmin     = this.MyUserInfo.IsAdmin;
            this.UserID      = this.MyUserInfo.UserID;
            this.TokenString = this.MyUserInfo.TokeString;
            this.StationID   = this.MyUserInfo.StationID;
            this.Line        = this.MyUserInfo.Line;
            this.Mac         = this.MyUserInfo.Mac;
            this.IP          = this.MyUserInfo.IP;

            DBContext = DataServiceFactory.Create(this.UserSite + this.UserBU);
        }
Пример #11
0
        public void LogError(Exception exception)
        {
            if (exception != null)
            {
                var messageToTrace = string.Format(CultureInfo.InvariantCulture, exception.Message);

                var exceptionData = exception.ToString(); // The ToString() create a string representation of the current exception

                _log.Error(String.Format(CultureInfo.InvariantCulture, "{0} Exception:{1}", messageToTrace, exceptionData));

                //Enviar al server
                Assembly     asm  = exception.TargetSite.Module.Assembly;
                AssemblyName name = asm.GetName();

                DataServiceFactory.Create().SendAppLog(string.Empty, string.Empty, name.Name + " " + name.Version.ToString(), string.Empty, exception.Source, exception.ToString(), exception.StackTrace);
            }
        }
Пример #12
0
        public async Task <bool> LoginAsync()
        {
            var dataService = DataServiceFactory.Create();

            try
            {
                var credentials = new Credentials();
                credentials.UserName = UserName;
                credentials.Password = Password;
                Token = await dataService.LoginAsync(credentials);
            }
            catch (Exception ex)
            {
                _log.Error($"'LoginAsync' call fails", ex);
                Token = string.Empty;
            }
            return(!string.IsNullOrWhiteSpace(Token));
        }
Пример #13
0
        public static async Task <string> GetTikectAsync()
        {
            var ticket      = String.Empty;
            var credentials = new Credentials();

            credentials.UserName = ConfigurationManager.GetValue(Constants.LoginUserName);

            if (String.IsNullOrWhiteSpace(credentials.UserName))
            {
                using (var form = new LoginForm())
                {
                    if (form.ShowLoginDialog())
                    {
                        ticket = form.Ticket;
                    }
                }

                return(ticket);
            }

            credentials.SetEncryptedPassword(ConfigurationManager.GetValue(Constants.LoginPassword));

            try
            {
                ticket = await DataServiceFactory.Create().LoginAsync(credentials);
            }
            catch (AggregateException)
            {
                //silent exception
            }

            if (String.IsNullOrWhiteSpace(ticket))
            {
                using (var form = new LoginForm())
                {
                    if (form.ShowLoginDialog())
                    {
                        ticket = form.Ticket;
                    }
                }
            }

            return(ticket);
        }
Пример #14
0
        protected override async void OnLoad(EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;

            try
            {
                var ticket = await Session.GetTikectAsync();

                var results = await DataServiceFactory.Create().ListProcessesAsync(ticket);

                foreach (var item in results)
                {
                    if (item.active == 1)
                    {
                        AddToListView(item);
                    }
                }
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Пример #15
0
 public static PubHelper GetHelper()
 {
     return(new PubHelper(DataServiceFactory.Create(BLLConstants.SITE_DEFAULT + BLLConstants.BU_DEFAULT)));
 }
Пример #16
0
        public MainForm()
        {
            InitializeComponent();

            _dataService = DataServiceFactory.Create();
        }
Пример #17
0
 private ConstantsHelper()
 {
     this.DBContext = DataServiceFactory.Create(_site + _bu);
 }
Пример #18
0
 private ConstantsHelper(string site, string bu)
 {
     _site          = string.IsNullOrEmpty(site)?BLLConstants.SITE_DEFAULT:site;
     _bu            = string.IsNullOrEmpty(bu)?BLLConstants.BU_DEFAULT:bu;
     this.DBContext = DataServiceFactory.Create(_site + _bu);
 }
 public UploadManager()
 {
     log         = LogManager.GetLogger(GetType());
     dataService = DataServiceFactory.Create();
     queue       = new Queue <Tuple <string, List <DokuField> > >();
 }
Пример #20
0
 public static DataContext GetDB(UserInfo ui)
 {
     return(DataServiceFactory.Create(ui.SiteCode + ui.BUCode));
 }