private void button2_Click(object sender, EventArgs e) { //一键修改为空卷 OutInLibRecord outinrecord = new OutInLibRecord(); outinrecord.Date = DateTime.Now.ToString("yyyy-MM-dd"); // 2008-09-04 outinrecord.Time = DateTime.Now.ToString("HH:mm:ss"); outinrecord.Position = dt.Rows[0]["库存位置"].ToString(); outinrecord.EmptyNum = textBox1.Text.ToString() == null?null: textBox1.Text.ToString(); outinrecord.Goodscode = "卷筒"; outinrecord.GoodsState = "空卷"; outinrecord.CheckState = null; outinrecord.GoodsNum = null; outinrecord.Date = outinrecord.Date; outinrecord.Time = outinrecord.Time; outinrecord.Notes = "退库"; int r = orderHelper.UpdateLibInRecord(outinrecord.Position, outinrecord.EmptyNum, outinrecord.Goodscode, outinrecord.GoodsState, outinrecord.CheckState, outinrecord.GoodsNum, outinrecord.Date, outinrecord.Time, outinrecord.Notes); if (r > 0) { MessageBox.Show("更新成功"); this.Close(); } }
private void button3_Click(object sender, EventArgs e) { Control_number++; //一键修改为满卷 OutInLibRecord outinrecord = new OutInLibRecord(); outinrecord.Date = DateTime.Now.ToString("yyyy-MM-dd"); // 2008-09-04 outinrecord.Time = DateTime.Now.ToString("HH:mm:ss"); outinrecord.Position = dt.Rows[0]["库存位置"].ToString(); outinrecord.EmptyNum = textBox2.Text.ToString() == null ? null : textBox2.Text.ToString(); outinrecord.Goodscode = "01"; outinrecord.GoodsState = "满卷"; outinrecord.CheckState = "合格"; outinrecord.GoodsNum = outinrecord.Date.Replace("-", "").Substring(2, 6) + "01" + Control_number.ToString().PadLeft(2, '0'); outinrecord.Date = outinrecord.Date; outinrecord.Time = outinrecord.Time; outinrecord.Notes = "入库"; int r = orderHelper.UpdateLibInRecord(outinrecord.Position, outinrecord.EmptyNum, outinrecord.Goodscode, outinrecord.GoodsState, outinrecord.CheckState, outinrecord.GoodsNum, outinrecord.Date, outinrecord.Time, outinrecord.Notes); if (r > 0) { MessageBox.Show("更新成功"); this.Close(); } }
//点击修改按钮时,获取datagrid中的数据, private void btnUpdate_Click(object sender, EventArgs e) { OutInLibRecord outinrecord = new OutInLibRecord(); outinrecord.Position = dgvLibMess.Rows[0].Cells["库存位置"].Value.ToString(); outinrecord.EmptyNum = dgvLibMess.Rows[0].Cells["卷筒编号"].Value.ToString() == ""?null: dgvLibMess.Rows[0].Cells["卷筒编号"].Value.ToString(); outinrecord.Goodscode = dgvLibMess.Rows[0].Cells["物料规格"].Value.ToString() == "" ? null : dgvLibMess.Rows[0].Cells["物料规格"].Value.ToString(); outinrecord.GoodsState = dgvLibMess.Rows[0].Cells["物料状态"].Value.ToString() == "" ? null : dgvLibMess.Rows[0].Cells["物料状态"].Value.ToString(); outinrecord.CheckState = dgvLibMess.Rows[0].Cells["检测状态"].Value.ToString() == "" ? null : dgvLibMess.Rows[0].Cells["检测状态"].Value.ToString(); outinrecord.GoodsNum = dgvLibMess.Rows[0].Cells["生产批号"].Value.ToString() == "" ? null : dgvLibMess.Rows[0].Cells["生产批号"].Value.ToString(); outinrecord.Date = dgvLibMess.Rows[0].Cells["日期"].Value.ToString() == "" ? null : dgvLibMess.Rows[0].Cells["日期"].Value.ToString(); outinrecord.Time = dgvLibMess.Rows[0].Cells["时间"].Value.ToString() == "" ? null : dgvLibMess.Rows[0].Cells["时间"].Value.ToString(); outinrecord.Notes = dgvLibMess.Rows[0].Cells["备注"].Value.ToString() == "" ? null : dgvLibMess.Rows[0].Cells["备注"].Value.ToString(); int r = orderHelper.UpdateLibInRecord(outinrecord.Position, outinrecord.EmptyNum, outinrecord.Goodscode, outinrecord.GoodsState, outinrecord.CheckState, outinrecord.GoodsNum, outinrecord.Date, outinrecord.Time, outinrecord.Notes); if (r > 0) { MessageBox.Show("更新成功"); } }
private void button1_Click(object sender, EventArgs e) { //一键修改为空位 OutInLibRecord outinrecord = new OutInLibRecord(); outinrecord.Position = dt.Rows[0]["库存位置"].ToString(); outinrecord.EmptyNum = null; outinrecord.Goodscode = null; outinrecord.GoodsState = null; outinrecord.CheckState = null; outinrecord.GoodsNum = null; outinrecord.Date = null; outinrecord.Time = null; outinrecord.Notes = null; int r = orderHelper.UpdateLibInRecord(outinrecord.Position, outinrecord.EmptyNum, outinrecord.Goodscode, outinrecord.GoodsState, outinrecord.CheckState, outinrecord.GoodsNum, outinrecord.Date, outinrecord.Time, outinrecord.Notes); if (r > 0) { MessageBox.Show("更新成功"); this.Close(); } }