Ejemplo n.º 1
0
        // Token: 0x0600002E RID: 46 RVA: 0x00003BB4 File Offset: 0x00003BB4
        private void timer1_Tick(object sender, EventArgs e)
        {
            new StringBuilder();
            int num = 1;

            foreach (Process process in Process.GetProcesses("."))
            {
                try
                {
                    if (process.MainWindowTitle.Length > 0)
                    {
                        if (process.MainWindowTitle == "SA-MP 0.3" && Client.GetTimestamp() > this.izinsuresi)
                        {
                            Process.GetProcessesByName(process.MainWindowTitle.ToString());
                            process.Kill();
                            MessageBoxWrapper.Show("Client açıkken SA-MP çalıştırılamaz.", "Rina Anti-Cheat");
                            this.izinsuresi = 0;
                        }
                        num++;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }
Ejemplo n.º 2
0
        public void EditFromOutside()
        {
            if (CurrentAccount != null)
            {
                if (CurrentAccount.Num < 1)
                {
                    return;
                }
                if (CurrentAccount.SubNum == 0)
                {
                    MainAcc ds = new MainAcc(CurrentAccount, EditMode.Edit, true);
                    ds.ShowDialog();
                    if (ds.DialogResult.HasValue && ds.DialogResult.Value)
                    {
                        Refresh();
                    }
                }
                else

                {
                    MainAcc dSubAcc = new MainAcc(CurrentAccount, EditMode.Edit, false);
                    dSubAcc.ShowDialog();
                    if (dSubAcc.DialogResult.HasValue && dSubAcc.DialogResult.Value)
                    {
                        Refresh();
                    }
                }
                ;
            }
            else
            {
                MessageBoxWrapper.Show("Моля, изберете сметка");
            }
        }
Ejemplo n.º 3
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (vm.CopyCommand.CanExecute(null))
     {
         if (dataGrid2D.SelectedItems != null && dataGrid2D.SelectedItems.Count > 0)
         {
             vm.SFields = new ObservableCollection <ObservableCollection <string> >();
             foreach (var item in dataGrid2D.SelectedItems)
             {
                 var iii    = item as DataRowView;
                 var newrow = new ObservableCollection <string>();
                 if (iii != null)
                 {
                     foreach (var o in iii.Row.ItemArray)
                     {
                         newrow.Add((o as DataGrid2DLibrary.Ref <System.String>).Value);
                     }
                     vm.SFields.Add(newrow);
                 }
             }
             vm.CopyCommand.Execute(null);
         }
     }
     else
     {
         MessageBoxWrapper.Show("Не е избрана фирма, от която да се копират номенклатури");
     }
 }
Ejemplo n.º 4
0
        private void CheckForIncompatibilities()
        {
            var incompatibleMods = Compatibility.IncompatibleMods;

            if (incompatibleMods.Count > 0)
            {
                var incompatibleStrings = new List <string>();

                foreach (var incompatibleMod in incompatibleMods)
                {
                    if (incompatibleMod != null)
                    {
                        var pluginName = incompatibleMod.PluginInfo.name;
                        var instances  = incompatibleMod.PluginInfo.GetInstances <IUserMod>();

                        if (instances.Length > 0)
                        {
                            pluginName = instances[0].Name;
                        }

                        incompatibleStrings.Add($"{pluginName}:\n{incompatibleMod.Description}");
                    }
                }

                if (incompatibleStrings.Count > 0)
                {
                    MessageBoxWrapper.Show(MessageBoxWrapper.MessageType.Warning, $"{Details.ModName} incompatibilities", $"{Details.BaseModName} has detected some mod incompatibilities. These mods are known to not work with this mod: \n\n{string.Join("\n\n", incompatibleStrings.ToArray())}");
                }
            }
        }
Ejemplo n.º 5
0
        protected override void MovePrevius()
        {
            // Create OpenFileDialog
            OpenFileDialog dlg = new OpenFileDialog();



            // Set filter for file extension and default file extension
            dlg.DefaultExt = ".conf";


            // Display OpenFileDialog by calling ShowDialog method
            bool?result = dlg.ShowDialog();


            // Get the selected file name and display in a TextBox
            if (result == true)
            {
                try
                {
                    builder.LoadSettings(dlg.FileName);
                    _reportItems = new ObservableCollection <ReportItem>(builder.ReportItems);
                }
                catch (Exception e)
                {
                    MessageBoxWrapper.Show(e.Message);
                }
                OnPropertyChanged("ReportItems");
            }
        }
Ejemplo n.º 6
0
        public static bool PatchAll()
        {
            var patchSuccess = false;

            LoggingWrapper.Log(LoggingWrapper.LogArea.All, LoggingWrapper.LogType.Message, $"Patching...");

            try
            {
                LoggingWrapper.Log(LoggingWrapper.LogArea.All, LoggingWrapper.LogType.Message, $"Patching {PatchAssembly.GetName().Name}...");

                patchSuccess = Patcher.PatchAll();

                LoggingWrapper.Log(LoggingWrapper.LogArea.All, LoggingWrapper.LogType.Message, "Done!");
            }
            catch (Exception ex)
            {
                LoggingWrapper.Log(LoggingWrapper.LogArea.All, LoggingWrapper.LogType.Error, $"Couldn't patch the required methods!");
                LoggingWrapper.Log(LoggingWrapper.LogArea.Hidden, ex, true);
            }

            if (!patchSuccess)
            {
                MessageBoxWrapper.Show(MessageBoxWrapper.MessageType.Warning,
                                       $"{Details.ModName} couldn't start", $"{Details.ModName} couldn't fully start due to an issue overriding parts of the game.\n\n" +
                                       $"This is likely due to a recent update to Cities, and in order to prevent potential compatibility issues {Details.BaseModName} has disabled some functionality by reverting changes until a solution is found. This will result in most mod functionaity being disabled.\n\n" +
                                       $"If this has not previously been reported please do so, otherwise an update to the mod is required to fix the incompatibilites.");

                UnPatchAll();
            }

            return(patchSuccess);
        }
Ejemplo n.º 7
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            IInputElement focusedElement = FocusManager.GetFocusedElement(this);

            if (focusedElement is TextBox)
            {
                var expression = (focusedElement as TextBox).GetBindingExpression(TextBox.TextProperty);
                if (expression != null)
                {
                    expression.UpdateSource();
                }
            }
            if (vm.IsEdit)
            {
                vm.UpdateCommand.Execute(sender);
                DialogResult = true;
                this.Close();
            }
            else
            {
                if (vm.CheckSaldoItem())
                {
                    vm.SaveCommand.Execute(sender);
                    DialogResult = true;
                    this.Close();
                }
                else
                {
                    MessageBoxWrapper.Show("Вече е въведено салдо по тази номенклаура");
                }
            }
        }
Ejemplo n.º 8
0
        protected override void MoveNext()
        {
            // Create OpenFileDialog
            SaveFileDialog dlg = new SaveFileDialog();



            // Set filter for file extension and default file extension
            dlg.DefaultExt = ".conf";


            // Display OpenFileDialog by calling ShowDialog method
            bool?result = dlg.ShowDialog();


            // Get the selected file name and display in a TextBox
            if (result == true)
            {
                try
                {
                    builder.SaveSettings(dlg.FileName);
                }

                catch (Exception e)
                {
                    MessageBoxWrapper.Show(e.Message);
                }
            }
        }
Ejemplo n.º 9
0
 protected override void Delete()
 {
     if (Lookup != null)
     {
         if ((this.CurrentRowIndex == -1))
         {
             return;
         }
         if (MessageBoxWrapper.Show("Сигурни ли сте, че желаете да изтриете този запис?", "Предупреждение", MessageBoxWrapperButton.YesNo) == MessageBoxWrapperResult.Yes)
         {
             if (Context.CheckLookup(Lookup.Id, this.Fields[this.CurrentRowIndex + 1][1]))
             {
                 if (Context.DeleteRow(new List <string>(this.Fields[this.CurrentRowIndex + 1]), LookupModelm))
                 {
                     CalculateFields();
                     OnPropertyChanged("Fields");
                     MessageBoxWrapper.Show("Записът е изтрит");
                 }
                 else
                 {
                     MessageBoxWrapper.Show("Грешка при триене");
                 }
             }
             else
             {
                 MessageBoxWrapper.Show("Записа не може да бъде изтрит защото се използва в салда или контировки");
             }
         }
     }
 }
Ejemplo n.º 10
0
 protected override void  Save()
 {
     if (Mode == EditMode.Edit)
     {
         if (_LookupModel != null)
         {
             if (Context.UpdateLookup(_LookupModel))
             {
                 MessageBoxWrapper.Show("Записа е променен");
             }
             else
             {
                 MessageBoxWrapper.Show("Грешка по време на запис");
             }
         }
     }
     if (Mode == EditMode.Add)
     {
         _LookupModel.Fields = new List <TableField>(this._NomenclatureFieldsSelected);
         //this._LookupModel.Fields.Add(new TableField { Name = "Номер", DbField = "Integer", NameEng = "Id", Length = 10, IsNull = false });
         Context.CreateTable(this._LookupModel);
         this._Lookups = new ObservableCollection <LookUpMetaData>(Context.GetAllLookups(""));
         OnPropertyChanged("Lookups");
     }
     base.Save();
 }
Ejemplo n.º 11
0
        protected override void Add()
        {
            HoldingViewModel holding =
                new HoldingViewModel(new HoldingModel {
                Name = "New", IpServer = "localhost", Nom = Holdings.Count + 1
            });
            var conf = ConfigTempoSinglenton.GetInstance();

            holding.ConnectionString = string.Format(Entrence.ConectionStringTemplate, holding.IpServer, conf.BaseDbPath, "H" + holding.Nom);
            Holdings.Add(holding);
            if (
                MessageBoxWrapper.Show("Копиране на празна база от темплейтите?", "Предупреждение",
                                       MessageBoxWrapperButton.YesNo) == MessageBoxWrapperResult.Yes)
            {
                IoHelper.DirectoryCopy(ConfigTempoSinglenton.GetInstance().BaseTemplatePath,
                                       Path.Combine(ConfigTempoSinglenton.GetInstance().BaseDbPath, "H" + holding.Nom), true);
            }
            foreach (var item in conf.ConfigNames)
            {
                var spliter = item.Split('|');
                FirmSettingModel newsett = new FirmSettingModel();
                newsett.Key       = spliter[0];
                newsett.Name      = spliter[1];
                newsett.Value     = spliter[2];
                newsett.FirmaId   = 1;
                newsett.HoldingId = holding.Nom;
                conf.FirmSettings.Add(newsett);
            }
            conf.SaveConfiguration();
        }
Ejemplo n.º 12
0
        protected override void  Delete()
        {
            if (MessageBoxWrapper.Show("Сигурни ли сте, че желаете да изтриете този запис?", "Предупреждение", MessageBoxWrapperButton.YesNo) == MessageBoxWrapperResult.Yes)
            {
                if (CurrentIndex != -1)
                {
                    if (Context.DeleteFirma(CurrentFirma.Id))
                    {
                        AllFirms.Remove(AllFirms[CurrentIndex]);
                        MoveNext();


                        MessageBoxWrapper.Show("Записът е изтрит");
                    }
                    else
                    {
                        MessageBoxWrapper.Show("Грешка при триене");
                    }
                }
                else
                {
                    MessageBoxWrapper.Show("Не е избрана фирма за триене");
                }
            }
        }
Ejemplo n.º 13
0
        protected override void Delete()
        {
            LookupModel lookup = null;

            if (Lookup != null)
            {
                if ((this.CurrentRowIndex == -1))
                {
                    return;
                }
                lookup = Context.GetSysLookup(Lookup.Id);
                lookup.LookUpMetaData = Lookup;
                if (MessageBoxWrapper.Show(Resources.AnaliticManagerViewModel_Delete_res3, Resources.AnaliticManagerViewModel_Delete_res4, MessageBoxWrapperButton.YesNo) == MessageBoxWrapperResult.Yes)
                {
                    if (Context.DeleteRow(new List <string>(this.Fields[this.CurrentRowIndex + 1]), lookup))
                    {
                        CalculateFields();
                        OnPropertyChanged("Fields");
                        MessageBoxWrapper.Show(Resources.AnaliticManagerViewModel_Delete_res5);
                    }
                    else
                    {
                        MessageBoxWrapper.Show(Resources.AnaliticManagerViewModel_Delete_res2);
                    }
                }
            }
        }
Ejemplo n.º 14
0
        private void CopyFirmToFirm()
        {
            var allacc    = Context.GetAllAccounts(CurrentFirmaWraperSource.Id);
            var oldcursor = Mouse.OverrideCursor;

            Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
            var AllAnaliticTypes    = new ObservableCollection <AnaliticalAccountType>(Context.GetAllAnaliticalAccountType());
            var AllAnaliticalFields = new ObservableCollection <AnaliticalFields>(Context.GetAllAnaliticalFields());
            var AllConnectors       =
                new ObservableCollection <MapAnanaliticAccToAnaliticField>(Context.GetAllConnectorAnaliticField());
            var AlaMapToType = new ObservableCollection <MapAnanaliticAccToAnaliticField>(Context.GetAllConnectorTypeField());

            foreach (AccountsModel accountsModel in allacc)
            {
                accountsModel.FirmaId = CurrentFirmaWraperDest.Id;
                var SelectedConnectors =
                    new ObservableCollection <MapAnanaliticAccToAnaliticField>(
                        AllConnectors.Where(e => e.AnaliticalNameID == accountsModel.AnaliticalNum));
                ObservableCollection <AnaliticalFields> SelectedAnaliticalFields = new ObservableCollection <AnaliticalFields>();
                foreach (var curr in SelectedConnectors)
                {
                    var addfield = AllAnaliticalFields.Where(e => e.Id == curr.AnaliticalFieldId).FirstOrDefault();
                    if (addfield != null)
                    {
                        addfield.Requared = curr.Required;
                        if (addfield != null)
                        {
                            SelectedAnaliticalFields.Add(addfield);
                        }
                    }
                }
                Context.LoadMapToLookUps(SelectedAnaliticalFields, accountsModel.Id, accountsModel.AnaliticalNum);
                var CurrentAllTypeAccount = AllAnaliticTypes.Where(e => e.Id == accountsModel.TypeAnaliticalKey).FirstOrDefault();
                //SelectedConnectors =
                //    new ObservableCollection<MapAnanaliticAccToAnaliticField>(
                //        AlaMapToType.Where(e => e.AnaliticalFieldId == accountsModel.TypeAnaliticalKey));
                //ObservableCollection<AnaliticalFields> SelectedAnaliticalTypeFields=new ObservableCollection<AnaliticalFields>();
                //foreach (var curr in SelectedConnectors)
                //{
                //    var addfield = AllAnaliticalFields.FirstOrDefault(e => e.Id == curr.AnaliticalNameID);
                //    if (addfield != null)
                //    {
                //        addfield.Requared = curr.Required;
                //        SelectedAnaliticalTypeFields.Add(addfield);
                //    }
                //}
                string errormessage;
                if (!Context.UpdateAccount(accountsModel, true, SelectedAnaliticalFields, out errormessage))
                {
                    MessageBoxWrapper.Show(string.Format(" Грешка при копиране на сметкоплана от фирма {0} е копиран на фирма {1} заради грешка {2}",
                                                         CurrentFirmaWraperSource.CurrentFirma.Name,
                                                         CurrentFirmaWraperDest.CurrentFirma.Name,
                                                         errormessage), "Предупреждение");
                }
            }
            Mouse.OverrideCursor = oldcursor;
            MessageBoxWrapper.Show(string.Format("Сметкоплана от Фирма {0} е копиран на {1}", CurrentFirmaWraperSource.CurrentFirma.Name, CurrentFirmaWraperDest.CurrentFirma.Name), "Известие");
        }
Ejemplo n.º 15
0
        private static void CheckForExperimentalVersion()
        {
            if (Details.ExperimentalBuild && UserModSettings.RecentlyUpdated)
            {
                var title       = string.Format(LocalisationHolder.Translate(LocalisationHolder.CurrentLocalisation.ExperimentalBuild_Title), Details.BaseModName);
                var description = string.Format(LocalisationHolder.Translate(LocalisationHolder.CurrentLocalisation.ExperimentalBuild_Description), Details.BaseModName);

                MessageBoxWrapper.Show(MessageBoxWrapper.MessageType.Warning, title, description);
            }
        }
Ejemplo n.º 16
0
        private static void PatchOptional()
        {
            var patched = true;

            patched = patched && OptionalPatch(new NewCommonBuildingAI_GetColor(), ref FeatureToggles.LightingModificationsActive);

            if (!patched)
            {
                MessageBoxWrapper.Show(MessageBoxWrapper.MessageType.Warning, string.Format(LocalisationHolder.Translate(LocalisationHolder.CurrentLocalisation.Incompatibility_Title), Details.BaseModName), LocalisationHolder.Translate(LocalisationHolder.CurrentLocalisation.Incompatibility_Description));
            }
        }
Ejemplo n.º 17
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (CheckForPermition)
     {
         ConfigTempoSinglenton currentconfig = ConfigTempoSinglenton.GetInstance();
         if (currentconfig.Periods.FirstOrDefault(e1 => e1.Fr <= dater.SelectedDate && e1.To >= dater.SelectedDate && e1.Firma == currentconfig.ActiveFirma && e1.Holding == currentconfig.ActiveHolding) != null)
         {
             MessageBoxWrapper.Show("Забранен период не може да се сетне датата " + dater.SelectedDate);
             return;
         }
     }
     DialogResult = true;
 }
Ejemplo n.º 18
0
 private void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     Visible = System.Windows.Visibility.Hidden;
     if (String.IsNullOrWhiteSpace(Error))
     {
         MessageBoxWrapper.Show("Приключването е готово");
     }
     else
     {
         MessageBoxWrapper.Show(Error);
         Error = null;
     }
 }
Ejemplo n.º 19
0
 protected override void Delete()
 {
     if (MessageBoxWrapper.Show("Сигурни ли сте, че желаете да изтриете този запис?", "Предупреждение", MessageBoxWrapperButton.YesNo) == MessageBoxWrapperResult.Yes)
     {
         if (!Context.DeleteDdsDnevnicModel(ddsDnevnikModel.Id))
         {
             MessageBoxWrapper.Show("Грешка при триене");
         }
         else
         {
             OnRefreshExecuted(new DdsEventArgs(this.KindActivity));
         }
     }
 }
Ejemplo n.º 20
0
 private void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     lab.Visibility    = Visibility.Hidden;
     et.Visibility     = Visibility.Hidden;
     vartok.Visibility = Visibility.Hidden;
     if (string.IsNullOrWhiteSpace(Rez))
     {
         MessageBoxWrapper.Show("Командата се изпълни успешно");
     }
     else
     {
         MessageBoxWrapper.Show("Командата даде грешка " + Rez);
     }
 }
Ejemplo n.º 21
0
 protected override void Add()
 {
     if (CurrentFirmaWraper == null)
     {
         MessageBoxWrapper.Show("Не сте избрали фирма за почистване");
         return;
     }
     if (MessageBoxWrapper.Show(string.Format("Сигурен ли си ,че искаш да изтриеш всички контировки на фирма - {0}?", CurrentFirmaWraper.Name), "Предупреждение", MessageBoxWrapperButton.YesNo) == MessageBoxWrapperResult.Yes)
     {
         var oldcursor = Mouse.OverrideCursor;
         Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
         Context.DeleteAllConto(CurrentFirmaWraper.Id);
         Mouse.OverrideCursor = oldcursor;
     }
 }
Ejemplo n.º 22
0
 private void Button_Click_2(object sender, RoutedEventArgs e)
 {
     if (MessageBoxWrapper.Show("Сигурни ли сте, че желаете да изтриете всички елементи от номенклатурата за фирмата?", "Предупреждение", MessageBoxWrapperButton.YesNo) == MessageBoxWrapperResult.Yes)
     {
         string rez = vm.DeleteAllItemsFirma();
         if (rez == "")
         {
             MessageBoxWrapper.Show("Записите са изтрити");
         }
         else
         {
             MessageBoxWrapper.Show("Грешка \n" + rez);
         }
     }
 }
Ejemplo n.º 23
0
        public void EditFromOutside()
        {
            if (CurrentAccount != null)
            {
                if (CurrentAccount.Num < 1)
                {
                    return;
                }
                if (CurrentAccount.SubNum == 0)
                {
                    MainAcc ds = new MainAcc(CurrentAccount, EditMode.Edit, true, "", true);
                    ds.ShowDialog();
                    if (ds.DialogResult.HasValue && ds.DialogResult == true)
                    {
                        Refresh();
                    }
                }
                else

                {
                    var parent = AllAccounts.FirstOrDefault(e => e.Num == CurrentAccount.Num && e.SubNum == 0);
                    if (parent != null)
                    {
                        MainAcc dSubAcc = new MainAcc(CurrentAccount, EditMode.Edit, false, parent.ShortName, true);
                        dSubAcc.ShowDialog();
                        if (dSubAcc.DialogResult.HasValue && dSubAcc.DialogResult == true)
                        {
                            Refresh();
                        }
                    }
                    else
                    {
                        MainAcc dSubAcc = new MainAcc(CurrentAccount, EditMode.Edit, false, "", true);
                        dSubAcc.ShowDialog();
                        if (dSubAcc.DialogResult.HasValue && dSubAcc.DialogResult == true)
                        {
                            Refresh();
                        }
                    }
                }
                ;
            }
            else
            {
                MessageBoxWrapper.Show("Моля, изберете сметка");
            }
        }
Ejemplo n.º 24
0
 protected override void Delete()
 {
     if (MessageBoxWrapper.Show("Сигурни ли сте, че желаете да изтриете този запис?", "Предупреждение", MessageBoxWrapperButton.YesNo) == MessageBoxWrapperResult.Yes)
     {
         if (Context.DeleteAt(CurrentAllTypeAccount.Id))
         {
             MessageBoxWrapper.Show("Записът е изтрит");
             AllAnaliticTypes.Remove(AllAnaliticTypes.Where(e => e.Id == CurrentAllTypeAccount.Id).FirstOrDefault());
             CurrentAA++;
             //base.Delete();
         }
         else
         {
             MessageBoxWrapper.Show("Грешка при триене");
         }
     }
 }
Ejemplo n.º 25
0
 // Token: 0x0600003E RID: 62 RVA: 0x00003FFC File Offset: 0x00003FFC
 private void timer3_Tick(object sender, EventArgs e)
 {
     this.UpKey();
     new StringBuilder();
     foreach (Process process in Process.GetProcesses())
     {
         try
         {
             if (process.MainWindowTitle.Length > 0)
             {
                 string mainModuleFilepath = this.GetMainModuleFilepath(process.Id);
                 if (File.Exists(mainModuleFilepath))
                 {
                     DateTime lastWriteTime   = File.GetLastWriteTime(mainModuleFilepath);
                     string   mainWindowTitle = process.MainWindowTitle;
                     long     length          = new FileInfo(mainModuleFilepath).Length;
                     foreach (Globals.Cheats cheats in Globals.Hacks)
                     {
                         if (mainWindowTitle.Contains(cheats.TitleName) || lastWriteTime.ToString() == cheats.LastModified || length == cheats.Size)
                         {
                             Process.GetProcessesByName(process.MainWindowTitle.ToString());
                             try
                             {
                                 process.Kill();
                             }
                             catch
                             {
                             }
                             this.Functions.HileBulundu(cheats.TitleName, mainWindowTitle, process.ProcessName);
                         }
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.ToString());
         }
     }
     if (!File.Exists(this.Functions.g_oyun + "/d3d9.dll") && Functions.is_d3d9)
     {
         Functions.GameClose();
         Functions.is_d3d9 = false;
         MessageBoxWrapper.Show("Oyun dosyalarında değişiklik tespit edildiği için oyun kapatıldı.", "Rina Anti-Cheat");
     }
 }
Ejemplo n.º 26
0
 private void TextBoxKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         if (vm.SearcByNum())
         {
             //myDataGridEvtCode.CurrentCell = new DataGridCellInfo(vm.CurrentWraperConto, myDataGridEvtCode.Columns[0]);
             //myDataGridEvtCode.ScrollIntoView(vm.CurrentWraperConto);
             //myDataGridEvtCode.BeginEdit();
             //myDataGridEvtCode.Focus();
         }
         else
         {
             MessageBoxWrapper.Show("Няма намерен резултат");
         }
         e.Handled = true;
     }
 }
Ejemplo n.º 27
0
        protected override void AddNew()
        {
            if (CurrentFirmaWraper == null)
            {
                MessageBoxWrapper.Show("Не сте избрали фирма за почистване");
                return;
            }
            ReportMenuProviderView reportMenuProvider = new ReportMenuProviderView();

            reportMenuProvider.ShowDialog();
            if (reportMenuProvider.DialogResult.HasValue && reportMenuProvider.DialogResult.Value)
            {
                var oldcursor = Mouse.OverrideCursor;
                Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
                Context.DeleteContos(CurrentFirmaWraper.Id, reportMenuProvider.Vm.FromDate(), reportMenuProvider.Vm.ToDate());
                Mouse.OverrideCursor = oldcursor;
            }
        }
Ejemplo n.º 28
0
 private void _this_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (vm.IsLinked)
     {
         return;
     }
     if (!saved)
     {
         if (MessageBoxWrapper.Show("Не е записан ДДС в дневник! Сигурни ли сте, че желаете да продължитe?", "Предупреждение", MessageBoxWrapperButton.YesNo) == MessageBoxWrapperResult.Yes)
         {
             vm.OnCancelDdsExecutedOut(new DdsCancelEventArgs(vm.KindActivity));
         }
         else
         {
             e.Cancel = true;
         }
     }
 }
Ejemplo n.º 29
0
 protected override void Save()
 {
     OnPropertyChanged("CurrentAccount");
     if (this.CanSave())
     {
         string        errormesage;
         AccountsModel transport = _currentAccount.Clone();
         if (Mode == EditMode.Add)
         {
             if (Context.UpdateAccount(transport, true, SelectedAnaliticalFields, out errormesage))
             {
                 issave = true;
                 if (!IsMain)
                 {
                     SubNum++;
                 }
                 else
                 {
                     Num = 0;
                 }
                 NameMain = "";
                 MessageBoxWrapper.Show("Сметката е записана");
             }
             else
             {
                 MessageBoxWrapper.Show(errormesage);
                 issave = false;
             }
         }
         else
         {
             if (!Context.UpdateAccount(transport, false, SelectedAnaliticalFields, out errormesage))
             {
                 MessageBoxWrapper.Show(errormesage);
                 issave = false;
             }
         }
     }
     else
     {
         MessageBoxWrapper.Show("Невалидни данни! Моля проверете данните маркирани с червено!");
         issave = false;
     }
 }
Ejemplo n.º 30
0
        private void SaveMask()
        {
            // Create OpenFileDialog
            Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();



            // Set filter for file extension and default file extension
            dlg.FileName   = "Маск";
            dlg.DefaultExt = ".bin";


            // Display OpenFileDialog by calling ShowDialog method
            bool?result = dlg.ShowDialog();


            // Get the selected file name and display in a TextBox
            if (result == true)
            {
                // Open document
                CSearchAcc ac = new CSearchAcc();
                CopyInterface(vm, ac);
                string filename = dlg.FileName;
                //SerializeUtil.SerializeToXML<CSearchAcc>(filename, ac);
                FileStream fs = new FileStream(filename, FileMode.Create);

                // Construct a BinaryFormatter and use it to serialize the data to the stream.
                BinaryFormatter formatter = new BinaryFormatter();
                try
                {
                    formatter.Serialize(fs, ac);
                }
                catch (SerializationException e)
                {
                    MessageBoxWrapper.Show("Failed to serialize. Reason: " + e.Message);
                    throw;
                }
                finally
                {
                    fs.Close();
                }
            }
        }
Ejemplo n.º 31
0
 private bool ValidateProperties()
 {
     var wrapper = new MessageBoxWrapper();
     if (!Port.ToLower().StartsWith("com"))
     {
         wrapper.Show("Port must start with Com", "Local Device Setup", MessageBoxButton.OK);
         return false;
     }
    
     return true;
 }