Esempio n. 1
0
 public void InsertAfdekmateriaal(int id, string naam, string omsch, string loc, string info, string lev, decimal prijs, string foto, string mag)
 {
     using (ERBAEntities db = new ERBAEntities())
     {
         try
         {
             var Afdek = new Afdekmateriaal();
             Afdek.AfdekID             = id;
             Afdek.Naam_afdekmateriaal = naam;
             Afdek.Omschrijving        = omsch;
             Afdek.Locatie             = loc;
             Afdek.Info               = info;
             Afdek.Leverancier        = lev;
             Afdek.Prijs              = prijs;
             Afdek.Afdekmateriaalfoto = foto;
             Afdek.Magazijn           = mag;
             db.Afdekmateriaal.Add(Afdek);
             db.SaveChanges();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "FOUT", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Esempio n. 2
0
 public static void Leveranciers(ComboBox cmb)
 {
     using (ERBAEntities db = new ERBAEntities())
     {
         cmb.DataSource = db.Leveranciers.OrderBy(g => g.Naam).ToList();
         cmb.ValueMember = "LEVID";
         cmb.DisplayMember = "Naam";
     }
 }
Esempio n. 3
0
 public static void AutoclaafNaam(ComboBox cmb)
 {
     using (ERBAEntities db = new ERBAEntities())
     {
         cmb.DataSource = db.SubLLocaties.Where(s => s.Type == "A" || s.Type == "P").ToList();
         cmb.ValueMember = "AutoclaafID";
         cmb.DisplayMember = "Naam";
     }
 }
Esempio n. 4
0
 public static void AutoclaafCode(ComboBox cmb)
 {
     using (ERBAEntities db = new ERBAEntities())
     {
         cmb.DataSource = db.SubLLocaties.Where(s => s.Vervallen == null || s.Vervallen > DateTime.Now).ToList();
         cmb.ValueMember = "AutoclaafID";
         cmb.DisplayMember = "Code";
     }
 }
Esempio n. 5
0
 public static void Netten(ComboBox cmb, int StatusCode)
 {
     using (ERBAEntities db = new ERBAEntities())
     {
         cmb.DataSource = db.Netnummers.Where(n => n.Netstatus == StatusCode).ToList();
         cmb.ValueMember = "NetID";
         cmb.DisplayMember = "Naam_net";
     }
 }
Esempio n. 6
0
 public static void Netten(ComboBox cmb)
 {
     using (ERBAEntities db = new ERBAEntities())
     {
         cmb.DataSource = db.Netten.OrderBy(g => g.Naam_net).ToList();
         cmb.ValueMember = "NetID";
         cmb.DisplayMember = "Naam_net";
     }
 }
Esempio n. 7
0
 public static void NetStatus(ComboBox cmb)
 {
     using (ERBAEntities db = new ERBAEntities())
     {
         cmb.DataSource = db.Netten.ToList();
         cmb.ValueMember = "NetstatusID";
         cmb.DisplayMember = "Netstatus1";
     }
 }
Esempio n. 8
0
 public static void Temperature(ComboBox cmb, string autoclaaf)
 {
     using (ERBAEntities db = new ERBAEntities())
     {
         var a = db.SubLLocaties.Where(i => i.Type == autoclaaf).FirstOrDefault();
         cmb.DataSource = db.Temperatuur.Where(c => c.AutoclaafType == a.Type).OrderBy(g => g.TempID).ToList();
         cmb.ValueMember = "TempID";
         cmb.DisplayMember = "Temperatuur1";
     }
 }
        private void cmbNetStatus_SelectionChangeCommitted(object sender, EventArgs e)
        {
            int x = int.Parse(cmbNetStatus.SelectedValue.ToString());

            using (ERBAEntities db = new ERBAEntities())
            {
                Comboboxes.Netten(cmbNet, x);
                gc.DataSource = db.Netnummers.Where(n => n.Netstatus == x).ToList();
            }
        }
Esempio n. 10
0
 public int getmax()
 {
     using (ERBAEntities db = new ERBAEntities())
     {
         try
         {
             var Afdek = db.Afdekmateriaal.Max(x => x.AfdekID);
             return(Afdek);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "FOUT", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return(-1);
         }
     }
 }
Esempio n. 11
0
 public void DeleteAfdekmateriaal(int id)
 {
     using (ERBAEntities db = new ERBAEntities())
     {
         try
         {
             var Afdek = db.Afdekmateriaal.Where(g => g.AfdekID == id).FirstOrDefault();
             db.Afdekmateriaal.Remove(Afdek);
             db.SaveChanges();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "FOUT", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Esempio n. 12
0
 public Afdekmateriaal GetAfdekmateriaal(int id)
 {
     using (ERBAEntities db = new ERBAEntities())
     {
         try
         {
             var Afdek = db.Afdekmateriaal.Where(g => g.AfdekID == id).FirstOrDefault();
             return(Afdek);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "FOUT", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return(null);
         }
     }
 }
Esempio n. 13
0
 public List <Afdekmateriaal> GetAllAfdekmateriaal()
 {
     using (ERBAEntities db = new ERBAEntities())
     {
         try
         {
             var Afdek = db.Afdekmateriaal.OrderBy(l => l.Naam_afdekmateriaal).ToList();
             return(Afdek);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "FOUT", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return(null);
         }
     }
 }
        public frmNetStatus()
        {
            InitializeComponent();
            Comboboxes.NetStatus(cmbNetStatus);
            Comboboxes.NetStatus(cmbNetstatusNaar);
            int x = int.Parse(cmbNetStatus.SelectedValue.ToString());

            using (ERBAEntities db = new ERBAEntities())
            {
                Comboboxes.Netten(cmbNet, x);
                gc.DataSource = db.Netnummers.Where(n => n.Netstatus == x).ToList();
            }
            Comboboxes.AutoclaafNaam(cmbClavenNaam);
            //RepositoryItemGridLookUpEdit rl = new RepositoryItemGridLookUpEdit();
            //using (ERBAEntities db = new ERBAEntities())
            //{
            //    rl.DataSource = db.Netstatus.Select(c => new { c.NetstatusID, c.Netstatus1 }).ToList();
            //    rl.ValueMember = "NetstatusID";
            //    rl.DisplayMember = "Netstatus1";
            //}
            //StatusNaar.ColumnEdit = rl;
        }