Пример #1
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.TransportOrder   bll   = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            model.DispatchTime             = Convert.ToDateTime(txtDispatchTime.Text.Trim());
            model.FactDispatchTime         = model.DispatchTime;
            model.DriverId                 = Convert.ToInt32(ddlDriver.SelectedValue);
            model.CustomerRemarks          = txtCustomerRemarks.Text;
            model.HaulwayRemarks           = txtHaulwayRemarks.Text;
            model.DispatchCount            = Convert.ToDecimal(txtDispatchCount.Text);
            model.FactDispatchCount        = model.DispatchCount;
            model.Weight                   = Convert.ToDecimal(txtWeight.Text);
            model.FactWeight               = model.Weight;
            model.FactTotalPrice           = model.TotalPrice;
            model.CarriageUnitPrice        = Convert.ToDecimal(txtCarriageUnitPrice.Text);
            model.Carriage                 = Convert.ToDecimal(txtCarriage.Text);
            model.FactCarriage             = model.Carriage;
            model.LoadingCapacityRunning   = Convert.ToDecimal(txtLoadingCapacityRunning.Text);
            model.NoLoadingCapacityRunning = Convert.ToDecimal(txtNoLoadingCapacityRunning.Text);
            model.Remarks                  = txtRemarks.Text.Trim();

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改运输单信息:" + model.Id); //记录日志
                result = true;
            }
            return(result);
        }
Пример #2
0
 private bool DoEdit(int _id)
 {
     bool result = false;
     BLL.TransportOrder bll = new BLL.TransportOrder();
     if (bll.Update(_id, Utils.StrToDateTime(txtWarningTime.Text, DateTime.Now)))
     {
         AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "回单提醒信息:" + _id.ToString()); //记录日志
         result = true;
     }
     return result;
 }
Пример #3
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.TransportOrder bll = new BLL.TransportOrder();
            if (bll.Update(_id, Utils.StrToDateTime(txtWarningTime.Text, DateTime.Now)))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "回单提醒信息:" + _id.ToString()); //记录日志
                result = true;
            }
            return(result);
        }
Пример #4
0
        private bool DoEdit(int _id)
        {
            bool result = false;
            BLL.TransportOrder bll = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            model.Remarks = txtRemarks.Text.Trim();
            model.ReceiptTime = Utils.StrToDateTime(txtReceiptTime.Text.Trim(), DateTime.Now);
            model.BackTime = Utils.StrToDateTime(txtBackTime.Text.Trim(), DateTime.Now);
            model.FactBackTime = model.BackTime;
            model.Status = 2;

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "回单登记信息:" + model.Code); //记录日志
                result = true;
            }
            return result;
        }
Пример #5
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.TransportOrder   bll   = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            model.Remarks      = txtRemarks.Text.Trim();
            model.ReceiptTime  = Utils.StrToDateTime(txtReceiptTime.Text.Trim(), DateTime.Now);
            model.BackTime     = Utils.StrToDateTime(txtBackTime.Text.Trim(), DateTime.Now);
            model.FactBackTime = model.BackTime;
            model.Status       = 2;

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "回单登记信息:" + model.Code); //记录日志
                result = true;
            }
            return(result);
        }
Пример #6
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.TransportOrder   bll   = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            model.FactDispatchTime = Utils.StrToDateTime(txtFactDispatchTime.Text.Trim(), DateTime.Now);
            model.Advance          = Utils.StrToDecimal(txtAdvance.Text.Trim(), 0.00M);
            model.AddTime          = DateTime.Now;
            model.Payee            = labPayee.Text;
            model.Status           = 1;

            //string[] itemIds = Request.Params.GetValues("transportOrderItemId");
            //string[] factDispatchCounts = Request.Params.GetValues("factDispatchCount");


            List <Model.TransportOrderItem> item_list = new List <Model.TransportOrderItem>();

            //BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem();

            //Model.TransportOrderItem item;
            //for (int i = 0; i < itemIds.Length; i++)
            //{
            //    item = itemBll.GetModel(Utils.StrToInt(itemIds[i], 0));
            //    if (item != null)
            //    {
            //        item.FactDispatchCount = Utils.StrToDecimal(factDispatchCounts[i], item.FactDispatchCount);
            //        item_list.Add(item);
            //    }
            //}

            if (bll.Update(model, item_list))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "登记出车信息:" + model.Code); //记录日志
                result = true;
            }
            return(result);
        }
Пример #7
0
        private bool DoEdit(int _id)
        {
            bool result = false;
            BLL.TransportOrder bll = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            model.FactDispatchTime = Utils.StrToDateTime(txtFactDispatchTime.Text.Trim(), DateTime.Now);
            model.FactDispatchCount = Utils.StrToDecimal(txtFactDispatchCount.Text.Trim(), 0.00M);
            model.FactWeight = Utils.StrToDecimal(txtFactWeight.Text.Trim(), 0.00M);
            model.LoadingDate = Utils.StrToDateTime(txtLoadingDate.Text.Trim(), DateTime.Now);
            model.Advance = Utils.StrToDecimal(txtAdvance.Text.Trim(), 0.00M);
            model.Payee = txtPayee.Text.Trim();
            model.ArriveDate = Utils.StrToDateTime(txtArriveDate.Text.Trim(), DateTime.Now);
            model.FactArriveDate = model.ArriveDate;
            model.Status = 1;

            if (bll.Update(model))
            {
                result = true;
            }
            return result;
        }
Пример #8
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.TransportOrder   bll   = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            model.FactDispatchTime  = Utils.StrToDateTime(txtFactDispatchTime.Text.Trim(), DateTime.Now);
            model.FactDispatchCount = Utils.StrToDecimal(txtFactDispatchCount.Text.Trim(), 0.00M);
            model.FactWeight        = Utils.StrToDecimal(txtFactWeight.Text.Trim(), 0.00M);
            model.LoadingDate       = Utils.StrToDateTime(txtLoadingDate.Text.Trim(), DateTime.Now);
            model.Advance           = Utils.StrToDecimal(txtAdvance.Text.Trim(), 0.00M);
            model.Payee             = txtPayee.Text.Trim();
            model.ArriveDate        = Utils.StrToDateTime(txtArriveDate.Text.Trim(), DateTime.Now);
            model.FactArriveDate    = model.ArriveDate;
            model.Status            = 1;

            if (bll.Update(model))
            {
                result = true;
            }
            return(result);
        }
Пример #9
0
        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;
        }
Пример #10
0
        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);
        }
Пример #11
0
        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);
        }
Пример #12
0
        private bool DoEdit(int _id)
        {
            bool result = false;
            BLL.TransportOrder bll = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            //model.FactDispatchTime = Utils.StrToDateTime(txtFactDispatchTime.Text.Trim(), DateTime.Now);
            //model.Advance = Utils.StrToDecimal(txtAdvance.Text.Trim(), 0.00M);
            model.AddTime = DateTime.Now;
            model.Status = 1;

            string[] itemIds = Request.Params.GetValues("transportOrderItemId");
            string[] factDispatchCounts = Request.Params.GetValues("factDispatchCount");

            List<Model.TransportOrderItem> item_list = new List<Model.TransportOrderItem>();
            BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem();

            for (int i = 0; i < itemIds.Length; i++)
            {
                Model.TransportOrderItem item = itemBll.GetModel(Utils.StrToInt(itemIds[i], 0));
                if (item != null)
                {
                    item.FactDispatchCount = Utils.StrToDecimal(factDispatchCounts[i], item.FactDispatchCount);
                    item_list.Add(item);
                }
            }

            if (bll.Update(model,item_list))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "登记出车信息:" + model.Code); //记录日志
                result = true;
            }

            return result;
        }
Пример #13
0
        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);
        }
Пример #14
0
        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;
        }
Пример #15
0
        private bool DoEdit(int _id)
        {
            bool result = false;
            BLL.TransportOrder bll = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            model.DispatchTime = Convert.ToDateTime(txtDispatchTime.Text.Trim());
            model.FactDispatchTime = model.DispatchTime;
            model.DriverId = Convert.ToInt32(ddlDriver.SelectedValue);
            model.CustomerRemarks = txtCustomerRemarks.Text;
            model.HaulwayRemarks = txtHaulwayRemarks.Text;
            model.DispatchCount = Convert.ToDecimal(txtDispatchCount.Text);
            model.FactDispatchCount = model.DispatchCount;
            model.Weight = Convert.ToDecimal(txtWeight.Text);
            model.FactWeight = model.Weight;
            model.FactTotalPrice = model.TotalPrice;
            model.CarriageUnitPrice = Convert.ToDecimal(txtCarriageUnitPrice.Text);
            model.Carriage = Convert.ToDecimal(txtCarriage.Text);
            model.FactCarriage = model.Carriage;
            model.LoadingCapacityRunning = Convert.ToDecimal(txtLoadingCapacityRunning.Text);
            model.NoLoadingCapacityRunning = Convert.ToDecimal(txtNoLoadingCapacityRunning.Text);
            model.Remarks = txtRemarks.Text.Trim();

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改运输单信息:" + model.Id); //记录日志
                result = true;
            }
            return result;
        }
Пример #16
0
        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;
        }