コード例 #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            user = tbUsername.Text;
            pass = tbPassword.Text;

            if (loginManagment.Login(user, pass) == "Administrator")
            {
                MainAdmin MainAdmin = new MainAdmin();
                MainAdmin.Show();
                this.Visible = false;
            }
            else if (loginManagment.Login(user, pass) == "Manager")
            {
                MainManager MainManager = new MainManager();
                MainManager.Show();
                this.Visible = false;
            }
            else if (loginManagment.Login(user, pass) == "Depot Worker")
            {
                MainDepot MainDepot = new MainDepot();
                MainDepot.Show();
                this.Visible = false;
            }
            else
            {
                MessageBox.Show("Wrong Username/Password");
            }
            tbUsername.Text = "Username";
            tbPassword.Text = "Password";
        }
コード例 #2
0
ファイル: AssignShift.cs プロジェクト: razvan286/HardwareShop
        public AssignShift(DateTime date, MainAdmin main)
        {
            InitializeComponent();
            this.shiftDate = date;
            this.Text      = $"Assign shift on date: {tbDate.Text}";
            tbDate.Text    = $"{date.Day}/{date.Month}/{date.Year}, {date.DayOfWeek}";

            assignManager = new AssignShiftManagment(shiftDate);
            assignManager.ShowComboBox(date, cmbBxWorkShiftWeekDay, cmbBxWorkShiftSaturday, cmbBxWorkShiftSunday);
        }
コード例 #3
0
 // -- MAIN methods --
 public void GenerateDayPanel(int totalDays, FlowLayoutPanel flDays)
 {
     main = new MainAdmin();
     flDays.Controls.Clear();
     listFlDay.Clear();
     for (int i = 1; i <= totalDays; i++)
     {
         FlowLayoutPanel fl = new FlowLayoutPanel();
         fl.Name          = $"flDay{i}";
         fl.Size          = new Size(140, 95);
         fl.BackColor     = Color.White;
         fl.BorderStyle   = BorderStyle.FixedSingle;
         fl.FlowDirection = FlowDirection.TopDown;
         fl.Cursor        = Cursors.Hand;
         fl.Click        += new EventHandler(main.Flow_Click);
         fl.AutoScroll    = true;
         fl.WrapContents  = false;
         flDays.Controls.Add(fl);
         listFlDay.Add(fl);
     }
 }