Exemplo n.º 1
0
        private void btnLogout_Click(object sender, EventArgs e)
        {
            if (System.IO.File.Exists(@"C:\PowerCranes\user.txt"))
            {
                System.IO.File.Delete(@"C:\PowerCranes\user.txt");
            }
            fmLogin fLog = new fmLogin();

            fLog.ShowDialog();
            ShowCurrentUser();
        }
Exemplo n.º 2
0
        private void fmMain_Load(object sender, EventArgs e)
        {
            isLoading = true;
            fmLogin fLogin = new fmLogin();

            if (!System.IO.File.Exists(@"C:\PowerCranes\user.txt"))
            {
                DialogResult = fLogin.ShowDialog();
            }
            lblWeekEnding.Text  = CommonProcs.GetWeekEnding(DateTime.Now).ToShortDateString();
            dtpWeekEnding.Value = CommonProcs.GetWeekEnding(DateTime.Now);
            accessLevel         = int.Parse(MyConfig.ReadValue("accessLevel"));
            branch = int.Parse(MyConfig.ReadValue("branch"));
            Text   = "Timesheet Entry v." + Application.ProductVersion;
            cbBranch.SelectedIndex = branch + 1;
            ShowCurrentUser();
            LoadBranchCombos();

            isLoading = false;
            cbCompany.SelectedIndex    = 0;
            tbTabs.TabPages[1].Enabled = CheckCompleteForRecap();
            SetAccessFromAccessLevel(accessLevel);
            FillGridView(false);
        }