Example #1
0
 public TeamMemberPP(MySqlConnection c, TeamMember tm, MainDeptManagerApp pf)
 {
     InitializeComponent();
     connection = c;
     teamMember = tm;
     parentForm = pf;
     RefreshFields();
 }
Example #2
0
 public DepartmentManagerPP(MySqlConnection c, DeptManager dm, MainStoreManagerApp pf)
 {
     InitializeComponent();
     connection = c;
     manager = dm;
     parentForm = pf;
     RefreshFields();
 }
Example #3
0
        private void Save()
        {
            String fn = FirstInputBox.Text.Trim();
            String ln = LastInputBox.Text.Trim();
            String em = EmailInputBox.Text.Trim();
            String p = PassInputBox.Text;
            int d = parentForm.Database.StoreId;

            if (teamMember == null)
            {
                var proc = new dm_NewTeamMember(connection, em, p, fn, ln, d);
                proc.Execute();
                teamMember = new User(fn, ln, em, UserType.TEAM_MEMBER, proc.Id);
            }
            else
            {
                var proc = new dm_EditTeamMember(connection, em, fn, ln, teamMember.UserId);
                proc.Execute();
                teamMember = new User(fn, ln, em, UserType.TEAM_MEMBER, teamMember.UserId);
            }
        }
Example #4
0
        private void Save()
        {
            String fn = FirstInputBox.Text.Trim();
            String ln = LastInputBox.Text.Trim();
            String em = EmailInputBox.Text.Trim();
            String p = PassInputBox.Text;
            int s = parentForm.Database.StoreId;

            if (manager == null)
            {
                var proc = new sm_NewDepartmentManager(connection, em, p, fn, ln,s);
                proc.Execute();
                manager = new User(fn, ln, em, UserType.STORE_MANAGER, proc.Id);
            }
            else
            {
                var proc = new sm_EditDepartmentManager(connection, em, fn, ln, manager.UserId);
                proc.Execute();
                manager = new User(fn, ln, em, UserType.STORE_MANAGER, manager.UserId);
            }
        }
Example #5
0
        private void LoginCommand(UserType Type, String Email, String Pass)
        {
            if (Type == UserType.STORE_MANAGER)
            {
                var loginProc = new log_StoreManagerLogIn(Connection, Email, Pass);
                loginProc.Execute();

                if (loginProc.Result.SM_ID > 0)
                {
                    ConnectedUser = new User(loginProc.Result.SM_FIRST_NAME,
                            loginProc.Result.SM_LAST_NAME,
                            loginProc.Result.SM_EMAIL,
                            Type,
                            loginProc.Result.SM_ID);

                    StoreId = loginProc.Result.SM_STORE_ID;
                }
                else
                {
                    ConnectedUser = IncorectLogin();
                }
            }
            else if (Type == UserType.DEPT_MANAGER)
            {
                var loginProc = new log_DeptManagerLogIn(Connection, Email, Pass);
                loginProc.Execute();

                if (loginProc.Result.DM_ID > 0)
                {
                    ConnectedUser = new User(loginProc.Result.DM_FIRST_NAME,
                            loginProc.Result.DM_LAST_NAME,
                            loginProc.Result.DM_EMAIL,
                            Type,
                            loginProc.Result.DM_ID);

                    StoreId = loginProc.Result.DM_STORE_ID;

                    DeptId = loginProc.Result.DM_DEPT_ID;
                }
                else
                {
                    ConnectedUser = IncorectLogin();
                }
            }
            else if (Type == UserType.TEAM_MEMBER)
            {
                var loginProc = new log_TeamMemberLogIn(Connection, Email, Pass);
                loginProc.Execute();

                if (loginProc.Result.TM_ID > 0)
                {
                    ConnectedUser = new User(loginProc.Result.TM_FIRST_NAME,
                            loginProc.Result.TM_LAST_NAME,
                            loginProc.Result.TM_EMAIL,
                            Type,
                            loginProc.Result.TM_ID);
                }
                else
                {
                    ConnectedUser = IncorectLogin();
                }
            }
        }