public static void OrderStatusHistoryInsert(OrderStatusHistoryEntity orderstatusEntity,bool typebit) { DbHelper.ExecuteNonQuery("[dbo].[P_orderStatusHistory_Insert]", orderstatusEntity.OrderId, orderstatusEntity.Status, orderstatusEntity.Remarks, orderstatusEntity.AdminId, orderstatusEntity.ReceivDt, orderstatusEntity.Note, typebit ); }
/// <summary> /// 修改订单状态历史记录 /// </summary> /// <param name="orderstatusEntity"></param> public static void OrderStatusHistoryInsert(OrderStatusHistoryEntity orderstatusEntity,bool typebit) { OrderStatusHistory.OrderStatusHistoryInsert(orderstatusEntity, typebit); }
//修改订单信息和订单细目中的商品数量 protected void btn_Save_Click(object sender, EventArgs e) { int orderid = Convert.ToInt32(hd_orderid.Value); OrderEntity orderEnt = logic.order.getById(orderid); //如果是固定价格采购商的订单,判断收货日期 if (logic.company.getById(orderEnt.CompanyId).EnabledWeeklyPrice) { //订单中的收货日期是否正确(不能超过当前周期,如果超过当前周期则商品价格不一样,需要重下订单!) if (!logic.buyerFixedPricePeriod.isValidReceiveDt(orderid, ext_receiveDt.SelectedDate)) { Library.Script.ClientMsg("对不起,收货日期不在当前周期内,请重新选择!"); return; } } if (ddl_Status.SelectedValue == "4" || ddl_Status.SelectedValue == "3") { if (logic.orderItem.isNotquoted(orderid)) { Library.Script.ClientMsg("对不起,该订单中有时价商品还未报价,不能提交订单!"); return; } } OrderEntity _order = new OrderEntity(); if (!string.IsNullOrEmpty(ddlCompanyGroup.SelectedValue)) { _order.CompanyId = Convert.ToInt32(ddlCompanyGroup.SelectedValue); } else { _order.CompanyId = Convert.ToInt32(hd_companyid.Value); } _order.Orderid = orderid; decimal standardAmount = 0m; decimal.TryParse(lbl_StandardAmount.Text,out standardAmount); _order.StandardAmount = Math.Round(standardAmount,2, MidpointRounding.AwayFromZero); //汇总总价 //_order.Amount = Convert.ToDecimal(txt_Amount.Value); //支付总价暂为不可修改 _order.Amount = standardAmount; _order.FireightFee = 0; _order.Taxfee =0; _order.Status = ddl_Status.SelectedValue; //订单状态 _order.ServiceNote = txt_serviceNote.Text; //客服备注 //_order.ReceiveDt = Convert.ToDateTime(ext_receiveDt.Value).AddHours(Convert.ToInt32(ddl_receiveTime.SelectedValue)); //收货时间 string timeRange = ddl_receiveTime.SelectedItem.Text; int hour = Convert.ToInt32(timeRange.Substring(timeRange.IndexOf("-") + 1, timeRange.Length - (timeRange.IndexOf("-") + 4))); _order.ReceiveDt = Convert.ToDateTime(ext_receiveDt.Value).AddHours(hour); //收货时间 _order.CloseReason = txt_closeReason.Text; //交易关闭 _order.AdminId = logic.sysAdmin.AdminID; //操作者ID for (int i = 0; i < rpt_OrderItems.Items.Count; i++) //修改商品细目表 { RepeaterItem row = rpt_OrderItems.Items[i]; HiddenField hid = row.FindControl("hid_oiId") as HiddenField; TextBox txt = row.FindControl("txtQuantity") as TextBox; TextBox txtNote = row.FindControl("txtCustomerNote") as TextBox; int oiid = Convert.ToInt32(hid.Value); decimal quantity = Convert.ToDecimal(txt.Text); logic.orderItem.updateQuantity(oiid, quantity, txtNote.Text); //根据细目ID 和 商品数量 修改 } OrderStatusHistoryEntity _Ostatus = new OrderStatusHistoryEntity(); _Ostatus.OrderId = orderid; _Ostatus.Status = _order.Status; _Ostatus.AdminId = _order.AdminId; _Ostatus.Remarks = txt_closeReason.Text.Trim(); _Ostatus.ReceivDt = _order.ReceiveDt; _Ostatus.Note = _order.ServiceNote; logic.orderStatusHistory.OrderStatusHistoryInsert(_Ostatus, true); logic.order.update(_order); Library.Script.ClientMsg("修改成功!"); rptBind(); //getDetails(orderid); }
protected void btn_UpdateStatus_Click(object sender, EventArgs e) { int orderid = Convert.ToInt32(hd_orderid.Value); if (ddl_Status.SelectedValue == "4" || ddl_Status.SelectedValue=="3") { if (logic.orderItem.isNotquoted(orderid)) { Library.Script.ClientMsg("对不起,该订单中有时价商品还未报价,不能提交订单!"); return; } } OrderEntity _order = new OrderEntity(); _order.Orderid = orderid; _order.Status = ddl_Status.SelectedValue; _order.AdminId = logic.sysAdmin.AdminID; OrderStatusHistoryEntity _Ostatus = new OrderStatusHistoryEntity(); _Ostatus.OrderId = orderid; _Ostatus.Status = _order.Status; _Ostatus.AdminId = _order.AdminId; _Ostatus.Remarks = txt_closeReason.Text.Trim(); _Ostatus.ReceivDt =DateTime.Now; _Ostatus.Note = txt_serviceNote.Text; logic.orderStatusHistory.OrderStatusHistoryInsert(_Ostatus, false); logic.order.updateStatus(_order); Library.Script.ClientMsg("修改状态成功!"); rptBind(); }