Example #1
0
        /// <summary>
        /// Main form load event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmMain_Load(object sender, EventArgs e)
        {
            enableMenus(false);
            frmLogin frmLogin = new frmLogin();
            frmLogin.ShowDialog();
            lblDate.Text = DateTime.Now.ToString("dd-MMM-yyyy");
            List<Company> lstCompany = CompanyController.GetAll();
            if (lstCompany.Count > 0)
            {
                lblCompany.Text = lstCompany[0].Name;
            }
            else
            {
                lblCompany.Text = "";
            }

            if (frmLogin.success == true)
            {
                enableMenus(true);
                lblLoginName.Text = frmLogin.userName;
            }
            frmLogin = null;
        }
Example #2
0
        private void loginToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            frmLogin frmLogin = new frmLogin();
            frmLogin.ShowDialog();
            if (frmLogin.success == true)
            {
                enableMenus(true);
                lblLoginName.Text = frmLogin.userName;
            }
            List<Company> lstCompany = CompanyController.GetAll();
            if (lstCompany.Count > 0)
            {
                lblCompany.Text = lstCompany[0].Name;
            }
            else
            {
                lblCompany.Text = "";
            }

            frmLogin = null;
        }