Пример #1
0
        private void StockInButton_Click(object sender, EventArgs e)
        {
            StockInForm stockInForm = new StockInForm();

            stockInForm.Show();
            this.Hide();
        }
 //录入进货单
 private void toolIntoStock_Click(object sender, EventArgs e)
 {
     var db = new BathDBDataContext(LogIn.connectionString);
     //StockInForm inStockForm = new StockInForm(db, this);
        StockInForm inStockForm = new StockInForm(db, null);
     if (inStockForm.ShowDialog() == DialogResult.OK)
     {
         if (dgv.Rows.Count >= 50)
             return;
         dgv_show();
     }
 }
 private void toolEdit_Click(object sender, EventArgs e)
 {
     if (dgv.CurrentCell == null)
     {
         BathClass.printWarningMsg("未选中入库单!");
         return;
     }
     if (dgv.CurrentRow.Cells[0].Value.ToString()=="")
     {
         MessageBox.Show("请先选择一种商品!");
         return;
     }
     var db = new BathDBDataContext(LogIn.connectionString);
     StockIn stockin = db.StockIn.FirstOrDefault(x => x.id == Convert.ToInt32(dgv.CurrentRow.Cells[0].Value));
     StockInForm editform = new StockInForm(db, stockin);
     if(editform.ShowDialog()==DialogResult.OK)
         dgv_show();
 }