Example #1
0
        public RandomForm()
        {
            InitializeComponent();

            _db = WSconnect.Instance;
            _rng = new Random(DateTime.Now.Second * (int)(Tools.DTtoTS(DateTime.Now) / 1000));
        }
Example #2
0
        public RandomForm()
        {
            InitializeComponent();

            _db  = WSconnect.Instance;
            _rng = new Random(DateTime.Now.Second * (int)(Tools.DTtoTS(DateTime.Now) / 1000));
        }
Example #3
0
        // Constructor
        public LoginForm()
        {
            InitializeComponent();

            _db = WSconnect.Instance;

            txt_username.Text = "Philip";
            txt_password.Text = "admin1234";
        }
Example #4
0
        // Constructor
        public LoginForm()
        {
            InitializeComponent();

            _db = WSconnect.Instance;

            txt_username.Text = "Philip";
            txt_password.Text = "admin1234";
        }
Example #5
0
        // Constructor
        public MainForm()
        {
            InitializeComponent();

            _db = WSconnect.Instance;
            permissions_label.Text = _db.Permission;

            LoadUsers(true);
        }
Example #6
0
        // Constructor
        public MainForm()
        {
            InitializeComponent();

            _db = WSconnect.Instance;
            permissions_label.Text = _db.Permission;

            LoadUsers(true);
        }
Example #7
0
        // Contructor
        public UserForm(User user)
        {
            InitializeComponent();

            _db = WSconnect.Instance;
            DateTime now = DateTime.Now;

            date_birth.MinDate = new DateTime(now.Year - 99, now.Month, now.Day);
            date_birth.MaxDate = new DateTime(now.Year - 18, now.Month, now.Day);

            if (user == null)
            {
                _user = new User();
            }
            else
            {
                _user = user;
            }

            txt_guid.Text      = _user.UniqueID.ToString().ToUpper();
            txt_email.Text     = _user.Email;
            txt_user.Text      = _user.Username;
            txt_pass.Text      = _user.Password;
            txt_firstname.Text = _user.FirstName;
            txt_lastname.Text  = _user.LastName;
            if (_user.Birthday > date_birth.MaxDate || _user.Birthday < date_birth.MinDate)
            {
                date_birth.Value = date_birth.MaxDate;
            }
            else
            {
                date_birth.Value = _user.Birthday;
            }

            if (_user.Location != null)
            {
                num_lat.Value       = Convert.ToDecimal(_user.Location.Latitude);
                num_lon.Value       = Convert.ToDecimal(_user.Location.Longitude);
                date_location.Value = _user.Location.TimeStamp;
            }

            if (_user.Description != null)
            {
                txt_description.Text  = "Description object";
                btn_desc_add.Enabled  = false;
                btn_desc_del.Enabled  = false;
                btn_desc_edit.Enabled = true;
            }
            else
            {
                btn_desc_add.Enabled  = true;
                btn_desc_del.Enabled  = false;
                btn_desc_edit.Enabled = false;
            }
        }
Example #8
0
        // Contructor
        public UserForm(User user)
        {
            InitializeComponent();

            _db = WSconnect.Instance;
            DateTime now = DateTime.Now;
            date_birth.MinDate = new DateTime(now.Year - 99, now.Month, now.Day);
            date_birth.MaxDate = new DateTime(now.Year - 18, now.Month, now.Day);

            if (user == null) { _user = new User(); }
            else { _user = user; }

            txt_guid.Text = _user.UniqueID.ToString().ToUpper();
            txt_email.Text = _user.Email;
            txt_user.Text = _user.Username;
            txt_pass.Text = _user.Password;
            txt_firstname.Text = _user.FirstName;
            txt_lastname.Text = _user.LastName;
            if (_user.Birthday > date_birth.MaxDate || _user.Birthday < date_birth.MinDate)
            {
                date_birth.Value = date_birth.MaxDate;
            }
            else
            {
                date_birth.Value = _user.Birthday;
            }

            if (_user.Location != null)
            {
                num_lat.Value = Convert.ToDecimal(_user.Location.Latitude);
                num_lon.Value = Convert.ToDecimal(_user.Location.Longitude);
                date_location.Value = _user.Location.TimeStamp;
            }

            if (_user.Description != null)
            {
                txt_description.Text = "Description object";
                btn_desc_add.Enabled = false;
                btn_desc_del.Enabled = false;
                btn_desc_edit.Enabled = true;
            }
            else
            {
                btn_desc_add.Enabled = true;
                btn_desc_del.Enabled = false;
                btn_desc_edit.Enabled = false;
            }
        }