private void button_Cancel_Click(object sender, EventArgs e) { rate = null; textBoxRateName.Text = ""; textBoxRateIn.Text = ""; textBoxRateOut.Text = ""; }
private void button_SubmitRate_Click(object sender, EventArgs e) { try { if (!IsEmtyStr(textBoxRateName.Text) && !IsEmtyStr(textBoxRateIn.Text) && !IsEmtyStr(textBoxRateOut.Text)) { if (rate == null) { WarehouseBack.Classes.Rate newRate = new WarehouseBack.Classes.Rate(); newRate.Name = textBoxRateName.Text; newRate.RateIn = float.Parse(textBoxRateIn.Text, CultureInfo.InvariantCulture.NumberFormat); newRate.RateOut = float.Parse(textBoxRateOut.Text, CultureInfo.InvariantCulture.NumberFormat); newRate.Save(); } else { rate.Name = textBoxRateName.Text; rate.RateIn = float.Parse(textBoxRateIn.Text, CultureInfo.InvariantCulture.NumberFormat); rate.RateOut = float.Parse(textBoxRateOut.Text, CultureInfo.InvariantCulture.NumberFormat); rate.Save(); } rate = null; textBoxRateIn.Text = ""; textBoxRateOut.Text = ""; textBoxRateName.Text = ""; MessageBoxOk1(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void dataGridViewRates_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int id = Convert.ToInt32(dataGridViewRates.Rows[e.RowIndex].Cells[0].Value); rate = WarehouseBack.Classes.Rate.GetRate(id); textBoxRateIn.Text = rate.RateIn.ToString(); textBoxRateOut.Text = rate.RateOut.ToString(); textBoxRateName.Text = rate.Name; }
private void dataGridViewRates_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Right) { if (MessageBoxOk()) { int id = Convert.ToInt32(dataGridViewRates.Rows[e.RowIndex].Cells[0].Value); rate = WarehouseBack.Classes.Rate.GetRate(id); rate.Delete(); } } }
private void button_GetProductSell_Click(object sender, EventArgs e) { try { int id = Convert.ToInt32(textBox_SellProductID.Text); prodInForSell = WarehouseBack.Classes.ProductIn.GetProductInForSell(id); label_SellProdName.Text = prodInForSell.Name; WarehouseBack.Classes.Rate rateofprod = WarehouseBack.Classes.Rate.GetRate(prodInForSell.UnitID); textBoxPriceForSell.Text = (rateofprod.RateOut * prodInForSell.OutAmount).ToString(); MessageBoxOk1(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }