示例#1
0
文件: Login.cs 项目: Ondurur/VIS
        private bool loginSuccessfullDB(string username, string pw)
        {
            DetiServices                ds = new DetiServices();
            VedouciServices             vs = new VedouciServices();
            Tuple <int, string, string> l;

            l = ds.LoginAs(username, pw);
            if (l != null)
            {
                this.username = l.Item2;
                int      id = l.Item1;
                MainForm mf = new MainForm(this, id);
                mf.Activate();
                mf.Show();
                mf.labelSigned.Text = "Signed as: " + ds.LoginAs(username, pw).Item2;
                mf.labelRole.Text   = "Role: " + ds.LoginAs(username, pw).Item3;

                return(true);
            }
            l = vs.LoginAs(username, pw);
            if (l != null)
            {
                int      id = l.Item1;
                MainForm mf = new MainForm(this, id);
                mf.Activate();
                mf.Show();
                mf.labelSigned.Text = "Signed as: " + username;
                mf.labelRole.Text   = "Role: Admin";

                return(true);
            }


            return(false);
        }
示例#2
0
        public DiteBecomeVed()
        {
            this.ds  = new DetiServices();
            this.all = ds.GetAll();

            InitializeComponent();

            for (int i = 0; i < all.Count(); i++)
            {
                if (all[i].Stav == 0)
                {
                    comboBoxDeti.Items.Add(all[i].Jmeno);
                }
            }
        }