private void TextBoxProductCountSell_TextChanged(object sender, EventArgs e) { try { if (TextBoxProductCountSell.Text != "") { SellBO objSellBO = new SellBO(); objSellBO.ProductName = ComboBoxProductNameSell.Text; objSellBO.TypeName = ComboBoxProductTypeSell.Text; objSellBO.ProductCount = Convert.ToInt32(TextBoxProductCountSell.Text); SellBL objSellBL = new SellBL(); decimal Price = objSellBL.CalculatePriceBL(objSellBO); string PriceStr = Price.ToString("0.##"); TextBoxTotalPrice.Text = PriceStr; } else { TextBoxTotalPrice.Text = ""; } } catch (Exception ex) { throw ex; } }
private void ButtonClearSellHistory_Click(object sender, EventArgs e) { SellBL objSellBL = new SellBL(); objSellBL.ClearSellHistoryBL(); MessageBox.Show("Satış geçmişi temizlenmiştir"); }
protected void PopulateGridViewSell() { SellBL objSellBL = new SellBL(); DataSet ds = objSellBL.PopulateGridViewSellBL(); ds.Tables[0].Columns[0].ColumnName = "Firma Adı"; ds.Tables[0].Columns[1].ColumnName = "Ürün Adı"; ds.Tables[0].Columns[2].ColumnName = "Ürün Türü"; ds.Tables[0].Columns[3].ColumnName = "Sayısı"; ds.Tables[0].Columns[4].ColumnName = "Fiyat"; ds.Tables[0].Columns[5].ColumnName = "Tarih"; GridViewSellHistory.DataSource = ds; GridViewSellHistory.DataMember = ds.Tables[0].ToString(); }
private void ButtonSell_Click(object sender, EventArgs e) { try { if (TextBoxProductCountSell.Text != "") { SellBO objSellBO = new SellBO(); objSellBO.CustomerName = ComboBoxCompanyNameSell.Text; objSellBO.ProductName = ComboBoxProductNameSell.Text; objSellBO.TypeName = ComboBoxProductTypeSell.Text; objSellBO.ProductCount = Convert.ToInt32(TextBoxProductCountSell.Text); string Date = DateTimePicker.Value.ToString("dd/MM/yyyy"); objSellBO.SellDate = Convert.ToDateTime(Date); SellBL objSellBL = new SellBL(); bool Sold = objSellBL.SellProductBL(objSellBO); if (Sold == true) { MessageBox.Show("Satış başarı ile gerçekleştirilmiştir"); TextBoxProductCountSell.Clear(); ComboBoxCompanyNameSell.SelectedIndex = 0; ComboBoxProductNameSell.SelectedIndex = 0; DateTimePicker.Value = DateTime.Today; PopulateGridViewSell(); } else { MessageBox.Show("Seçilen ürün için yeterli stoğunuz bulunmamaktadır. Kalan ürün sayısı: " + Constants.RemainingProduct); } } else { MessageBox.Show("Lütfen satış adedi giriniz"); } } catch (Exception ex) { throw ex; } }
private void CustomerHistory_Load(object sender, System.EventArgs e) { SellBL objSellBL = new SellBL(); DataSet ds = objSellBL.PopulateGridViewCustomerHistoryBL(); ds.Tables[0].Columns[0].ColumnName = "Firma Adı"; ds.Tables[0].Columns[1].ColumnName = "Ürün Adı"; ds.Tables[0].Columns[2].ColumnName = "Ürün Türü"; ds.Tables[0].Columns[3].ColumnName = "Sayısı"; ds.Tables[0].Columns[4].ColumnName = "Fiyat"; ds.Tables[0].Columns[5].ColumnName = "Tarih"; DataGridViewCustomerHistory.DataSource = ds; DataGridViewCustomerHistory.DataMember = ds.Tables[0].ToString(); string decStr = objSellBL.GetTotalLoanBL().ToString("0.##"); TextBoxTotalLoan.Text = decStr; }
private void ButtonPayLoan_Click(object sender, EventArgs e) { SellBL objSellBL = new SellBL(); SellBO objSellBO = new SellBO(); objSellBO.CustomerName = Constants.CompanyNameCustomerHistory; bool payed = objSellBL.PayLoanDA(objSellBO, Convert.ToDecimal(TextBoxPayment.Text)); if (payed == false) { MessageBox.Show("Borçtan daha fazla ödeme yapılamaz"); } else { MessageBox.Show("Ödeme Gerçekleşti"); string decStr = objSellBL.GetTotalLoanBL().ToString("0.##"); TextBoxTotalLoan.Text = decStr; TextBoxPayment.Text = ""; } }