Esempio n. 1
0
        private void yourAccountToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (yourAccountToolStripMenuItem.Checked)
            {
                try
                {
                    Log("Closing Metadata Window");
                    if (frmYourAccount == null || frmYourAccount.IsDisposed)
                    {
                        frmYourAccount.Close();
                    }
                }
                catch (Exception)
                {
                }
            }
            else
            {
                Log("Opening Metadata Window");
                if (frmYourAccount == null || frmYourAccount.IsDisposed)
                {
                    frmYourAccount = new FrmUser();
                }
                frmYourAccount.Show(dockPanel, DockState.DockRight);
            }

            yourAccountToolStripMenuItem.Checked = !yourAccountToolStripMenuItem.Checked; // Toggle the check state in
        }
Esempio n. 2
0
        private void usuariosToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmUser frmUser = new FrmUser();

            frmUser.Show();
            this.Hide();
        }
Esempio n. 3
0
        private void UserManagement(IEquatable <string> operationRequest)
        {
            using (var frmUser = new FrmUser())
            {
                if (operationRequest.Equals(Resources.OperationRequestUpdate))
                {
                    if (dgvUser.CurrentRow != null)
                    {
                        frmUser.User = _UserList[dgvUser.CurrentRow.Index];
                    }
                }

                if (frmUser.ShowDialog(this) == DialogResult.OK)
                {
                    try
                    {
                        if ((operationRequest.Equals(Resources.OperationRequestInsert)))
                        {
                            _UserList.Add(frmUser.User);
                        }
                        dgvUser.Refresh();
                        UpdateResultInfo();
                        EnableActionButton();
                    }
                    catch (Exception exception)
                    {
                        FrmExtendedMessageBox.UnknownErrorMessage(
                            Resources.MsgCaptionUnknownError,
                            exception.Message);
                    }
                }
            }
        }
Esempio n. 4
0
        public void RouteUser(string username, string password)
        {
            Form frm;
            User usr = SearchForUser(username);

            if (usr != null && Hashing.ValidatePassword(password, usr.password))
            {
                switch (usr.user_type_id)
                {
                case 1:
                    frm = new FrmUser(usr);
                    frm.ShowDialog();
                    break;

                case 2:
                    frm = new FrmSupervisor(usr);
                    frm.ShowDialog();
                    break;

                case 3:
                    frm = new FrmAdmin(usr);
                    frm.ShowDialog();

                    break;
                }
            }
            else
            {
                string title   = "Advertencia";
                string message = "Contraseña incorrecta o nombre de usuario incorrecto";
                Dialogs.OkDialog(title, message);
            }
        }
Esempio n. 5
0
        private void BtnEditUsers_Click(object sender, EventArgs e)
        {
            // Open up the User Crud Form.
            FrmUser editUser = new FrmUser();

            editUser.ShowDialog();
        }
Esempio n. 6
0
        private void buttonItem2_Click(object sender, EventArgs e)
        {
            var frm = new FrmUser {
                MdiParent = this
            };

            frm.Show();
        }
 private void barButtonItemUser_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (_fUser == null || _fUser.IsDisposed)
     {
         _fUser           = new FrmUser();
         _fUser.MdiParent = this;
         _fUser.Show();
     }
     else
     {
         _fUser.Activate();
     }
 }
Esempio n. 8
0
        /// <summary>
        /// 用户管理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mmUserManage_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //write menu item click log
            MenuClickLog(e);
            if (IsExistWindow("FrmUser"))
            {
                return;
            }
            FrmUser frm = new FrmUser();

            frm.MdiParent = this;
            BindClickEventToAllBuutonControl(frm);
            SetStyleController(frm, styleController);
            frm.Show();
        }
Esempio n. 9
0
        private void TsView_Click(object sender, EventArgs e)
        {
            if (dgvMain.Rows.Count == 0)
            {
                MessageBox.Show(@"There are no records to view.", @"Info", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (_currentModule == ModGlobal.ModUserManagement)
            {
                var user = new FrmUser(Convert.ToInt64(dgvMain.SelectedRows[0].Cells[0].Value), ModGlobal.FormStatus.IsView);
                user.ShowDialog();
            }
            else if (_currentModule == ModGlobal.ModUserPrivileges)
            {
                var user = new FrmUserPrivileges(Convert.ToInt32(dgvMain.SelectedRows[0].Cells[0].Value), ModGlobal.FormStatus.IsView);
                user.ShowDialog();
            }
            else if (_currentModule == ModGlobal.ModAreaProfile)
            {
                var area = new FrmAreaProfile(Convert.ToInt64(dgvMain.SelectedRows[0].Cells[0].Value), ModGlobal.FormStatus.IsView);
                area.ShowDialog();
            }
            else if (_currentModule == ModGlobal.ModLots)
            {
                var lot = new FrmLots(Convert.ToInt64(dgvMain.SelectedRows[0].Cells[0].Value), ModGlobal.FormStatus.IsView);
                lot.ShowDialog();
            }
            else if (_currentModule == ModGlobal.ModAgents)
            {
                var agent = new FrmAgents(Convert.ToInt64(dgvMain.SelectedRows[0].Cells[0].Value), ModGlobal.FormStatus.IsView);
                agent.ShowDialog();
            }
            else if (_currentModule == ModGlobal.ModClients)
            {
                var client = new FrmClients(Convert.ToInt64(dgvMain.SelectedRows[0].Cells[0].Value), ModGlobal.FormStatus.IsView);
                client.ShowDialog();
            }
            else if (_currentModule == ModGlobal.ModAcquisition)
            {
                var acquisition = new FrmAcquisition(Convert.ToInt64(dgvMain.SelectedRows[0].Cells[0].Value), ModGlobal.FormStatus.IsView);
                acquisition.ShowDialog();
            }
        }
Esempio n. 10
0
        private void TsAdd_Click(object sender, EventArgs e)
        {
            if (_currentModule == ModGlobal.ModUserManagement)
            {
                var user = new FrmUser(0, ModGlobal.FormStatus.IsNew);
                user.ShowDialog();

                if (user.IsSaved)
                {
                    LoadData();
                }
            }
            else if (_currentModule == ModGlobal.ModUserPrivileges)
            {
                var user = new FrmUserPrivileges(0, ModGlobal.FormStatus.IsNew);
                user.ShowDialog();

                if (user.IsSaved)
                {
                    LoadData();
                }
            }
            else if (_currentModule == ModGlobal.ModAreaProfile)
            {
                var area = new FrmAreaProfile(0, ModGlobal.FormStatus.IsNew);
                area.ShowDialog();

                if (area.IsSaved)
                {
                    LoadData();
                }
            }
            else if (_currentModule == ModGlobal.ModLots)
            {
                const int isOpen = 1;

                var area = _db.AreaProfiles.FirstOrDefault(a => a.Status == isOpen);

                if (area == null)
                {
                    MessageBox.Show(@"There are no active Area Profile for Lot to assign to. Please contact the administrator for more info.", @"Info", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                var lot = new FrmLots(0, ModGlobal.FormStatus.IsNew);
                lot.ShowDialog();

                if (lot.IsSaved)
                {
                    LoadData();
                }
            }
            else if (_currentModule == ModGlobal.ModAgents)
            {
                var agent = new FrmAgents(0, ModGlobal.FormStatus.IsNew);
                agent.ShowDialog();

                if (agent.IsSaved)
                {
                    LoadData();
                }
            }
            else if (_currentModule == ModGlobal.ModClients)
            {
                var client = new FrmClients(0, ModGlobal.FormStatus.IsNew);
                client.ShowDialog();

                if (client.IsSaved)
                {
                    LoadData();
                }
            }
            else if (_currentModule == ModGlobal.ModAcquisition)
            {
                var acquisition = new FrmAcquisition(0, ModGlobal.FormStatus.IsNew);
                acquisition.ShowDialog();

                if (acquisition.IsSaved)
                {
                    LoadData();
                }
            }
        }
Esempio n. 11
0
        private void ToolStripMenuItem_User_Click(object sender, EventArgs e)
        {
            FrmUser user = new FrmUser();

            user.ShowDialog();
        }
Esempio n. 12
0
        private void buttonItem32_Click(object sender, EventArgs e)
        {
            FrmUser diLiaoSet = new FrmUser(bar1);

            SetTabShow("用户与权限", diLiaoSet);
        }
Esempio n. 13
0
        /// <summary>
        /// @author:khoaht
        /// @createdate:5/2008
        /// </summary>
        /// <param name="formId"></param>
        /// <returns></returns>
        private CommonForm GetFormObject(int formId)
        {
            CommonForm frm = null;
            switch (formId)
            {
                case CONFIG.FORM_CUSTOMER:
                    frm = new FrmCustomer();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_CLIP:
                    frm = new FrmClip();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_WORKSTATION:
                    frm = new FrmWorkstation();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_WORKSTATION_STATUS:
                    frm = new FrmListWorkstationStatus();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_AREA:
                    frm = new FrmArea();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_SCHEDULE:
                    frm = new FrmSchedule();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_CSDL:
                    frm = new FrmDBConfigServer();
                    break;
                case CONFIG.FORM_ABOUT:
                    frm = new AboutAdvertise();
                    break;
                case CONFIG.FORM_CONFIG_PROPERTIES:
                    frm = new FrmConfigProperties();
                    break;
                    // REPORT FORM
                case   CONFIG.FORM_REPORT_CURRENCY:
                    frm = new FrmCurrencyReport();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_REPORT_WORKSTATION:
                    frm = new FrmRptWorkstatoinFree();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_REPORT_CUSTOMER:
                    frm = new FrmRptScheduleBillDetail();
                    frm.MdiParent = this;
                    break;

                     // Admin tool
                case CONFIG.FORM_ADMIN_GROUPS:
                    frm = new FrmGroup();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_ADMIN_USERS:
                    frm = new FrmUser();
                    frm.MdiParent = this;
                    break;
            }

            return frm;
        }
Esempio n. 14
0
 public FrmFilterUser(FrmUser _frmUser)
 {
     InitializeComponent();
     this.frmUser = _frmUser;
 }
Esempio n. 15
0
 public FrmFilterUser(FrmUser _frmUser)
 {
     InitializeComponent();
     this.frmUser = _frmUser;
 }