public MainWindow() { InitializeComponent(); #if !DEBUG this.Activated += window_Activated; this.Deactivated += window_Deactivated; #endif try { string[] args = Environment.GetCommandLineArgs(); if (args.Length < 3) { throw new Exception("Nombre d'argument insuffisant"); } BaseCialAbstract.setDefaultParams(args[1], args[2]); doPiece = args[3]; repos = new LockRepository(); Title = $"Activer/Désactiver doc {doPiece}"; IsVerrou = repos.isVerrou(doPiece); updateUi(); } catch (Exception e) { Debug.Print(e.ToString()); MessageBox.Show(e.ToString()); } }
public MainViewModel() { try { if (System.ComponentModel.LicenseManager.UsageMode == System.ComponentModel.LicenseUsageMode.Designtime) { // Design time logic BaseCialAbstract.setDefaultParams("G:\\_SOCIETES\\DEV\\SMODEV.gcm"); } else { string[] args = Environment.GetCommandLineArgs(); if (args.Length < 2) { throw new Exception("Nombre d'argument insuffisant"); } BaseCialAbstract.setDefaultParams(args[1], args[2]); } _lockLoggingRepository = new LockLoggingRepository(); LoadDatas(); _timer = new Timer(2000); _timer.Elapsed += OnTick; _timer.Enabled = true; } catch (Exception ex) { EventLog.WriteEntry("Application", ex.ToString()); MessageBox.Show(ex.Message); throw; } }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel(IDataService dataService) { _dataService = dataService; if (IsInDesignMode) { DoPiece = "VDE06191"; BaseCialAbstract.setDefaultParams("\\\\SRVAD01\\GESTION\\_SOCIETES\\DEV\\SMODEV.gcm"); WindowLoaded(); } else { string[] args = Environment.GetCommandLineArgs(); if (args.Length < 3) { throw new Exception("Nombre d'argument insuffisant"); } BaseCialAbstract.setDefaultParams(args[1], args[2]); DoPiece = args[3]; } Title = $"Articles DIVERS pour le document {DoPiece}"; WindowLoadedCommand = new RelayCommand(WindowLoaded); SaveCommand = new RelayCommand(Save); AddCommand = new RelayCommand(Add); RemoveCommand = new RelayCommand <Ligne>(Remove); }
public MainViewModel() { try { string[] args = Environment.GetCommandLineArgs(); if (args.Length < 3) { throw new Exception("Nombre d'argument insuffisant"); } BaseCialAbstract.setDefaultParams(args[1], args[2]); _doPiece = args[3]; CommandValider = new Command(ActionValider); MainGridEnabled = true; ToggleCheckAll = new Command(ActionToggleCheckAll); Title = $"Contremarque {_doPiece}"; } catch (Exception e) { //EventLog.WriteEntry("Application", e.ToString(), EventLogEntryType.Error); Debug.Print(e.ToString()); MessageBox.Show(e.ToString()); } }
public string EnregistrerArticle(ListRow row, string fichier, string ctNum) { BaseCialAbstract.setDefaultParams(fichier); Repository repos = new Repository(); BaseCialAbstract.setDefaultParams(repos.getDbListFromContext().First(db => db.name.Contains("TARIF")).gcmFile); return(repos.EnregistrerArticle(row, ctNum)); }
internal void SelectionChanged(Database db) { currentDb = db; if (currentDb.id == 0) { Users = new ObservableCollection <User>(); CanDisconnect = Users.Count > 0; } else { BaseCialAbstract.setDefaultParams(Repos.getFichierGescom(db.name)); Load(); } }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel(IDataService dataService) { string[] args = Environment.GetCommandLineArgs(); if (args.Length < 3) { throw new Exception("Nombre d'argument insuffisant"); } BaseCialAbstract.setDefaultParams(args[1], args[2]); DoPiece = args[3]; WelcomeTitle = $"Réception du Document {DoPiece}"; CodeBarre = string.Empty; _dataService = dataService; DatagridKeyDownCommand = new RelayCommand <object>(datagridKeyDown); SaveAndCloseCommand = new RelayCommand(saveAndClose); WindowLoadedCommand = new RelayCommand(WindowLoaded); }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel(IDataService dataService) { try { _dataService = dataService; if (IsInDesignMode) { //DoPiece = "APC04560"; //BaseCialAbstract.setDefaultParams("\\\\SRVSQL04\\SI\\Sage\\DEV\\BODINDEV.gcm"); //WindowLoaded(); } else { string[] args = Environment.GetCommandLineArgs(); if (args.Length < 3) { throw new Exception("Nombre d'argument insuffisant"); } BaseCialAbstract.setDefaultParams(args[1], args[2]); DoPiece = args[3]; _isImport = args.ElementAtOrDefault(5) == "import"; } WindowLoadedCommand = new RelayCommand(WindowLoaded); CodeBarreKeyDownCommand = new RelayCommand <DataGrid>(CodeBarreKeyDown); SelectionCommandClick = new RelayCommand <int>((s) => SelectionCommand(s)); SelectionChangedCommand = new RelayCommand <IList>((s) => SelectionChanged(s)); UpdateTotalsCommand = new RelayCommand(UpdateTotals); SaveCommand = new RelayCommand(Save); CloseCommand = new RelayCommand(Close); DoubleClickCommand = new RelayCommand <object>(DoubleCLick); } catch (Exception e) { MessageBox.Show(e.Message); Application.Current.Shutdown(); } }
public string this[string columnName] { get { string error = string.Empty; // Tant qu'elle n'est pas cochée, la ligne est valide if (RowChecked) { switch (columnName) { case "Qte": if (Qte == null && !IsCommentaire) { error = "La quantité est obligatoire"; } break; case "FournPrinc": if (!IsInterMag) { if (string.IsNullOrEmpty(FournPrinc)) { error = "Fournisseur principal obligatoire"; } else if (!BaseCialAbstract.GetInstance().CptaApplication.FactoryFournisseur.ExistNumero(_fournPrinc)) { error = $"Le fournisseur '{FournPrinc}' n'existe pas"; } } break; } } _validProperties[columnName] = error == string.Empty; OnPropertyChanged("IsValid"); return(error); } }