Пример #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         if (!IsEmtyStr(textBoxProdInName.Text) && !IsEmtyStr(textBox_InCount.Text) &&
             !IsEmtyStr(textBox_AmountProd.Text) && !IsEmtyStr(textBoxProductInId.Text))
         {
             WarehouseBack.Classes.ProductIn newProdIn = new WarehouseBack.Classes.ProductIn();
             newProdIn.Name       = textBoxProdInName.Text;
             newProdIn.Count      = Convert.ToInt32(textBox_InCount.Text);
             newProdIn.CurrCount  = Convert.ToInt32(textBox_InCount.Text);
             newProdIn.Amount     = float.Parse(textBox_AmountProd.Text, CultureInfo.InvariantCulture.NumberFormat);
             newProdIn.OutAmount  = float.Parse(textBox_OutAmount.Text, CultureInfo.InvariantCulture.NumberFormat);
             newProdIn.ProducKey  = Convert.ToInt32(textBoxProductInId.Text);
             newProdIn.CountryID  = Convert.ToInt32(comboBox_ProdInCountry.SelectedValue);
             newProdIn.PlaceID    = Convert.ToInt32(comboBox_ProdInPlace.SelectedValue);
             newProdIn.CategoryID = Convert.ToInt32(comboBoxProdInCategory.SelectedValue);
             newProdIn.UnitID     = Convert.ToInt32(comboBox_UnitID.SelectedValue);
             newProdIn.Save();
             MessageBoxOk1();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     productin = null;
     textBoxProductInId.Text = "";
     comboBoxProdInCategory.SelectedValue = 0;
     textBoxProdInName.Text               = "";
     textBox_AmountProd.Text              = "";
     textBox_OutAmount.Text               = "";
     textBox_InCount.Text                 = "";
     comboBox_UnitID.SelectedValue        = 0;
     comboBox_ProdInPlace.SelectedValue   = 0;
     comboBox_ProdInCountry.SelectedValue = 0;
 }
Пример #3
0
        private void dataGridViewProductIn_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int id = Convert.ToInt32(dataGridViewProductIn.Rows[e.RowIndex].Cells[0].Value);

            productin = WarehouseBack.Classes.ProductIn.GetProductIn(id);
            textBoxProductInId.Text = productin.ProductInID.ToString();
            comboBoxProdInCategory.SelectedValue = productin.CategoryID;
            textBoxProdInName.Text               = productin.Name;
            textBox_AmountProd.Text              = productin.Amount.ToString();
            textBox_OutAmount.Text               = productin.OutAmount.ToString();
            textBox_InCount.Text                 = productin.Count.ToString();
            comboBox_UnitID.SelectedValue        = productin.UnitID;
            comboBox_ProdInPlace.SelectedValue   = productin.PlaceID;
            comboBox_ProdInCountry.SelectedValue = productin.CreateDate;
        }
Пример #4
0
 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);
     }
 }