예제 #1
0
파일: ADD_sale.cs 프로젝트: elvira94/oop
        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            Preparat pr    = new Preparat();
            Form1    f1    = this.Owner as Form1;
            int      index = f1.dataGridView1.CurrentCell.RowIndex;
            int      est   = Convert.ToInt32(f1.dataGridView1[5, index].Value);
            //  int kol=0;
            //   try
            //    {
            int kol = Convert.ToInt32(textBox3.Text);

            //}
            // catch { MessageBox.Show("Будьте осторожны!Неправильный формат данных."); }
            //  MessageBox.Show(kol.ToString());
            if (est < kol)
            {
                MessageBox.Show("Указанного количества нет в наличии");
            }
            else
            {
                k++;
                textBox2.Text = (kol * Convert.ToInt32(textBox2.Text)).ToString();
                f1.dataGridView1[5, index].Value = (Convert.ToInt32(f1.dataGridView1[5, index].Value) - kol).ToString();
                f1.nalDGVBindingSource.EndEdit();
            }
            f1.nalDGVBindingSource.EndEdit();
        }
예제 #2
0
파일: ADD_sale.cs 프로젝트: Geliya94/oop
        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            Preparat pr = new Preparat();
            Form1 f1 = this.Owner as Form1;
            int index = f1.dataGridView1.CurrentCell.RowIndex;
            int est = Convert.ToInt32(f1.dataGridView1[5, index].Value);
              //  int kol=0;
             //   try
            //    {
            int kol = Convert.ToInt32(textBox3.Text);
            //}
               // catch { MessageBox.Show("Будьте осторожны!Неправильный формат данных."); }
              //  MessageBox.Show(kol.ToString());
            if (est < kol)
            { MessageBox.Show("Указанного количества нет в наличии"); }
            else
            {
                k++;
                textBox2.Text = (kol * Convert.ToInt32(textBox2.Text)).ToString();
               f1.dataGridView1[5, index].Value = (Convert.ToInt32(f1.dataGridView1[5, index].Value) - kol).ToString();
               f1.nalDGVBindingSource.EndEdit();

            }
            f1.nalDGVBindingSource.EndEdit();
        }
예제 #3
0
        public void Update_Preparat(int id_preparat, int id_postavchik, string name, float price, int amount)
        {
            Preparat a = this.Preparat.Where(c => c.id_preparat == id_preparat).FirstOrDefault();

            a.id_postavchik = id_postavchik;
            a.name          = name;
            a.price         = price;
            a.amount        = amount;


            this.SubmitChanges();
        }
예제 #4
0
        public void ADD_Preparat(int id_postavchik, int id_setup, int id_group, string name, float price, int amount, DateTime srok)
        {
            Preparat a = new Preparat();

            a.id_postavchik = id_postavchik;
            a.id_setup      = id_setup;
            a.id_group      = id_group;
            a.name          = name;
            a.price         = price;
            a.amount        = amount;
            a.srok          = srok;
            this.Preparat.InsertOnSubmit(a);
            this.SubmitChanges();
        }
예제 #5
0
파일: DataBase.cs 프로젝트: Geliya94/oop
 public void ADD_Preparat(int id_postavchik, int id_setup, int id_group, string name, float price, int amount, DateTime srok)
 {
     Preparat a = new Preparat();
     a.id_postavchik = id_postavchik;
     a.id_setup = id_setup;
     a.id_group = id_group;
     a.name = name;
     a.price = price;
     a.amount = amount;
     a.srok = srok;
     this.Preparat.InsertOnSubmit(a);
     this.SubmitChanges();
 }
예제 #6
0
파일: Form1.cs 프로젝트: elvira94/oop
        private void preparat_menu_Click(object sender, EventArgs e)
        {
            Preparat prep = new Preparat();

            prep.Show();
        }
예제 #7
0
파일: Form1.cs 프로젝트: Geliya94/oop
 private void preparat_menu_Click(object sender, EventArgs e)
 {
     Preparat prep = new Preparat();
     prep.Show();
 }