public List <Product> Listeleme() { using (EMarketContext context = new EMarketContext()) { return(context.Products.ToList()); } }
public List <Order> Listeleme() { using (EMarketContext context = new EMarketContext()) { return(context.Orders.ToList()); } }
public void Ekle(Order order) //Model Binding { using (EMarketContext context = new EMarketContext()) { context.Orders.Add(order); context.SaveChanges(); } }
public void Ekle(Product product) //Model Binding { using (EMarketContext context = new EMarketContext()) { context.Products.Add(product); context.SaveChanges(); } }
public void Ekle(User user) { using (EMarketContext context = new EMarketContext()) { context.Users.Add(user); context.SaveChanges(); } }
public void Guncelle(Order order) { using (EMarketContext context = new EMarketContext()) { var entity = context.Entry(order); entity.State = EntityState.Modified; context.SaveChanges(); } }
public void Sil(Order order) { using (EMarketContext context = new EMarketContext()) { var entity = context.Entry(order); entity.State = EntityState.Deleted; context.SaveChanges(); } }
public void Sil(Product product) { using (EMarketContext context = new EMarketContext()) { var entity = context.Entry(product); entity.State = EntityState.Deleted; context.SaveChanges(); } }
public void Guncelle(Product product) //Model Binding { using (EMarketContext context = new EMarketContext()) { var entity = context.Entry(product); entity.State = EntityState.Modified; context.SaveChanges(); } }
private void Form1_Load(object sender, EventArgs e) { this.Width = 817; using (EMarketContext context = new EMarketContext()) { dgwProduct.DataSource = context.Products.ToList(); } using (EMarketContext context = new EMarketContext()) { dgwSiparisListeleme.DataSource = context.GetOrders.ToList(); } lblCustomerName.Text = dgwSiparisListeleme.Rows[CustomerOrderCounter].Cells[1].Value.ToString(); lblCustomerAddress.Text = dgwSiparisListeleme.Rows[CustomerOrderCounter].Cells[2].Value.ToString(); lblCustomerContents.Text = dgwSiparisListeleme.Rows[CustomerOrderCounter].Cells[6].Value.ToString(); //lblCustomerContents.Text = lblCustomerContents.Text+"/n"+ dgwSiparisListeleme.Rows[0].Cells[6].Value.ToString(); }