/// <summary> /// 搜索订单 /// </summary> /// <param name="OrderNo">订单号</param> private void searchOrder(string OrderNo) { if (newTime.starTime != null && newTime.endTime != null) { dataGridView1.Rows.Clear(); dataBase read = new dataBase(); //bool returnBool; //returnBool = read.checkOrder(stockOrOrder.Text.ToString()); if (!read.existSearchOrder(stockOrOrder.Text.ToString())) { MessageBox.Show("没有相应订单"); return; } info searchContent = read.searchOrder(stockOrOrder.Text.ToString()); dataGridView1.Rows.Add(); dataGridView1.Rows[0].Cells["Id"].Value = 0; dataGridView1.Rows[0].Cells["OrderNo"].Value = searchContent.OrderNo; dataGridView1.Rows[0].Cells["PayTime"].Value = searchContent.PayTime; dataGridView1.Rows[0].Cells["RecevieName"].Value = searchContent.RecevieName; dataGridView1.Rows[0].Cells["ReceiveTel"].Value = searchContent.ReceiveTel; dataGridView1.Rows[0].Cells["OrderMoney"].Value = searchContent.OrderMoney; dataGridView1.Rows[0].Cells["Behavior"].Value = "详情"; string ResultStr = string.Empty; switch (searchContent.OrderState) { case 0: ResultStr = "待确认"; break; case 1: ResultStr = "已确认"; break; case 2: ResultStr = "已取消"; break; case 4: ResultStr = "无效"; break; default: break; } switch (searchContent.PayState) { case 0: ResultStr += "未支付"; break; case 2: ResultStr += "已支付"; break; default: break; } switch (searchContent.ShoppingState) { case 0: ResultStr += "未发货"; break; case 1: ResultStr += "备货中"; break; case 2: ResultStr += "发货中"; break; case 3: ResultStr += "已发货"; break; case 4: ResultStr += "确认收货"; break; default: break; } dataGridView1.Rows[0].Cells["OrderState"].Value = ResultStr; } KindView = 0; }
private void button5_Click(object sender, EventArgs e) { if (KindView == 1) { if (KindView == 1) //写入配货员编码 { dataBase sqlConn = new dataBase(); #region if (sqlConn.checkId(stockOrOrder.Text.ToString())) //检查是否有配货员id { if (sqlConn.checkedStokUperCodeOrder(stockOrOrder.Text.ToString())) { MessageBox.Show("此售货员正在备货"); return; } //变更状态 if (sqlConn.WriteOrderState(dataGridView1.Rows[0].Cells["OrderNo"].Value.ToString(), 1) && sqlConn.WriteShoppingId(dataGridView1.Rows[0].Cells["OrderNo"].Value.ToString(), stockOrOrder.Text.ToString()) == 1) { moban newmoban = new moban(); printShow(dataGridView1.Rows[0].Cells["OrderNo"].Value.ToString(), 0, newmoban); //打印 //写入日志 Log_Order_info newLog = new Log_Order_info(); newLog = sqlConn.Log_Getinfo(dataGridView1.Rows[0].Cells["OrderNo"].Value.ToString()); newLog.Remark = "订单管理工具"; newLog.Creater = sqlConn.searchContent("ManageName", "ManageTel", stockOrOrder.Text.ToString(), "yl_ManageAccount"); newLog.UserCode = Convert.ToInt32(sqlConn.searchContent("UserCode", "ManageTel", stockOrOrder.Text.ToString(), "yl_ManageAccount")); newLog.Pubtime = DateTime.Now.ToString(); sqlConn.Write_Log(newLog); stockOrOrder.Text = "订单" + dataGridView1.Rows[0].Cells["OrderNo"].Value.ToString() + "已由备货员" + stockOrOrder.Text.ToString() + "开始备货"; weifahuoShow(); } else { stockOrOrder.Text = "订单" + dataGridView1.Rows[0].Cells["OrderNo"].Value.ToString() + "备货失败"; } } else { stockOrOrder.Text = "没有该配货员"; } #endregion return; } } if (KindView == 2) { if (KindView == 2) //写入配货员编码 { dataBase sqlConn = new dataBase(); #region if (sqlConn.checkOrder(stockOrOrder.Text.ToString())) //检查是否有此订单 { //变更状态 if (sqlConn.WriteOrderState(stockOrOrder.Text.ToString(), 2) && sqlConn.WriteCheckerCodeId(stockOrOrder.Text.ToString(), adminId) == 1) { //printShow(stockOrOrder.Text.ToString());//打印 //写入日志 Log_Order_info newLog = new Log_Order_info(); newLog = sqlConn.Log_Getinfo(stockOrOrder.Text.ToString()); newLog.Remark = "订单管理工具"; newLog.Creater = sqlConn.searchContent("ManageName", "ManageTel", adminId, "yl_ManageAccount"); newLog.UserCode = Convert.ToInt32(sqlConn.searchContent("UserCode", "ManageTel", adminId, "yl_ManageAccount")); newLog.Pubtime = DateTime.Now.ToString(); sqlConn.Write_Log(newLog); stockOrOrder.Text = "订单" + stockOrOrder.Text.ToString() + "检验成功"; beihuozhongShow(); } else { stockOrOrder.Text = "检验失败"; } } else { stockOrOrder.Text = "没有该订单"; } #endregion return; } } if (KindView == 0) { searchOrder(stockOrOrder.Text.ToString()); stockOrOrder.Focus(); return; } }
/// <summary> /// 订单全部显示 /// </summary> public void Allshowinfo() { if (newTime.starTime != null && newTime.endTime != null) { dataGridView1.Rows.Clear(); dataBase read = new dataBase(); List <info> readContent = new List <info>(); String ResultStr = string.Empty; readContent = read.readString(newTime.starTime.ToString(), newTime.endTime.ToString()); for (int i = 0; i < readContent.Count; i++) { dataGridView1.Rows.Add(); dataGridView1.Rows[i].Cells["Id"].Value = i; dataGridView1.Rows[i].Cells["OrderNo"].Value = readContent[i].OrderNo; dataGridView1.Rows[i].Cells["PayTime"].Value = readContent[i].PayTime; dataGridView1.Rows[i].Cells["RecevieName"].Value = readContent[i].RecevieName; dataGridView1.Rows[i].Cells["ReceiveTel"].Value = readContent[i].ReceiveTel; dataGridView1.Rows[i].Cells["OrderMoney"].Value = readContent[i].OrderMoney; dataGridView1.Rows[i].Cells["OrderMoney"].Value = readContent[i].OrderMoney; dataGridView1.Rows[i].Cells["Behavior"].Value = "详情"; switch (readContent[i].OrderState) { case 0: ResultStr = "待确认"; break; case 1: ResultStr = "已确认"; break; case 2: ResultStr = "已取消"; break; case 4: ResultStr = "无效"; break; default: break; } switch (readContent[i].PayState) { case 0: ResultStr += "未支付"; break; case 2: ResultStr += "已支付"; break; default: break; } switch (readContent[i].ShoppingState) { case 0: ResultStr += "未发货"; break; case 1: ResultStr += "备货中"; break; case 2: ResultStr += "发货中"; break; case 3: ResultStr += "已发货"; break; case 4: ResultStr += "确认收货"; break; default: break; } dataGridView1.Rows[i].Cells["OrderState"].Value = ResultStr; } KindView = 0; //修改货物窗口种类 } }