예제 #1
0
        private void btnSaveSettings_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (SettingHelpers.hasSetting(Constants.MoldLife))
                {
                    int intMoldLife = (int)Properties.Settings.Default[Constants.MoldLife];
                    if (int.TryParse(txtMoldLife.Text, out intMoldLife))
                    {
                        Properties.Settings.Default[Constants.MoldLife] = intMoldLife;
                    }
                }

                if (SettingHelpers.hasSetting(Constants.MaxCycleTime))
                {
                    int intMaxCycleTime = (int)Properties.Settings.Default[Constants.MaxCycleTime];
                    if (int.TryParse(txtMaxCycleTime.Text, out intMaxCycleTime))
                    {
                        Properties.Settings.Default[Constants.MaxCycleTime] = intMaxCycleTime;
                    }
                }

                Properties.Settings.Default.Save();
                MessageBox.Show("The changes have been saved.", Constants.ApplicationName, MessageBoxButton.OK, MessageBoxImage.Information);
            }
            catch (Exception exc)
            {
                var msg = exc.GetAllExceptionInfo();
                log.Error(msg, exc);
                MessageBox.Show("Cannot save settings", Constants.ApplicationName, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
예제 #2
0
 public AddItemViewModel(AddItem addItem)
 {
     _addItem       = addItem;
     _posRepository = SettingHelpers.GetRepositoryImplementation();
     Barcode        = SettingHelpers.CurrentBarcode;
     GetUnitTypeList();
 }
예제 #3
0
 public LoginViewModel(LoginScreen loginScreen)
 {
     _loginScreen   = loginScreen;
     _posRepository = SettingHelpers.GetRepositoryImplementation();
     _languageList  = new CollectionView(_posRepository.GetAllLanguage());
     _language      = "1";
     SettingHelpers.LocalizationDictionary = _posRepository.GetLanguageWiseLabels(int.Parse(Language));
 }
예제 #4
0
        public CommandSet ReadCommandsFromFile(string filepath)
        {
            try
            {
                if (!File.Exists(filepath))
                {
                    return(null);
                }
                SettingsCollection settings = null;
                try
                {
                    settings = (new SettingsFileLoader()).ReadSettingsFile(filepath);
                }
                catch (Exception exc)
                {
                    log.WriteError("Exception reading commands from file '{0}': {1}", filepath, exc);
                    //return new CommandSet(new List<Command>(), new DateTime());
                    return(null);
                }

                string fileVersion = SettingHelpers.GetSingleStringValue(settings, "FileVersion");
                if (!fileVersion.StartsWith(MASTER_FILE_VERSION_COMPAT))
                {
                    log.WriteError(
                        "Incompatible command file, version: {0}",
                        fileVersion);
                    return(null);
                }
                DateTime timestamp = settings.GetValue("Timestamp").GetUtcDateParam("TimeUtc");
                if (DateTime.UtcNow - timestamp > TimeSpan.FromHours(1))
                {
                    log.WriteInfo(
                        "Ignoring command file older than one hour, timestamp={0:O}",
                        timestamp);
                    return(null);
                }
                DateTime       acknowledgement = SettingHelpers.GetSingleDateTimeValue(settings, "AcknowledgementUtc");
                int            ncmds           = SettingHelpers.GetSingleIntValue(settings, "CommandCount");
                List <Command> cmdlist         = new List <Command>(ncmds);
                for (int i = 0; i < ncmds; ++i)
                {
                    string   key       = string.Format("Command{0}", i + 1);
                    var      cmdData   = settings.GetValue(key);
                    DateTime time      = cmdData.GetDateParam("TimeStampUtc");
                    string   cmdString = cmdData.GetStringParam("CommandString");
                    var      cmd       = new Command(time, cmdString);
                    cmdlist.Add(cmd);
                }

                CommandSet cmdset = new CommandSet(cmdlist, acknowledgement);
                return(cmdset);
            }
            catch (Exception exc)
            {
                log.WriteError("Exception reading command file: {0}", exc);
                return(null);
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GridMappingDrawingRulesSettingsMenuItem"/> class.
        /// </summary>
        public static void Draw()
        {
            var local = LocalizationManager.Instance;

            SettingHelpers.DrawSettingsIntField(GlobalConstants.ShowDrawingRulesButtonSizeKey, local.Get("SETT_ShowDrawRulesSize"), 22, 1, 100, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsIntField(GlobalConstants.DrawingRulesEntrySizeKey, local.Get("SETT_DrawingRuleEntrySize"), 22, 1, 100, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsBoolField(GlobalConstants.DrawingRulesOutputToConsoleKey, local.Get("SETT_DrawingRuleConsoleOutput"), false);
            SettingHelpers.DrawSettingsBoolField(GlobalConstants.DrawingRulesConfirmationKey, local.Get("SETT_DrawingRulesConfirmation"), true);
        }
 public SuspendViewModel(SuspendBill suspendBill, POSWindow posWindow)
 {
     _suspendBill      = suspendBill;
     _posWindow        = posWindow;
     _posRepository    = SettingHelpers.GetRepositoryImplementation();
     ValidationMessage = string.Empty;
     if (_posWindow.ViewModel.CustomerInformation.Customer != null)
     {
         ReferenceName = _posWindow.ViewModel.CustomerInformation.Customer.Name;
     }
 }
        public IActionResult Save()
        {
            var newSettings = new List <Dictionary <string, string> >
            {
                new Dictionary <string, string>
                {
                    { "Title", "Music" }
                }
            };
            var model = SettingHelpers.SetAllSettings(_writableSettings, newSettings);

            return(View(model));
        }
예제 #8
0
        public static HeartbeatResponse GetHeartbeatStatus(string filepath)
        {
            var info = new HeartbeatResponse();

            try
            {
                if (string.IsNullOrEmpty(filepath))
                {
                    return(info);
                }
                if (!File.Exists(filepath))
                {
                    return(info);
                }

                var settings = (new SettingsFileLoader()).ReadSettingsFile(filepath);

                info.Status.FileVersion = SettingHelpers.GetSingleStringValue(settings, "FileVersion");
                if (!info.Status.FileVersion.StartsWith(HeartbeatGameStatus.MASTER_FILE_VERSION_COMPAT))
                {
                    throw new Exception(string.Format(
                                            "Incompatible heartbeat status file version: {0}",
                                            info.Status.FileVersion));
                }
                info.Status.UptimeSeconds                = SettingHelpers.GetSingleIntValue(settings, "UptimeSeconds");
                info.Status.ServerName                   = SettingHelpers.GetSingleStringValue(settings, "ServerName");
                info.Status.AccountName                  = SettingHelpers.GetSingleStringValue(settings, "AccountName");
                info.Status.CharacterName                = SettingHelpers.GetSingleStringValue(settings, "CharacterName");
                info.LogFilepath                         = SettingHelpers.GetSingleStringValue(settings, "LogFilepath");
                info.Status.ProcessId                    = SettingHelpers.GetSingleIntValue(settings, "ProcessId");
                info.Status.TeamList                     = SettingHelpers.GetSingleStringValue(settings, "TeamList");
                info.Status.ThwargFilterVersion          = SettingHelpers.GetSingleStringValue(settings, "ThwargFilterVersion");
                info.Status.ThwargFilterFilePath         = SettingHelpers.GetSingleStringValue(settings, "ThwargFilterFilePath");
                info.Status.IsOnline                     = SettingHelpers.GetSingleBoolValue(settings, "IsOnline", false);
                info.Status.LastServerDispatchSecondsAgo = SettingHelpers.GetSingleIntValue(settings, "LastServerDispatchSecondsAgo");
                info.Status.ActualServerName             = SettingHelpers.GetSingleStringValue(settings, "ActualServerName");
                info.Status.ActualAccountName            = SettingHelpers.GetSingleStringValue(settings, "ActualAccountName");
                info.Status.ActualCharacterName          = SettingHelpers.GetSingleStringValue(settings, "ActualCharacterName");

                info.IsValid = true;
            }
            catch (Exception exc)
            {
                log.WriteError("GetHeartbeatStatus exception: {0}", exc);
            }
            return(info);
        }
예제 #9
0
        public Settings()
        {
            InitializeComponent();

            // default values
            if (SettingHelpers.hasSetting(Constants.MoldLife))
            {
                txtMoldLife.Text = Properties.Settings.Default[Constants.MoldLife].ToString();
            }

            if (SettingHelpers.hasSetting(Constants.MaxCycleTime))
            {
                txtMaxCycleTime.Text = Properties.Settings.Default[Constants.MaxCycleTime].ToString();
            }

            DataContext = new SettingsViewModel();
        }
 void UnsuspendBill_Loaded(object sender, RoutedEventArgs e)
 {
     SettingHelpers.SetLabelsLangugaeWise(this);
     if (this.UnsuspendViewModel.TempTransItemCollection != null && this.UnsuspendViewModel.TempTransItemCollection.Any())
     {
         for (int i = 0; i < dg1.Items.Count; i++)
         {
             dg1.SelectedIndex = i;
             dg1.Focus();
             var selectedRow = (DataGridRow)dg1.ItemContainerGenerator.ContainerFromIndex(0);
             FocusManager.SetIsFocusScope(selectedRow, true);
             FocusManager.SetFocusedElement(selectedRow, selectedRow);
             dg1.MoveFocus(new TraversalRequest(FocusNavigationDirection.Down));
             SettingHelpers.SetLabelsLangugaeWise(this);
         }
         dg1.SelectedIndex = 0;
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="GridMappingRecentPrefabsSettingsMenuItem"/> class.
        /// </summary>
        public static void Draw()
        {
            var local = LocalizationManager.Instance;

            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.RecentInspectorPrefabListEnabledKey, local.Get("SETT_EnableRecentPrefabsInInspector"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowRecentPrefabRemoveButtonsKey, local.Get("SETT_ShowRemoveButtons"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowRecentPrefabsAsButtonsKey, local.Get("SETT_ShowAsButtons"), false, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowAddPrefabButtonsKey, local.Get("SETT_ShowAddPrefabButton"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowRecentPrefabsSelectButtonsKey, local.Get("SETT_ShowSelectButton"), true, Helpers.RedrawInspector);

            SettingHelpers.DrawSettingsIntField(GlobalConstants.MaxNumberOfRecentPrefabsKey, local.Get("SETT_MaxNumberOfItems"), 100, 1, int.MaxValue, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsIntField(GlobalConstants.MaxHeightOfRecentPrefabsKey, local.Get("SETT_MaxControlHeight"), 64, 1, int.MaxValue, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsIntField(GlobalConstants.RecentPrefabButtonSizeKey, local.Get("SETT_ButtonSize"), 32, 1, int.MaxValue, Helpers.RedrawInspector);

            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowRecentPrefabAsListKey, local.Get("SETT_ShowAsList"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsIntField(GlobalConstants.RecentPrefabButtonColumnsKey, local.Get("SETT_ButtonsPerRow"), 5, 1, int.MaxValue, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowRecentPrefabAssetPreviewsKey, local.Get("SETT_ShowAssetPreview"), true, Helpers.RedrawInspector);
        }
예제 #12
0
        /// <summary>
        /// Called by ThwargFilter
        /// </summary>
        internal static LaunchInfo GetLaunchInfo()
        {
            var info = new LaunchInfo();

            try
            {
                string filepath = FileLocations.GetCurrentLaunchFilePath(ServerName: GameRepo.Game.Server, AccountName: GameRepo.Game.Account);

                if (!File.Exists(filepath))
                {
                    log.WriteError("No launch file found: '{0}'", filepath);
                    return(info);
                }
                var settings = (new SettingsFileLoader()).ReadSettingsFile(filepath);

                info.FileVersion = SettingHelpers.GetSingleStringValue(settings, "FileVersion");
                if (!info.FileVersion.StartsWith(LaunchInfo.MASTER_FILE_VERSION_COMPAT))
                {
                    throw new Exception(string.Format(
                                            "Incompatible launch info file version: {0}",
                                            info.FileVersion));
                }

                info.LaunchTime = settings.GetValue("Timestamp").GetDateParam("TimeUtc");
                TimeSpan maxLatency = new TimeSpan(0, 0, 0, 45); // 30 seconds max latency from exe call to game launch
                if (DateTime.UtcNow - info.LaunchTime >= maxLatency)
                {
                    log.WriteInfo("DateTime.UtcNow-'{0}', info.LaunchTime='{1}', maxLatency='{2}'", DateTime.UtcNow, info.LaunchTime, maxLatency);
                    log.WriteInfo("Launch file TimeUtc too old");
                    return(info);
                }

                info.ServerName    = SettingHelpers.GetSingleStringValue(settings, "ServerName");
                info.AccountName   = SettingHelpers.GetSingleStringValue(settings, "AccountName");
                info.CharacterName = SettingHelpers.GetSingleStringValue(settings, "CharacterName");

                info.IsValid = true;
            }
            catch (Exception exc)
            {
                log.WriteError("GetLaunchInfo exception: {0}", exc);
            }
            return(info);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GridMappingSceneViewSettingsMenuItem"/> class.
        /// </summary>
        public static void Draw()
        {
            var local = LocalizationManager.Instance;

            var items = new[]
            {
                local.Get("SETT_DontShowMouseCoordinates"),
                local.Get("SETT_ShowMouseCoordinatesUnderPointer"),
                local.Get("SETT_ShowMouseCoordinatesAbovePointer"),
                local.Get("SETT_ShowMouseCoordinatesTopLeft"),
                local.Get("SETT_ShowMouseCoordinatesTopRight"),
                local.Get("SETT_ShowMouseCoordinatesBottomLeft"),
                local.Get("SETT_ShowMouseCoordinatesBottomRight")
            };

            SettingHelpers.DrawSettingsPopup(GlobalConstants.MouseCoordinatesKey, local.Get("SETT_MouseCoordinatesStyle"), items, 0, Helpers.RedrawInspector);

            // SettingHelpers.DrawSettingsBoolField(GlobalConstants.MouseCoordinatesActiveSceneViewOnlyKey, local.Get("SETT_MouseCoordinatesStyle"), items, 0, Helpers.RedrawInspector);
        }
예제 #14
0
        /// <summary>
        /// Called by ThwargLauncher
        /// </summary>
        public static LaunchResponse GetLaunchResponse(string ServerName, string AccountName, TimeSpan maxLatency)
        {
            var info = new LaunchResponse();

            try
            {
                string filepath = FileLocations.GetCurrentLaunchResponseFilePath(ServerName: ServerName, AccountName: AccountName);
                if (string.IsNullOrEmpty(filepath))
                {
                    return(info);
                }
                if (!File.Exists(filepath))
                {
                    return(info);
                }

                var settings = (new SettingsFileLoader()).ReadSettingsFile(filepath);

                info.FileVersion = SettingHelpers.GetSingleStringValue(settings, "FileVersion");
                if (!info.FileVersion.StartsWith(LaunchResponse.MASTER_FILE_VERSION_COMPAT))
                {
                    throw new Exception(string.Format(
                                            "Incompatible launch response file version: {0}",
                                            info.FileVersion));
                }

                info.ResponseTime = SettingHelpers.GetSingleDateTimeValue(settings, "TimeUtc");
                if (DateTime.UtcNow - info.ResponseTime.ToUniversalTime() >= maxLatency)
                {
                    return(info);
                }
                info.ProcessId           = SettingHelpers.GetSingleIntValue(settings, "ProcessId");
                info.ThwargFilterVersion = SettingHelpers.GetSingleStringValue(settings, "ThwargFilterVersion");
                info.ServerNameReported  = SettingHelpers.GetSingleStringValue(settings, "ServerNameReported");

                info.IsValid = true;
            }
            catch (Exception exc)
            {
                log.WriteError("GetLaunchResponse exception: {0}", exc);
            }
            return(info);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GridMappingPrefabsSettingsMenuItem"/> class.
        /// </summary>
        public static void Draw()
        {
            var local = LocalizationManager.Instance;

            // SettingHelpers.DrawSettingsIntField(GlobalConstants.RecentQuickPrefabButtonColumnsKey, local.Get("SETT_ButtonsPerRow"), 3, 1, int.MaxValue, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsIntField(GlobalConstants.PrefabButtonsPerRowKey, local.Get("SETT_PrefabButtonsPerRow"), 3, 1, 100, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsFloatField(GlobalConstants.PrefabButtonSizeKey, local.Get("SETT_PrefabButtonSize"), 64, 1, 100, Helpers.RedrawInspector);

            // get the default value for the resource folder(s)
            var settings     = SettingsManager.Instance;
            var defaultValue = settings.GetSetting(CoreGlobalConstants.ResourceFolderKey, string.Empty);

            if (defaultValue == string.Empty)
            {
                defaultValue = "Codefarts.Unity/GridMappingPrefabIndexFiles";
            }

            GUILayout.Label(local.Get("SETT_PrefabIndexResourceFolder"));
            SettingHelpers.DrawSettingsTextBox(GlobalConstants.PrefabIndexResourceFolderKey, defaultValue, Helpers.RedrawInspector);
        }
예제 #16
0
        public PaymentViewModel(PaymentWindow paymentWindow)
        {
            _paymentWindow = paymentWindow;
            _posRepository = SettingHelpers.GetRepositoryImplementation();
            POSWindowViewModel pos = new POSWindowViewModel();

            if (String.IsNullOrEmpty(SettingHelpers.TotalAmount))
            {
                SettingHelpers.TotalAmount = "0";
            }
            TotalAmount = Convert.ToDecimal(SettingHelpers.TotalAmount.Replace(SettingHelpers.CurrentCultureInfo.NumberFormat.CurrencySymbol, ""));
            if (SettingHelpers.IsCustomerPO)
            {
                SetPaymentModeAmountForCPO();
            }
            if (_posWindow.ViewModel.CustomerInformation.ReturnBill != null)
            {
                TotalAmount = TotalAmount - Convert.ToDecimal(_posWindow.ViewModel.CustomerInformation.ReturnBill.SubstituteItemsAmount);
                SetValueForReturnBillPayment();
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GridMappingLayersSettingsMenuItem"/> class.
        /// </summary>
        public static void Draw()
        {
            var local = LocalizationManager.Instance;

            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowLayersInInspectorKey, local.Get("SETT_ShowLayersInInspector"), true, Helpers.RedrawInspector);
            var items = new[] { local.Get("SETT_OldLayerCountStyle"), local.Get("SETT_Version2LayerCountStyle"), local.Get("SETT_Version2SimpleStyle") };

            SettingHelpers.DrawSettingsPopup(GlobalConstants.LayerCountStyleKey, local.Get("SETT_LayerCountStyle"), items, 1, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.LayerCountFieldDisabledKey, local.Get("SETT_DisablelayerCountField"), false, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ScrollLayersKey, local.Get("SETT_ScrollLayers"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsIntField(GlobalConstants.LayerListHeightKey, local.Get("SETT_LayerListHeight"), 96, 16, 4096, Helpers.RedrawInspector);
            items = new[] { local.Get("SETT_OldLayerStyle"), local.Get("SETT_Version2LayerStyle") };
            SettingHelpers.DrawSettingsPopup(GlobalConstants.LayerListStyleKey, local.Get("SETT_LayerListStyle"), items, 1, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowLayerLocksKey, local.Get("SETT_ShowLayerLock"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowLayerVisibilityKey, local.Get("SETT_ShowLayerVisibility"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowActiveLayerKey, local.Get("SETT_ShowActiveLayer"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowDeleteLayerButtonKey, local.Get("SETT_ShowDeleteLayerButtons"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowMoveLayerButtonsKey, local.Get("SETT_ShowMoveLayerButtons"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsIntField(GlobalConstants.LayerIconSizeKey, local.Get("SETT_LayerIconSize"), 16, 8, 256, Helpers.RedrawInspector);

            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.PromptToDeleteLayerKey, local.Get("SETT_PromptToDeleteLayer"), true);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GridMappingAutomaticMaterialCreationSettingsMenuItem"/> class.
        /// </summary>
        public static void Draw()
        {
            if (folderControl == null)
            {
                folderControl = new SelectOutputFolderControl();
                folderControl.SetOutputPath(PlayerPrefs.GetString(GlobalConstants.AutoMaterialCreationFolderKey, string.Empty));
                folderControl.OutputPathChanged += (sender, e) => PlayerPrefs.SetString(GlobalConstants.AutoMaterialCreationFolderKey, folderControl.OutputPath);
            }

            folderControl.Draw();

            var local = LocalizationManager.Instance;

            SettingHelpers.DrawSettingsColorPicker(GlobalConstants.DefaultAutoMaterialCreationColorKey, local.Get("SETT_DefaultTileMaterialCreationColor"), Color.white);
            SettingHelpers.DrawSettingsIntField(GlobalConstants.AutoMaterialCreationDefaultWidthKey, local.Get("SETT_TileMaterialCreationDefaultTileWidth"), 32);
            SettingHelpers.DrawSettingsIntField(GlobalConstants.AutoMaterialCreationDefaultHeightKey, local.Get("SETT_TileMaterialCreationDefaultTileHeight"), 32);
            var items = new[] { local.Get("Hierarchy"), local.Get("Flat") };

            SettingHelpers.DrawSettingsPopup(GlobalConstants.AutoMaterialCreationShaderListStyleKey, local.Get("SETT_HierarchicalMaterialCreationShaderList"), items, 0);
            GUILayout.Label(local.Get("Shaders"));
            SettingHelpers.DrawSettingsTextBox(GlobalConstants.AutoMaterialCreationShadersKey, "Diffuse\r\nTransparent/Diffuse\r\nTransparent/Cutout/Diffuse\r\nTransparent/Cutout/Soft Edge Unlit");
        }
예제 #19
0
 public PaymentViewModel(PaymentWindow paymentWindow, POSWindow posWindow)
 {
     _paymentWindow             = paymentWindow;
     _posWindow                 = posWindow;
     _posRepository             = SettingHelpers.GetRepositoryImplementation();
     SettingHelpers.TotalAmount = _posWindow.ViewModel.BillSummary.OrderAmount.ToString();
     _itemProfileCollection     = _posWindow.ViewModel.ItemProfileCollectionNew;
     TotalAmount                = Convert.ToDecimal(SettingHelpers.TotalAmount.Replace(SettingHelpers.CurrentCultureInfo.NumberFormat.CurrencySymbol, ""));
     if (SettingHelpers.IsCustomerPO)
     {
         SettingHelpers.TotalAmount = (_posWindow.ViewModel.BillSummary.OrderAmount
                                       + (_posWindow.ViewModel.BillSummary.AdditionalAmount == null ? 0
             : _posWindow.ViewModel.BillSummary.AdditionalAmount.Value)).ToString();
         SetPaymentModeAmountForCPO();
         TotalAmount = Convert.ToDecimal(SettingHelpers.TotalAmount.Replace(SettingHelpers.CurrentCultureInfo.NumberFormat.CurrencySymbol, ""));
     }
     if (_posWindow.ViewModel.CustomerInformation.ReturnBill != null)
     {
         TotalAmount = TotalAmount - _posWindow.ViewModel.CustomerInformation.ReturnBill.SubstituteItemsAmount;
         SetValueForReturnBillPayment();
     }
 }
예제 #20
0
        /// <summary>
        /// Draws the <see cref="GridMappingDrawingToolsSettingsMenuItem"/> class.
        /// </summary>
        public static void Draw()
        {
            var local = LocalizationManager.Instance;

            GUILayout.BeginVertical();

            SettingHelpers.DrawSettingsFloatField(GlobalConstants.DrawingModeButtonSizeKey, local.Get("SETT_DrawingToolButtonSize"), 64, 1, 100, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsIntField(GlobalConstants.DrawModeButtonsPerRowKey, local.Get("SETT_DrawingToolButtonsPerRow"), 3, 1, 100, Helpers.RedrawInspector);

            DrawHeaderTools();

            GUILayout.BeginHorizontal();

            DrawAvailableToolList();

            DrawToolList();

            DrawIndexPositionControls();

            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
        }
 public AspNetUsers ValidateLogin(string userName, string password)
 {
     if (SettingHelpers.CheckConnection())
     {
         var httpClient = new HttpClients();
         MerchantService.Repository.ApplicationClasses.LoginViewModel loginViewController = new MerchantService.Repository.ApplicationClasses.LoginViewModel();
         loginViewController.UserName = userName;
         loginViewController.Password = password;
         string jsonString  = JsonConvert.SerializeObject(loginViewController);
         var    httpContent = new StringContent(jsonString, Encoding.UTF8, "application/json");
         var    response    = httpClient.PutAsync("api/poslogin/validatelogin", httpContent);
         if (response.IsSuccessStatusCode)
         {
             var aspNetUser = response.Content.ReadAsAsync <MerchantService.Repository.ApplicationClasses.AspNetUsers>().Result;
             if (aspNetUser != null)
             {
                 AddOrUpdateUserDataInLocalDb(userName, password, aspNetUser.Id);
             }
             return(aspNetUser);
         }
     }
     else
     {
         var user = _userLogin.FirstOrDefault(x => x.Password == password &&
                                              x.Username == userName);
         if (user != null)
         {
             return(new MerchantService.Repository.ApplicationClasses.AspNetUsers()
             {
                 Id = user.UserId,
                 UserName = user.Username
             });
         }
     }
     return(null);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="GridMappingGeneralSettingsMenuItem"/> class.
        /// </summary>
        public static void Draw()
        {
            var local = LocalizationManager.Instance;

            var items = new[] { local.Get("SETT_ShowMapInfoOldStyle"), local.Get("SETT_ShowMapInfoVer2Style") };
            var drawingHelperItems = new[] { local.Get("SETT_AsCheckBox"), local.Get("SETT_AsButtons") };

            SettingHelpers.DrawSettingsPopup(GlobalConstants.MapInfoStyleKey, local.Get("SETT_MapInfoStyle"), items, 1, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowMapInfoFoldoutKey, local.Get("SETT_ShowMapInfoAsFoldout"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowInspectorToolsKey, local.Get("SETT_ShowInspectorTools"), true, Helpers.RedrawInspector);

            SettingHelpers.DrawSettingsPopup(GlobalConstants.DrawingHelperStyleKey, local.Get("SETT_DrawingHelperStyle"), drawingHelperItems, 0, Helpers.RedrawInspector);

            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.AutoScalePrefabKey, local.Get("SETT_AutoScalePrefabs"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.AutoCenterPrefabKey, local.Get("SETT_AutoCenterPrefabs"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowGridLinesKey, local.Get("SETT_ShowGrid"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowGuidelinesKey, local.Get("SETT_ShowGuidelines"), false, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowMarkerKey, local.Get("SETT_ShowMarker"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsFloatField(GlobalConstants.MarkerScaleKey, local.Get("SETT_MarkerScale"), 1.025f, 0.01f, 10);

            SettingHelpers.DrawSettingsFloatField(GlobalConstants.DefaultCellWidthKey, local.Get("SETT_DefaultCellWidth"), 1, 0.01f, 100);
            SettingHelpers.DrawSettingsFloatField(GlobalConstants.DefaultCellHeightKey, local.Get("SETT_DefaultCellHeight"), 1, 0.01f, 100);
            SettingHelpers.DrawSettingsIntField(GlobalConstants.DefaultColumnCountKey, local.Get("SETT_DefaultMapColumns"), 20, 1, 1000, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsIntField(GlobalConstants.DefaultRowCountKey, local.Get("SETT_DefaultMapRows"), 10, 1, 1000, Helpers.RedrawInspector);

            SettingHelpers.DrawSettingsFloatField(GlobalConstants.DefaultLayerDepthKey, local.Get("SETT_DefaultLayerDepth"), 1, 0, 1000, Helpers.RedrawInspector);

            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.ShowPrefabsInHierarchyKey, local.Get("SETT_ShowPrefabsInHierarchy"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsTextField(GlobalConstants.DefaultMapNameKey, local.Get("SETT_DefaultMapName"), local.Get("Map"), Helpers.RedrawInspector);

            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.HoldShiftToDrawKey, local.Get("SETT_HoldShiftToDraw"), false);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.HoldShiftToEraseKey, local.Get("SETT_HoldShiftToErase"), false);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.HoldAltToDrawKey, local.Get("SETT_HoldAltToDraw"), false);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.HoldAltToEraseKey, local.Get("SETT_HoldAltToErase"), false);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.HoldControlToDrawKey, local.Get("SETT_HoldControlToDraw"), false);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.HoldControlToEraseKey, local.Get("SETT_HoldControlToErase"), false);

            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.MouseWheelChangesLayersKey, local.Get("SETT_MouseWheelChangesLayers"), false, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.HoldShiftToChangeLayersKey, local.Get("SETT_HoldShiftToChangeLayers"), true, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.HoldAltToChangeLayersKey, local.Get("SETT_HoldAltToChangeLayers"), false, Helpers.RedrawInspector);
            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.HoldControlToChangeLayersKey, local.Get("SETT_HoldControlToChangeLayers"), false, Helpers.RedrawInspector);

            SettingHelpers.DrawSettingsCheckBox(GlobalConstants.RestoreLastDrawingToolKey, local.Get("SETT_RestoreLastDrawingTool"), false, Helpers.RedrawInspector);

            // rotation display setting
            var settings      = SettingsManager.Instance;
            var rotationItems = new[] { local.Get("Hide"), local.Get("SETT_AsButtons"), local.Get("SETT_AsRotationWindow") };

            SettingHelpers.DrawSettingsPopup(GlobalConstants.RotationStyleKey, local.Get("SETT_RotationStyle"), rotationItems, 1, () =>
            {
                var value = settings.GetSetting(GlobalConstants.RotationStyleKey, 1);
                if (value != 2)
                {
                    UnityEditor.EditorWindow.GetWindow <RotationsWindow>().Close();
                }
                Helpers.RedrawInspector();
            });

            // rotation window orientation setting
            var rotationStyle = settings.GetSetting(GlobalConstants.RotationStyleKey, 1);

            if (rotationStyle == 2)
            {
                SettingHelpers.DrawSettingsCheckBox(GlobalConstants.RotationWindowOrientationKey, local.Get("SETT_RotationWindowOrientation"), true, null);
            }
        }
        public IActionResult Index()
        {
            var allSettings = SettingHelpers.GetAllSettings(_readableSettings);

            return(View(allSettings));
        }
 void LoginScreen_Loaded(object sender, RoutedEventArgs e)
 {
     SettingHelpers.SetLabelsLangugaeWise(this);
 }
예제 #25
0
 public LoginViewModel()
 {
     _posRepository = SettingHelpers.GetRepositoryImplementation();
 }
 void PaymentWindow_Loaded(object sender, RoutedEventArgs e)
 {
     SettingHelpers.SetLabelsLangugaeWise(this);
 }
예제 #27
0
 void AddItem_Loaded(object sender, RoutedEventArgs e)
 {
     SettingHelpers.SetLabelsLangugaeWise(this);
 }
 //public ObservableCollection<POSTempTranscationAC> tempCollection;
 public UnSuspendViewModel(UnsuspendBill unSuspendBill)
 {
     _posRepository = SettingHelpers.GetRepositoryImplementation();
     _unSuspendBill = unSuspendBill;
     GetUnsupendBillList();
 }
 public CustomerViewModel(CustomerWindow customerWindow, POSWindow posWindow)
 {
     _customerWindow = customerWindow;
     _posWindow      = posWindow;
     _posRepository  = SettingHelpers.GetRepositoryImplementation();
 }
 public LogOutViewModel(LogOut logoutWindow)
 {
     _logOUtWindow  = logoutWindow;
     _posRepository = SettingHelpers.GetRepositoryImplementation();
 }