예제 #1
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);
        }
예제 #2
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;
        }
예제 #3
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);
        }
예제 #4
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;
        }