/// <summary> /// 出库单列表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void left_btn_out_1_Click(object sender, EventArgs e) { body.Controls.Clear(); //清除body中所有控件 OutInventory oi = new OutInventory(); oi.MdiParent = this; oi.Dock = DockStyle.Fill; oi.Parent = body; oi.Show(); }
/// <summary> /// 出库按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_storage_Click(object sender, EventArgs e) { bool isnull = true; foreach (Control c in this.Controls) { if (c is TextBox && c.Text == "") { isnull = false; } if (c is ComboBox && c.Text == "") { isnull = false; } } if (labe_goods.Text == "双击选择物品" || labe_goods.Text == "") { isnull = false; } if (!isnull) { MessageBox.Show("请填写完整!", "警告!"); return; } //插入出库记录 bm.Warehouse_id = Int32.Parse(com_warehouse_id.SelectedValue.ToString()); bm.Goods_id = Int32.Parse(goods_id); bm.Operation_type_id = Int32.Parse(com_type_id.SelectedValue.ToString()); bm.Goods_amount = Int32.Parse(text_goods_amount.Text); bm.Goods_price = Int32.Parse(text_goods_price.Text); bm.Client_id = Int32.Parse(com_client_id.SelectedValue.ToString()); bm.Bill_note = text_bill_note.Text; bm.Lot_number = text_lot_number.Text; bm.Operation_time = DateTime.Now.ToString(); bm.Manufacture_date = ""; bm.Expiration_date = ""; bm.Manager_id = LoginInfo.manager_info.Id; bb.Insert(bm); double goods_total = ib.GetPrice(Int32.Parse(goods_id)) * bm.Goods_amount; //修改库存信息 ib.Update(Int32.Parse(goods_id), bm.Goods_amount, goods_total); OutInventory oi = new OutInventory(); oi.TopLevel = false; oi.MdiParent = this.MdiParent; oi.Parent = this.Parent; oi.Dock = DockStyle.Fill; oi.Show(); this.Close(); }