Esempio n. 1
0
        private void okBtn_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                var service = new HtService(nameTB.Text, passTB.Text);
                if (service.EnableToConnect)
                {
                    Hide();
                    Cursor = Cursors.Default;
                    var mainForm = new MainForm(service);
                    mainForm.Show();

                    SaveConfiguration();
                }
                else
                {
                    MessageBox.Show("Ви не має прав для входу в програму. Можливо, невірний пароль чи логін.",
                                    "Помилка входу", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                var mes = $"Unable to perform login. {ex.Message}";
                MessageBox.Show(mes, "LogIn error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        public AccountConfigForm(HtService service)
        {
            _service  = service;
            _accounts = service.Accounts;

            InitializeComponent();
        }
        public CategoryConfigForm(HtService service)
        {
            //_service = service;
            _tempCategories          = service.Categories.Select(c => new TempCategory(c)).ToList();
            _categoryBs.DataSource   = _tempCategories.Where(t => !t.IsDeleted).ToList();
            _categoryBs.ListChanged += CategoryBsOnListChanged;

            InitializeComponent();
        }
Esempio n. 4
0
        public OborotForm(HtService htService, Oborot existingOborot = null)
        {
            InitializeComponent();
            _service = htService;

            _defaultCurrencyId = Config.Instance.CurrencyId;
            currencyLbl.Text   = _defaultCurrencyId == 1 ? "грн." : "<ім'я валюти>";

            if (existingOborot != null)
            {
                UpdatedOborot      = existingOborot;
                addMoreBtn.Enabled = false;
            }
        }
Esempio n. 5
0
 public MainForm(HtService service)
 {
     InitializeComponent();
     _service = service;
 }