Ejemplo n.º 1
0
        public static frmNewNaucnaOblast ShowDialogWithData(TwoFieldsDto naucnaOblast = null)
        {
            if (_instance == null || _instance.IsDisposed)
            {
                _instance = new frmNewNaucnaOblast(naucnaOblast);
            }
            else
            {
                _instance.NaucnaOblast = naucnaOblast;
            }

            ((Form)_instance).ShowDialog();
            return(_instance);
        }
        public static frmNewRole ShowDialogWithData(TwoFieldsDto role = null)
        {
            if (_instance == null || _instance.IsDisposed)
            {
                _instance = new frmNewRole(role);
            }
            else
            {
                _instance.Role = role;
            }

            ((Form)_instance).ShowDialog();
            return(_instance);
        }
Ejemplo n.º 3
0
        private frmNewNaucnaOblast(TwoFieldsDto naucnaOblast = null)
        {
            InitializeComponent();
            NaucnaOblast = naucnaOblast;

            if (NaucnaOblast != null)
            {
                txtNaziv.Text = NaucnaOblast.Naziv;
            }

            _apiService = new APIService(Routes.NaucneOblastiRoute);
            Text        = NaucnaOblast == null ? Properties.Resources.frmNewNaucnaOblastAdd : Properties.Resources.frmNewNaucnaOblastUpdate;

            var mainFormSize = MainForm.Instance.Size;

            Size = new Size(mainFormSize.Width - 16, mainFormSize.Height - 14);
            pnlMain.MinimumSize = Size;
            FormBorderStyle     = FormBorderStyle.None;

            SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            BackColor         = Color.Transparent;
            TransparencyKey   = Color.Transparent;
            pnlMain.BackColor = Color.FromArgb(125, 0, 0, 0);
        }