private void Bind() { if (!string.IsNullOrEmpty(orderNum)) { if (bll == null) { bll = new BLL.Order(); } Model.OrderInfo model = bll.GetModel(orderNum, userId); if (model == null) { ltrBank.Text = ""; WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "非法操作,已终止执行", "操作错误", "error"); return; } ViewState["OrderId"] = model.OrderId; ViewState["TotalPrice"] = model.TotalPrice; string htmlAppend = "<s class=\"icon-succ02\"></s><h3 class=\"ftx-02\">订单提交成功,请您尽快付款!</h3>"; htmlAppend += "<ul class=\"list-h\"><li class=\"fore1\">订单号:" + model.OrderNum + "</li>"; htmlAppend += "<li class=\"fore2\">应付金额:<strong class=\"ftx-01\">" + model.TotalPrice + "元</strong></li>"; htmlAppend += "</ul><p id=\"p_show_info\"> </p><p class=\"reminder\"><strong>立即支付<span class=\"ftx-01\">" + model.TotalPrice + "元</span>,即可完成订单。</strong>"; htmlAppend += "请您在<span class=\"ftx-04\">24小时</span>内完成支付,否则订单会被自动取消。</p></div>"; ltrSucceed.Text = htmlAppend; } }
private void Bind() { if (string.IsNullOrEmpty(orderNum)) { WebHelper.MessageBox.Messager(this.Page, Page.Controls[0], "非法进入,已终止执行", "操作错误", "error"); return; } if (bll == null) { bll = new BLL.Order(); } Model.OrderInfo model = bll.GetModel(orderNum, userId); if (model == null) { WebHelper.MessageBox.Messager(this.Page, Page.Controls[0], "非法操作,已终止执行", "操作错误", "error"); return; } string htmlAppend = "<s class=\"icon-succ02\"></s><h3 class=\"ftx-02\">付款成功,我们将尽快处理,请耐心等待!</h3>"; htmlAppend += "<ul class=\"list-h\"><li class=\"fore1\">订单号:" + model.OrderNum + "</li>"; htmlAppend += "<li class=\"fore2\">已付金额:<strong class=\"ftx-01\">" + model.TotalPrice + "元</strong></li>"; htmlAppend += "</ul></div>"; ltrSucceed.Text = htmlAppend; }
private void deleteOrderFile(HttpContext context) { //检查是否允许匿名上传 if (!new ManagePage().IsAdminLogin()) { context.Response.Write("{\"status\": 0, \"msg\": \"禁止匿名非法删除!\"}"); return; } BLL.Order bll = new BLL.Order(); Model.manager manager = new ManagePage().GetAdminInfo();//获得当前登录管理员信息 int id = DTRequest.GetQueryInt("id"); Model.Files file = bll.GetFileModel(id); Model.Order order = bll.GetModel(file.f_oid); if (order.o_lockStatus == 1) { context.Response.Write("{\"status\": 0, \"msg\": \"订单已锁定,不能再删除!\"}"); context.Response.End(); } if (bll.deleteOrderFile(file, manager)) { context.Response.Write("{\"status\": 1, \"msg\": \"删除成功!\"}"); context.Response.End(); } context.Response.Write("{\"status\": 0, \"msg\": \"删除失败!\"}"); context.Response.End(); }
private void ShowInfo(int _id) { BLL.Order bll = new BLL.Order(); Model.Order model = bll.GetModel(_id); txtAcceptOrderTime.Text = model.AcceptOrderTime.ToString("yyyy-MM-dd"); txtArrivedTime.Text = model.ArrivedTime.ToString("yyyy-MM-dd"); txtQuantity.Text = model.Quantity.ToString(); chkIsCharteredCar.Checked = model.IsCharteredCar == 1; if (!string.IsNullOrEmpty(model.Haulway)) { ddlHaulway.Items.FindByText(model.Haulway).Selected = true; } txtLoadingCapacityRunning.Text = model.LoadingCapacityRunning.ToString(); txtNoLoadingCapacityRunning.Text = model.NoLoadingCapacityRunning.ToString(); if (!string.IsNullOrEmpty(model.Formula)) { ddlFormula.Items.FindByText(model.Formula).Selected = true; } txtUnitPrice.Text = model.UnitPrice.ToString(); txtTotalPrice.Text = model.TotalPrice.ToString(); if (!string.IsNullOrEmpty(model.Shipper)) { ddlShipper.Items.FindByText(model.Shipper).Selected = true; } txtShipperLinkMan.Text = model.ShipperLinkMan; txtShipperLinkTel.Text = model.ShipperLinkTel; if (!string.IsNullOrEmpty(model.Receiver)) { ddlReceiver.Items.FindByText(model.Receiver).Selected = true; } txtReceiverLinkMan.Text = model.ReceiverLinkMan; txtReceiverLinkTel.Text = model.ReceiverLinkTel; txtContractNumber.Text = model.ContractNumber; txtBillNumber.Text = model.BillNumber; txtWeighbridgeNumber.Text = model.WeighbridgeNumber; if (!string.IsNullOrEmpty(model.LoadingAddress)) { ddlLoadingAddress.Items.FindByText(model.LoadingAddress).Selected = true; } if (!string.IsNullOrEmpty(model.UnloadingAddress)) { ddlUnloadingAddress.Items.FindByText(model.UnloadingAddress).Selected = true; } if (!string.IsNullOrEmpty(model.SettleAccountsWay)) { ddlSettleAccountsWay.Items.FindByText(model.SettleAccountsWay).Selected = true; } if (!string.IsNullOrEmpty(model.Goods)) { ddlGoods.Items.FindByText(model.Goods).Selected = true; } txtUnit.Text = model.Unit; txtRemarks.Text = model.Remarks; }
private void Bind() { if (!string.IsNullOrEmpty(orderNum)) { IList <Model.OrderInfo> list = new List <Model.OrderInfo>(); if (bll == null) { bll = new BLL.Order(); } Model.OrderInfo model = bll.GetModel(orderNum, Guid.Parse(userId)); if (model != null) { list.Add(model); } rpData.DataSource = list; rpData.DataBind(); GetProductList(model.Products); } }
private void ShowInfo(int _id) { BLL.Order bll = new BLL.Order(); Model.Order model = bll.GetModel(_id); ddlTransportOrder.SelectedValue = model.TransportOrderId.ToString(); txtAcceptOrderTime.Text = model.AcceptOrderTime.ToString("yyyy-MM-dd"); txtArrivedTime.Text = model.ArrivedTime.ToString("yyyy-MM-dd"); txtContractNumber.Text = model.ContractNumber; txtBillNumber.Text = model.BillNumber; txtWeighbridgeNumber.Text = model.WeighbridgeNumber; txtQuantity.Text = model.Quantity.ToString(); chkIsCharteredCar.Checked = model.IsCharteredCar == 1; chkIsWeightNote.Checked = model.IsWeightNote; chkIsAllotted.Checked = model.IsAllotted; txtUnitPrice.Text = model.UnitPrice.ToString(); txtWeight.Text = model.Weight.ToString(); txtFreight.Text = model.Freight.ToString(); txtPaidFreight.Text = model.PaidFreight.ToString(); txtUnpaidFreight.Text = model.UnpaidFreight.ToString(); txtHandlingCharge.Text = model.HandlingCharge.ToString(); if (!string.IsNullOrEmpty(model.LoadingAddress)) { ddlLoadingAddress.Items.FindByText(model.LoadingAddress).Selected = true; } if (!string.IsNullOrEmpty(model.UnloadingAddress)) { ddlUnloadingAddress.Items.FindByText(model.UnloadingAddress).Selected = true; } ddlShipper.SelectedValue = model.ShipperId.ToString(); ddlReceiver.SelectedValue = model.ReceiverId.ToString(); if (!string.IsNullOrEmpty(model.Haulway)) { ddlHaulway.Items.FindByText(model.Haulway).Selected = true; } txtLoadingCapacityRunning.Text = model.LoadingCapacityRunning.ToString(); txtNoLoadingCapacityRunning.Text = model.NoLoadingCapacityRunning.ToString(); ddlGoods.SelectedValue = model.GoodsId.ToString(); txtRemarks.Text = model.Remarks; }
private bool DoEdit(int _id) { bool result = false; BLL.Order bll = new BLL.Order(); Model.Order model = bll.GetModel(_id); model.TransportOrderId = Convert.ToInt32(ddlTransportOrder.SelectedValue); model.AcceptOrderTime = Convert.ToDateTime(txtAcceptOrderTime.Text.Trim()); model.ArrivedTime = Convert.ToDateTime(txtArrivedTime.Text.Trim()); model.ContractNumber = txtContractNumber.Text.Trim(); model.BillNumber = txtBillNumber.Text.Trim(); model.WeighbridgeNumber = txtWeighbridgeNumber.Text.Trim(); model.IsCharteredCar = chkIsCharteredCar.Checked ? 1 : 0; model.Quantity = Convert.ToDecimal(txtQuantity.Text.Trim()); model.IsWeightNote = chkIsWeightNote.Checked; model.IsAllotted = chkIsAllotted.Checked; model.UnitPrice = Convert.ToDecimal(txtUnitPrice.Text.Trim()); model.Weight = Convert.ToDecimal(txtWeight.Text.Trim()); model.Freight = Convert.ToDecimal(txtFreight.Text.Trim()); model.PaidFreight = Convert.ToDecimal(txtPaidFreight.Text.Trim()); model.UnpaidFreight = Convert.ToDecimal(txtUnpaidFreight.Text.Trim()); model.HandlingCharge = Convert.ToDecimal(txtHandlingCharge.Text.Trim()); model.LoadingAddress = ddlLoadingAddress.SelectedItem.Text; model.UnloadingAddress = ddlUnloadingAddress.SelectedItem.Text; model.ShipperId = Convert.ToInt32(ddlShipper.SelectedValue); model.ReceiverId = Convert.ToInt32(ddlReceiver.SelectedValue); model.Haulway = ddlHaulway.SelectedItem.Text; model.LoadingCapacityRunning = Convert.ToDecimal(txtLoadingCapacityRunning.Text.Trim()); model.NoLoadingCapacityRunning = Convert.ToDecimal(txtNoLoadingCapacityRunning.Text.Trim()); model.GoodsId = Convert.ToInt32(ddlGoods.SelectedValue); model.Remarks = txtRemarks.Text.Trim(); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改订单信息:" + model.Code); //记录日志 result = true; } return(result); }
private bool DoEdit(int _id) { bool result = false; BLL.Order bll = new BLL.Order(); Model.Order model = bll.GetModel(_id); model.AcceptOrderTime = Convert.ToDateTime(txtAcceptOrderTime.Text.Trim()); model.ArrivedTime = Convert.ToDateTime(txtArrivedTime.Text.Trim()); model.Shipper = ddlShipper.SelectedItem.Text; model.ShipperLinkMan = txtShipperLinkMan.Text.Trim(); model.ShipperLinkTel = txtShipperLinkTel.Text.Trim(); model.Receiver = ddlReceiver.SelectedItem.Text; model.ReceiverLinkMan = txtReceiverLinkMan.Text.Trim(); model.ReceiverLinkTel = txtReceiverLinkTel.Text.Trim(); model.ContractNumber = txtContractNumber.Text.Trim(); model.LoadingAddress = ddlLoadingAddress.SelectedItem.Text; model.UnloadingAddress = ddlUnloadingAddress.SelectedItem.Text; model.Goods = ddlGoods.SelectedItem.Text; model.Unit = txtUnit.Text.Trim(); model.IsCharteredCar = chkIsCharteredCar.Checked ? 1 : 0; model.Quantity = Convert.ToDecimal(txtQuantity.Text.Trim()); model.Haulway = ddlHaulway.SelectedItem.Text; model.LoadingCapacityRunning = Convert.ToDecimal(txtLoadingCapacityRunning.Text.Trim()); model.NoLoadingCapacityRunning = Convert.ToDecimal(txtNoLoadingCapacityRunning.Text.Trim()); model.BillNumber = txtBillNumber.Text.Trim(); model.WeighbridgeNumber = txtWeighbridgeNumber.Text.Trim(); model.Formula = ddlFormula.SelectedItem.Text; model.UnitPrice = Convert.ToDecimal(txtUnitPrice.Text.Trim()); model.TotalPrice = Convert.ToDecimal(txtTotalPrice.Text.Trim()); model.SettleAccountsWay = ddlSettleAccountsWay.SelectedValue; model.Remarks = txtRemarks.Text.Trim(); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改订单信息:" + model.Code); //记录日志 result = true; } return(result); }
private bool DoEdit(int _id) { bool result = false; BLL.TransportOrder bll = new BLL.TransportOrder(); Model.TransportOrder model = bll.GetModel(_id); model.FactBackTime = Utils.StrToDateTime(txtFactBackTime.Text.Trim(), DateTime.Now); model.Repayment = Utils.StrToDecimal(txtRepayment.Text.Trim(), 0.00M); model.FactRepayment = Utils.StrToDecimal(txtFactRepayment.Text.Trim(), 0.00M); model.Carriage = Utils.StrToDecimal(txtCarriage.Text.Trim(), 0.00M); model.Status = 2; string[] itemIds = Request.Params.GetValues("transportOrderItemId"); string[] factDispatchCounts = Request.Params.GetValues("factDispatchCount"); string[] factReceivedCounts = Request.Params.GetValues("factReceivedCount"); string[] totalPrices = Request.Params.GetValues("totalPrice"); string[] roundStatus = Request.Params.GetValues("roundStatus"); string[] costItemNames = Request.Params.GetValues("costItemName"); string[] monies = Request.Params.GetValues("money"); List<Model.TransportOrderItem> item_list = new List<Model.TransportOrderItem>(); BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem(); Model.TransportOrderItem item; List<Model.Order> orders = new List<Model.Order>(); BLL.Order orderBll = new BLL.Order(); Model.Order order; for (int i = 0; i < itemIds.Length; i++) { item = itemBll.GetModel(Utils.StrToInt(itemIds[i], 0)); if (item != null) { decimal oldFactDispatchCount = item.FactDispatchCount; decimal newFactDispatchCount = Utils.StrToDecimal(factDispatchCounts[i], 0.00M); order = orderBll.GetModel(item.OrderId); order.DispatchedCount += newFactDispatchCount - oldFactDispatchCount; orders.Add(order); item.FactDispatchCount = newFactDispatchCount; item.FactReceivedCount = Utils.StrToDecimal(factReceivedCounts[i], 0.00M); item.TotalPrice = Utils.StrToDecimal(totalPrices[i], 0.00M); item.RoundStatus = roundStatus[i]; item_list.Add(item); } } List<Model.Consumption> consumption_list = new List<Model.Consumption>(); for (int i = 0; i < costItemNames.Length; i++) { Model.Consumption consumption = new Model.Consumption(); consumption.Name = costItemNames[i]; consumption.Money = Utils.StrToDecimal(monies[i], 0.00M); consumption.TransportOrderId = _id; consumption_list.Add(consumption); } if (bll.Update(model, item_list, consumption_list, orders)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "回车报账信息:" + model.Code); //记录日志 result = true; } return result; }
private bool DoEdit(int _id) { bool result = false; BLL.TransportOrder bll = new BLL.TransportOrder(); Model.TransportOrder model = bll.GetModel(_id); model.FactArriveDate = Utils.StrToDateTime(txtFactArriveDate.Text.Trim(), DateTime.Now); model.FactBackTime = Utils.StrToDateTime(txtFactBackTime.Text.Trim(), DateTime.Now); model.Repayment = Utils.StrToDecimal(txtRepayment.Text.Trim(), 0.00M); model.FactRepayment = Utils.StrToDecimal(txtFactRepayment.Text.Trim(), 0.00M); model.FactDispatchCount = Utils.StrToDecimal(txtFactDispatchCount.Text.Trim(), 0.00M); model.FactWeight = Utils.StrToDecimal(txtFactWeight.Text.Trim(), 0.00M); model.ReceivedWeight = Utils.StrToDecimal(txtReceivedWeight.Text.Trim(), 0.00M); model.UnloadingWeight = Utils.StrToDecimal(txtUnloadingWeight.Text.Trim(), 0.00M); model.FactCarriage = Utils.StrToDecimal(txtFactCarriage.Text.Trim(), 0.00M); model.Status = 3; string[] ids = Request.Params.GetValues("OrderId"); string[] unitPrices = Request.Params.GetValues("UnitPrice"); string[] weights = Request.Params.GetValues("Weight"); string[] freights = Request.Params.GetValues("Freight"); string[] paidFreights = Request.Params.GetValues("PaidFreight"); string[] unpaidFreights = Request.Params.GetValues("UnpaidFreight"); string[] costItemNames = Request.Params.GetValues("costItemName"); string[] monies = Request.Params.GetValues("money"); List <Model.Order> item_list = new List <Model.Order>(); BLL.Order orderBLL = new BLL.Order(); Model.Order item; if (ids != null && unitPrices != null && weights != null && freights != null && paidFreights != null && unpaidFreights != null && ids.Length == unitPrices.Length && ids.Length == weights.Length && ids.Length == freights.Length && ids.Length == paidFreights.Length && ids.Length == unpaidFreights.Length && ids.Length > 0) { for (int i = 0; i < ids.Length; i++) { item = orderBLL.GetModel(Utils.StrToInt(ids[i], 0)); if (item != null) { item.UnitPrice = Utils.StrToDecimal(unitPrices[i], 0.00M); item.Weight = Utils.StrToDecimal(weights[i], 0.00M); item.Freight = Utils.StrToDecimal(freights[i], 0.00M); item.PaidFreight = Utils.StrToDecimal(paidFreights[i], 0.00M); item.UnpaidFreight = Utils.StrToDecimal(unpaidFreights[i], 0.00M); item_list.Add(item); } } } List <Model.Consumption> consumption_list = new List <Model.Consumption>(); if (costItemNames != null && monies != null && costItemNames.Length == monies.Length && costItemNames.Length > 0) { for (int i = 0; i < costItemNames.Length; i++) { Model.Consumption consumption = new Model.Consumption(); consumption.Name = costItemNames[i]; consumption.Money = Utils.StrToDecimal(monies[i], 0.00M); consumption.TransportOrderId = _id; consumption_list.Add(consumption); } } if (bll.Update(model, item_list, consumption_list)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "回车报账信息:" + model.Code); //记录日志 result = true; } return(result); }
private bool DoEdit(int _id) { bool result = false; BLL.TransportOrder bll = new BLL.TransportOrder(); Model.TransportOrder model = bll.GetModel(_id); model.FactBackTime = Utils.StrToDateTime(txtFactBackTime.Text.Trim(), DateTime.Now); model.Repayment = Utils.StrToDecimal(txtRepayment.Text.Trim(), 0.00M); model.FactRepayment = Utils.StrToDecimal(txtFactRepayment.Text.Trim(), 0.00M); model.Carriage = Utils.StrToDecimal(txtCarriage.Text.Trim(), 0.00M); model.Status = 2; string[] itemIds = Request.Params.GetValues("transportOrderItemId"); string[] factDispatchCounts = Request.Params.GetValues("factDispatchCount"); string[] factReceivedCounts = Request.Params.GetValues("factReceivedCount"); string[] totalPrices = Request.Params.GetValues("totalPrice"); string[] roundStatus = Request.Params.GetValues("roundStatus"); string[] costItemNames = Request.Params.GetValues("costItemName"); string[] monies = Request.Params.GetValues("money"); List <Model.TransportOrderItem> item_list = new List <Model.TransportOrderItem>(); BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem(); Model.TransportOrderItem item; List <Model.Order> orders = new List <Model.Order>(); BLL.Order orderBll = new BLL.Order(); Model.Order order; for (int i = 0; i < itemIds.Length; i++) { item = itemBll.GetModel(Utils.StrToInt(itemIds[i], 0)); if (item != null) { decimal oldFactDispatchCount = item.FactDispatchCount; decimal newFactDispatchCount = Utils.StrToDecimal(factDispatchCounts[i], 0.00M); order = orderBll.GetModel(item.OrderId); order.DispatchedCount += newFactDispatchCount - oldFactDispatchCount; orders.Add(order); item.FactDispatchCount = newFactDispatchCount; item.FactReceivedCount = Utils.StrToDecimal(factReceivedCounts[i], 0.00M); item.TotalPrice = Utils.StrToDecimal(totalPrices[i], 0.00M); item.RoundStatus = roundStatus[i]; item_list.Add(item); } } List <Model.Consumption> consumption_list = new List <Model.Consumption>(); for (int i = 0; i < costItemNames.Length; i++) { Model.Consumption consumption = new Model.Consumption(); consumption.Name = costItemNames[i]; consumption.Money = Utils.StrToDecimal(monies[i], 0.00M); consumption.TransportOrderId = _id; consumption_list.Add(consumption); } if (bll.Update(model, item_list, consumption_list, orders)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "回车报账信息:" + model.Code); //记录日志 result = true; } return(result); }
private bool DoEdit(int _id) { bool result = false; BLL.Order bll = new BLL.Order(); Model.Order model = bll.GetModel(_id); model.AcceptOrderTime = Convert.ToDateTime(txtAcceptOrderTime.Text.Trim()); model.ArrivedTime = Convert.ToDateTime(txtArrivedTime.Text.Trim()); model.Shipper = ddlShipper.SelectedItem.Text; model.ShipperLinkMan = txtShipperLinkMan.Text.Trim(); model.ShipperLinkTel = txtShipperLinkTel.Text.Trim(); model.Receiver = ddlReceiver.SelectedItem.Text; model.ReceiverLinkMan = txtReceiverLinkMan.Text.Trim(); model.ReceiverLinkTel = txtReceiverLinkTel.Text.Trim(); model.ContractNumber = txtContractNumber.Text.Trim(); model.LoadingAddress = ddlLoadingAddress.SelectedItem.Text; model.UnloadingAddress = ddlUnloadingAddress.SelectedItem.Text; model.Goods = ddlGoods.SelectedItem.Text; model.Unit = txtUnit.Text.Trim(); model.IsCharteredCar = chkIsCharteredCar.Checked ? 1 : 0; model.Quantity = Convert.ToDecimal(txtQuantity.Text.Trim()); model.Haulway = ddlHaulway.SelectedItem.Text; model.LoadingCapacityRunning = Convert.ToDecimal(txtLoadingCapacityRunning.Text.Trim()); model.NoLoadingCapacityRunning = Convert.ToDecimal(txtNoLoadingCapacityRunning.Text.Trim()); model.BillNumber = txtBillNumber.Text.Trim(); model.WeighbridgeNumber = txtWeighbridgeNumber.Text.Trim(); model.Formula = ddlFormula.SelectedItem.Text; model.UnitPrice = Convert.ToDecimal(txtUnitPrice.Text.Trim()); model.TotalPrice = Convert.ToDecimal(txtTotalPrice.Text.Trim()); model.SettleAccountsWay = ddlSettleAccountsWay.SelectedValue; model.Remarks = txtRemarks.Text.Trim(); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改订单信息:" + model.Code); //记录日志 result = true; } return result; }
private bool DoEdit(int _id) { bool result = false; BLL.TransportOrder bll = new BLL.TransportOrder(); Model.TransportOrder model = bll.GetModel(_id); string[] orderIds = Request.Params.GetValues("orderId"); string[] factDispatchCounts = Request.Params.GetValues("factDispatchCount"); if (orderIds == null) { JscriptMsg("请填写运输项信息!", "", "Error"); return(false); } model.DispatchTime = Convert.ToDateTime(txtDispatchTime.Text.Trim()); model.FactDispatchTime = DateTime.Now; model.BackTime = Convert.ToDateTime(txtBackTime.Text.Trim()); model.FactBackTime = DateTime.Now; model.MotorcadeName = ddlMotorcade.SelectedValue; model.CarNumber = ddlCarNumber.SelectedValue; model.Driver = txtDriver.Text.Trim(); model.Remarks = txtRemarks.Text.Trim(); model.AddTime = DateTime.Now; model.Status = 0; List <Model.TransportOrderItem> item_list = new List <Model.TransportOrderItem>(); List <Model.Order> order_list = new List <Model.Order>();//订单 BLL.Order orderBll = new BLL.Order(); //new BLL.TransportOrderItem().DeleteBy(model.Id);//删除该运输单下 所有 运输子项 for (int i = 0; i < orderIds.Length; i++) { Model.Order order = orderBll.GetModel(Convert.ToInt32(orderIds[i])); if (order != null) { Model.TransportOrderItem item = new Model.TransportOrderItem(); item.OrderId = order.Id; item.OrderCode = order.Code; item.ContractNumber = order.ContractNumber; item.BillNumber = order.BillNumber; item.Shipper = order.Shipper; item.Receiver = order.Receiver; item.LoadingAddress = order.LoadingAddress; item.UnloadingAddress = order.UnloadingAddress; item.Goods = order.Goods; item.Unit = order.Unit; item.DispatchCount = order.Quantity; item.FactDispatchCount = Convert.ToDecimal(factDispatchCounts[i]); item.FactReceivedCount = item.FactDispatchCount; item.CompensationCosts = 0.00M; item.MyCosts = 0.00m; item.Haulway = order.Haulway; item.LoadingCapacityRunning = order.LoadingCapacityRunning; item.NoLoadingCapacityRunning = order.NoLoadingCapacityRunning; item.Formula = order.Formula; item.UnitPrice = order.UnitPrice; item.TotalPrice = order.TotalPrice; item.CompanyPrice = item.TotalPrice; item_list.Add(item); //int status = (order.IsCharteredCar == 1 || ((order.DispatchedCount + item.FactDispatchCount) == order.Quantity)) ? 1 : 0; //order.Status = status; //order.DispatchedCount = item.FactDispatchCount; //order_list.Add(order); } } if (bll.Update(model, item_list, order_list)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改运输单信息:" + model.Code); //记录日志 result = true; } return(result); }
private bool DoAdd() { bool result = false; Model.TransportOrder model = new Model.TransportOrder(); BLL.TransportOrder bll = new BLL.TransportOrder(); string[] orderIds = Request.Params.GetValues("orderId"); string[] factDispatchCounts = Request.Params.GetValues("factDispatchCount"); if (orderIds == null) { JscriptMsg("请填写运输项信息!", "", "Error"); return false; } model.Code = "No" + DateTime.Now.ToString("yyyyMMddhhmmss"); model.DispatchTime = Convert.ToDateTime(txtDispatchTime.Text.Trim()); model.FactDispatchTime = DateTime.Now; model.BackTime = Convert.ToDateTime(txtBackTime.Text.Trim()); model.FactBackTime = DateTime.Now; model.MotorcadeName = ddlMotorcade.SelectedValue; model.CarNumber = ddlCarNumber.SelectedValue; model.Driver = txtDriver.Text.Trim(); model.Remarks = txtRemarks.Text.Trim(); List<Model.TransportOrderItem> item_list = new List<Model.TransportOrderItem>();//运输子项 List<Model.Order> order_list = new List<Model.Order>();//订单 BLL.Order orderBll = new BLL.Order(); for (int i = 0; i < orderIds.Length; i++) { Model.Order order = orderBll.GetModel(Convert.ToInt32(orderIds[i])); if (order != null) { Model.TransportOrderItem item = new Model.TransportOrderItem(); item.OrderId = order.Id; item.OrderCode = order.Code; item.ContractNumber = order.ContractNumber; item.BillNumber = order.BillNumber; item.Shipper = order.Shipper; item.Receiver = order.Receiver; item.LoadingAddress = order.LoadingAddress; item.UnloadingAddress = order.UnloadingAddress; item.Goods = order.Goods; item.Unit = order.Unit; item.DispatchCount = order.Quantity; item.FactDispatchCount = Convert.ToDecimal(factDispatchCounts[i]); item.FactReceivedCount = item.FactDispatchCount; item.CompensationCosts = 0.00M; item.MyCosts = 0.00m; item.Haulway = order.Haulway; item.LoadingCapacityRunning = order.LoadingCapacityRunning; item.NoLoadingCapacityRunning = order.NoLoadingCapacityRunning; item.Formula = order.Formula; item.UnitPrice = order.UnitPrice; item.TotalPrice = order.TotalPrice; item.CompanyPrice = item.TotalPrice; item_list.Add(item); // int status = (order.IsCharteredCar == 1 || ((order.DispatchedCount + item.FactDispatchCount) == order.Quantity)) ? 1 : 0; //order.Status = status; order.DispatchedCount = order.DispatchedCount + item.FactDispatchCount; order_list.Add(order); } } if (bll.Add(model,item_list,order_list) > 0) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加运输单:" + model.Code); //记录日志 result = true; } return result; }
private bool DoEdit(int _id) { bool result = false; BLL.Order bll = new BLL.Order(); Model.Order model = bll.GetModel(_id); model.TransportOrderId = Convert.ToInt32(ddlTransportOrder.SelectedValue); model.AcceptOrderTime = Convert.ToDateTime(txtAcceptOrderTime.Text.Trim()); model.ArrivedTime = Convert.ToDateTime(txtArrivedTime.Text.Trim()); model.ContractNumber = txtContractNumber.Text.Trim(); model.BillNumber = txtBillNumber.Text.Trim(); model.WeighbridgeNumber = txtWeighbridgeNumber.Text.Trim(); model.IsCharteredCar = chkIsCharteredCar.Checked ? 1 : 0; model.Quantity = Convert.ToDecimal(txtQuantity.Text.Trim()); model.IsWeightNote = chkIsWeightNote.Checked; model.IsAllotted = chkIsAllotted.Checked; model.UnitPrice = Convert.ToDecimal(txtUnitPrice.Text.Trim()); model.Weight = Convert.ToDecimal(txtWeight.Text.Trim()); model.Freight = Convert.ToDecimal(txtFreight.Text.Trim()); model.PaidFreight = Convert.ToDecimal(txtPaidFreight.Text.Trim()); model.UnpaidFreight = Convert.ToDecimal(txtUnpaidFreight.Text.Trim()); model.HandlingCharge = Convert.ToDecimal(txtHandlingCharge.Text.Trim()); model.LoadingAddress = ddlLoadingAddress.SelectedItem.Text; model.UnloadingAddress = ddlUnloadingAddress.SelectedItem.Text; model.ShipperId = Convert.ToInt32(ddlShipper.SelectedValue); model.ReceiverId = Convert.ToInt32(ddlReceiver.SelectedValue); model.Haulway = ddlHaulway.SelectedItem.Text; model.LoadingCapacityRunning = Convert.ToDecimal(txtLoadingCapacityRunning.Text.Trim()); model.NoLoadingCapacityRunning = Convert.ToDecimal(txtNoLoadingCapacityRunning.Text.Trim()); model.GoodsId = Convert.ToInt32(ddlGoods.SelectedValue); model.Remarks = txtRemarks.Text.Trim(); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改订单信息:" + model.Code); //记录日志 result = true; } return result; }
private bool DoEdit(int _id) { bool result = false; BLL.TransportOrder bll = new BLL.TransportOrder(); Model.TransportOrder model = bll.GetModel(_id); model.FactArriveDate = Utils.StrToDateTime(txtFactArriveDate.Text.Trim(), DateTime.Now); model.FactBackTime = Utils.StrToDateTime(txtFactBackTime.Text.Trim(), DateTime.Now); model.Repayment = Utils.StrToDecimal(txtRepayment.Text.Trim(), 0.00M); model.FactRepayment = Utils.StrToDecimal(txtFactRepayment.Text.Trim(), 0.00M); model.FactDispatchCount = Utils.StrToDecimal(txtFactDispatchCount.Text.Trim(), 0.00M); model.FactWeight = Utils.StrToDecimal(txtFactWeight.Text.Trim(), 0.00M); model.ReceivedWeight = Utils.StrToDecimal(txtReceivedWeight.Text.Trim(), 0.00M); model.UnloadingWeight = Utils.StrToDecimal(txtUnloadingWeight.Text.Trim(), 0.00M); model.FactCarriage = Utils.StrToDecimal(txtFactCarriage.Text.Trim(), 0.00M); model.Status = 3; string[] ids = Request.Params.GetValues("OrderId"); string[] unitPrices = Request.Params.GetValues("UnitPrice"); string[] weights = Request.Params.GetValues("Weight"); string[] freights = Request.Params.GetValues("Freight"); string[] paidFreights = Request.Params.GetValues("PaidFreight"); string[] unpaidFreights = Request.Params.GetValues("UnpaidFreight"); string[] costItemNames = Request.Params.GetValues("costItemName"); string[] monies = Request.Params.GetValues("money"); List<Model.Order> item_list = new List<Model.Order>(); BLL.Order orderBLL = new BLL.Order(); Model.Order item; if (ids != null && unitPrices != null && weights != null && freights != null && paidFreights != null && unpaidFreights != null && ids.Length == unitPrices.Length && ids.Length == weights.Length && ids.Length == freights.Length && ids.Length == paidFreights.Length && ids.Length == unpaidFreights.Length && ids.Length > 0) { for (int i = 0; i < ids.Length; i++) { item = orderBLL.GetModel(Utils.StrToInt(ids[i], 0)); if (item != null) { item.UnitPrice = Utils.StrToDecimal(unitPrices[i], 0.00M); item.Weight = Utils.StrToDecimal(weights[i], 0.00M); item.Freight = Utils.StrToDecimal(freights[i], 0.00M); item.PaidFreight = Utils.StrToDecimal(paidFreights[i], 0.00M); item.UnpaidFreight = Utils.StrToDecimal(unpaidFreights[i], 0.00M); item_list.Add(item); } } } List<Model.Consumption> consumption_list = new List<Model.Consumption>(); if (costItemNames != null && monies != null && costItemNames.Length == monies.Length && costItemNames.Length > 0) { for (int i = 0; i < costItemNames.Length; i++) { Model.Consumption consumption = new Model.Consumption(); consumption.Name = costItemNames[i]; consumption.Money = Utils.StrToDecimal(monies[i], 0.00M); consumption.TransportOrderId = _id; consumption_list.Add(consumption); } } if (bll.Update(model, item_list, consumption_list)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "回车报账信息:" + model.Code); //记录日志 result = true; } return result; }