Exemple #1
0
        /// <summary>
        /// Show User Form and set the initial values
        /// </summary>
        public async Task ShowUserFormAsync(User user = null)
        {
            Spinner.InitSpinner();

            // Set the userId. Means that is a edit
            _userId = (user != null) ? user.UserId : 0;

            // Set the Form title
            Text = (_userId != 0)
              ? AppConstants.GetViewTitle(Phrases.UserEditUser)
              : AppConstants.GetViewTitle(Phrases.UserCreateNewUser);

            // hide the error labels
            lbErrorUsername.Visible = false;
            lbErrorPassword.Visible = false;

            // Populate the combo box
            IEnumerable <Role> roles = await AppServices.RoleService.GetAllAsync();

            cbRoles.DataSource    = roles;
            cbRoles.ValueMember   = "RoleId";
            cbRoles.DisplayMember = "Code";

            // Edit
            if (user != null)
            {
                tbUsername.Text      = user.Username;
                cbRoles.SelectedItem = roles.First(x => x.RoleId == user.RoleId);
                cbRoles.Enabled      = (user.UserId == Program.LoggedInUser.UserId) ? false : true;
            }

            Spinner.StopSpinner();
            ShowDialog();
        }
        /// <summary>
        /// Show User Form and set the initial values
        /// </summary>
        public void ShowProductForm(Product product = null)
        {
            Spinner.InitSpinner();

            // Set the productId. Means that is a edit
            _productId = (product != null) ? product.ProductId : 0;

            // Set the Form title
            Text = (_productId != 0)
              ? AppConstants.GetViewTitle(Phrases.ProductEdit)
              : AppConstants.GetViewTitle(Phrases.ProductCreateNewProduct);

            // hide the error labels
            lbErrorReference.Visible = false;
            lbErrorName.Visible      = false;

            // Edit
            if (product != null)
            {
                tbReference.Text = product.Reference;
                tbName.Text      = product.Name;
            }

            Spinner.StopSpinner();
            ShowDialog();
        }
 /// <summary>
 /// Set the content string for the correct app language
 /// </summary>
 private void SetTranslatedPhrases()
 {
     Text                   = AppConstants.GetViewTitle(Phrases.UserChangePassword);
     lbTitle.Text           = Phrases.UserChangePassword;
     lbCurrentPassword.Text = Phrases.UserCurrentPassword;
     lbNewPassword.Text     = Phrases.UserNewPassword;
     btnCancel.Text         = Phrases.GlobalCancel;
     btnSave.Text           = Phrases.GlobalSave;
 }
        /// <summary>
        /// Show Location Form and set the initial values
        /// </summary>
        public void ShowLocationForm(ProductLocation productLocation)
        {
            _productLocation = productLocation;

            Text         = AppConstants.GetViewTitle($"{_productLocation.Location.Name} | {Phrases.ProductLocationMinStockEdit}");
            lbTitle.Text = string.Format(Phrases.ProductLocationMinStockInfo, _productLocation.Product.Reference);

            // hide the error labels
            numMinStock.Value = decimal.Parse(productLocation.MinStock.ToString());

            ShowDialog();
        }
        private void SetTranslatedPhrases()
        {
            Text = AppConstants.GetViewTitle(Phrases.RefillStock);

            lbTitle.Text = $"{Phrases.GlobalProduct}: {_productName}";

            lbCurrentStock.Text = Phrases.RefillStockStockAtEndOfShift;
            lbRefillQty.Text    = Phrases.RefillStockRefilledQty;

            btnCancel.Text = Phrases.GlobalCancel;
            btnSave.Text   = Phrases.GlobalSave;
        }
Exemple #6
0
        public async Task ShowManualStockMovementFormAsync()
        {
            Text = AppConstants.GetViewTitle(Phrases.StockMovementCreate);

            // hide the error labels
            lbErrorQty.Visible = false;

            Spinner.InitSpinner();

            // Get the locations
            _locations = await AppServices.LocationService.GetAllAsync();

            SetFormComboboxesData();

            Spinner.StopSpinner();
            ShowDialog();
        }
        /// <summary>
        /// Show Location Form and set the initial values
        /// </summary>
        public void ShowLocationForm(Location location = null)
        {
            // Set the locationId. Means that is a edit
            _locationId = (location != null) ? location.LocationId : 0;

            // Set the Form title
            Text = (_locationId != 0)
              ? AppConstants.GetViewTitle(Phrases.LocationEdit)
              : AppConstants.GetViewTitle(Phrases.LocationCreate);

            // hide the error labels
            lbErrorName.Visible = false;

            // Edit
            if (location != null)
            {
                tbName.Text = location.Name;
            }

            ShowDialog();
        }