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); } } }
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"; } }
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"; } }
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"; } }
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"; } }
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"; } }
public static void NetStatus(ComboBox cmb) { using (ERBAEntities db = new ERBAEntities()) { cmb.DataSource = db.Netten.ToList(); cmb.ValueMember = "NetstatusID"; cmb.DisplayMember = "Netstatus1"; } }
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(); } }
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); } } }
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); } } }
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); } } }
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; }