private void BtnCategoryUpdate_Click(object sender, EventArgs e) { #region Validation string notification = ""; if (string.IsNullOrWhiteSpace(txtCategoryName.Text)) { notification += "Lütfen Kategori Adı Giriniz.!\n"; } if (string.IsNullOrWhiteSpace(txtCategoryDescription.Text)) { notification += "Lütfen Kategori Açıklaması Giriniz.!"; } if (notification.Length > 0) { MessageBox.Show(notification); return; } #endregion _category.CategoryName = txtCategoryName.Text; _category.Description = txtCategoryDescription.Text; WinformHelpers.KontrolluKaydet(this); }
private void PctBranchDelete_Click(object sender, EventArgs e) { if (lsvBranches.SelectedIndices.Count == 0) { MessageBox.Show("Lüten Silmek İstediğiniz Bayiyi Seçiniz.!"); return; } var item = lsvBranches.SelectedItems[0]; Users user = (Users)item.Tag; Singleton.Context.Users.Remove(user); WinformHelpers.KontrolluKaydet(); BayiListeGuncelle(); }
private void PctCategoryDelete_Click(object sender, EventArgs e) { if (lsvCategory.SelectedItems.Count == 0) { MessageBox.Show("Lütfen Silmek İstediğniz Kategoriyi Seçiniz.!"); return; } var item = lsvCategory.SelectedItems[0]; Categories category = (Categories)item.Tag; Singleton.Context.Categories.Remove(category); WinformHelpers.KontrolluKaydet(); CategoryListeGuncelle(); }
private void PctOrdersReady_Click(object sender, EventArgs e) { if (lsvBranchOrders.SelectedIndices.Count == 0) { MessageBox.Show("Lütfen Ürün Seçiniz.!"); return; } var item = lsvBranchOrders.SelectedItems[0]; Orders order = (Orders)item.Tag; order.OrderStatu = "Sipariş Kargolanıyor"; WinformHelpers.KontrolluKaydet(); SiparisListeGuncelle(); }
private void BtnCategoryAdd_Click(object sender, EventArgs e) { #region Validation string notification = ""; if (string.IsNullOrWhiteSpace(txtCategoryName.Text)) { notification += "Lütfen Kategori Adı Giriniz.!\n"; } if (string.IsNullOrWhiteSpace(txtCategoryDescription.Text)) { notification += "Lütfen Kategori Açıklaması Giriniz.!"; } if (notification.Length > 0) { MessageBox.Show(notification); return; } #endregion Categories categories = new Categories() { CategoryName = txtCategoryName.Text, Description = txtCategoryDescription.Text }; Singleton.Context.Categories.Add(categories);//Veri tabanı yansımasını çağırıyoruz VE tabloya verileri giriyoruz //Verileri kontrollü kayıt ediyoruz.. WinformHelpers.KontrolluKaydet(this); }
private void BtnNewOrders_Click(object sender, EventArgs e) { Orders order = new Orders() { //Navigation Property Kullanıyoruz.Navigation Property'ler Entity ile beraber geldi. Navigation Property ilgli tablolara sırayla işlem yapmamızı sağlar UserId = _userId, OrderStatu = "test", OrderDate = DateTime.Now, ToOrder = "test", UnitPrice = 10 }; //Orders tablosuna insert işlemi //Forach order details foreach (ListViewItem item in lsvNewOrder.Items) { order.OrderDetail.Add((OrderDetail)item.Tag); } //Veri Tabanına eklemeye başlıyoruz Singleton.Context.Orders.Add(order); WinformHelpers.KontrolluKaydet(); }
private void BtnNewOrders_Click(object sender, EventArgs e) { Orders order = new Orders() { //Navigation Property Kullanıyoruz.Navigation Property'ler Entity ile beraber geldi. Navigation Property ilgli tablolara sırayla işlem yapmamızı sağlar UserId = _userId, StockId = _stock.StockId, ToOrder = cmbCustBranchName.Text, BranchId = int.Parse(cmbCustBranchName.SelectedValue.ToString()), OrderDate = DateTime.Now, OrderStatu = "Sipariş Alındı", UnitPrice = _stock.Products.UnitPrice, TotalUnitPrice = (_stock.Products.UnitPrice) * nudCustProductCount.Value, Quantity = Convert.ToInt32(nudCustProductCount.Value) }; int remaingStock = _stock.RemainingStock; _stock.RemainingStock = (short)(remaingStock - order.Quantity); //Veri Tabanına eklemeye başlıyoruz Singleton.Context.Orders.Add(order); WinformHelpers.KontrolluKaydet(this); }
private void BtnCancel_Click(object sender, EventArgs e) { _orders.OrderStatu = "Sipariş İptal Edildi"; WinformHelpers.KontrolluKaydet(this); }