Exemplo n.º 1
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtusername.Text))
            {
                MetroFramework.MetroMessageBox.Show(this, "Please enter your username", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtusername.Focus();
                return;
            }
            try
            {
                using (IT_Project_DatabaseEntities db = new IT_Project_DatabaseEntities())
                {
                    var query = from u in db.users
                                where u.username == txtusername.Text && u.password == txtpassword.Text
                                select u;

                    if (query.SingleOrDefault() != null)
                    {
                        this.Hide();
                        frm_Main frm = new frm_Main();
                        frm.ShowDialog();
                    }
                    else
                    {
                        MetroFramework.MetroMessageBox.Show(this, "You Username or password is incorrect!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                MetroFramework.MetroMessageBox.Show(this, ex.Message, "Wrong", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        private void OrchardFormReport_Load(object sender, EventArgs e)
        {
            IT_Project_DatabaseEntities db = new IT_Project_DatabaseEntities();
            OrchardReport cr = new OrchardReport();

            cr.SetDataSource(db.GetOrchardOwner().ToList());
            CrystalOrchardViewer.ReportSource = cr;
        }
Exemplo n.º 3
0
        private void HarvestForm_Report_Load(object sender, EventArgs e)
        {
            IT_Project_DatabaseEntities db = new IT_Project_DatabaseEntities();
            CrystalHarvestReport1       cr = new CrystalHarvestReport1();

            cr.SetDataSource(db.HarvestTables.ToList());
            crystalReportHarvestViewer.ReportSource = cr;
        }
Exemplo n.º 4
0
        private void BeekeeperReportcs_Load(object sender, EventArgs e)
        {
            IT_Project_DatabaseEntities db = new IT_Project_DatabaseEntities();
            CrystalBeekeeperReport      cr = new CrystalBeekeeperReport();

            cr.SetDataSource(db.GetBeekeeperMasterlist().ToList());
            crystalBeekeeperReportViewer.ReportSource = cr;
        }
Exemplo n.º 5
0
        private void frmSiteReport_Load(object sender, EventArgs e)
        {
            IT_Project_DatabaseEntities db = new IT_Project_DatabaseEntities();
            CrystalReportSite           cr = new CrystalReportSite();

            cr.SetDataSource(db.GetSiteOwner().ToList());
            crystalReportViewer1.ReportSource = cr;
        }
Exemplo n.º 6
0
 private void Beekeeper_Load(object sender, EventArgs e)
 {
     test2 = new IT_Project_DatabaseEntities();
     beekeeperTableBindingSource.DataSource = test2.BeekeeperTables.ToList();
 }
Exemplo n.º 7
0
 private void frmSite_Load(object sender, EventArgs e)
 {
     test = new IT_Project_DatabaseEntities();
     siteTableBindingSource.DataSource = test.SiteTables.ToList();
 }
Exemplo n.º 8
0
 private void Orchardcs_Load(object sender, EventArgs e)
 {
     test1 = new IT_Project_DatabaseEntities();
     orchardTableBindingSource.DataSource = test1.OrchardTables.ToList();
 }
Exemplo n.º 9
0
 private void Harvest_Load(object sender, EventArgs e)
 {
     test3 = new IT_Project_DatabaseEntities();
     harvestTableBindingSource.DataSource = test3.HarvestTables.ToList();
 }