예제 #1
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder   bll   = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            labMotorcade.Text = model.MotorcadeName;
            labCarNumber.Text = model.CarNumber;
            labDriver.Text    = model.Driver;
            labPayee.Text     = model.Driver;

            BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem();
            DataTable dt = itemBll.GetList(" TransportOrderId = " + model.Id + "").Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                string dispatchCount = dr["DispatchCount"].ToString().Equals("0.00") ? "包车" : dr["DispatchCount"].ToString();
                transportOrderItems += "<tr data-value=\"" + dr["OrderId"].ToString() + "\">";
                transportOrderItems += "<td width=\"5%\"><input type=\"hidden\" name=\"transportOrderItemId\" value=\"" + dr["Id"].ToString() + "\"/></td>";
                transportOrderItems += "<td align=\"left\">" + dr["OrderCode"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["BillNumber"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Receiver"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Goods"].ToString() + "</td>";
                transportOrderItems += "<td width=\"9%\" align=\"center\">" + dr["Unit"].ToString() + "</td>";
                transportOrderItems += "<td width=\"6%\">" + dispatchCount + "</td>";
                transportOrderItems += "<td width=\"5%\">" + dr["FactDispatchCount"].ToString() + "</td>";
                transportOrderItems += "<td width=\"5%\">¥" + dr["UnitPrice"].ToString() + "</td>";
                transportOrderItems += "<td width=\"5%\">¥" + dr["TotalPrice"].ToString() + "</td>";
                transportOrderItems += "</tr>";
            }
        }
예제 #2
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);
        }
예제 #3
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder   bll   = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            labCode.Text             = model.Code;
            labFactDispatchTime.Text = model.FactDispatchTime.Value.ToString("yyyy-MM-dd");
            labMotorcadeName.Text    = model.MotorcadeName;
            labCarNumber.Text        = model.CarNumber;
            labDriver.Text           = model.Driver;
            labPayee.Text            = model.Payee;
            labAdvance.Text          = model.Advance.ToString();

            BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem();
            DataTable dt = itemBll.GetList(" TransportOrderId = " + model.Id + "").Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                transportOrderItems += "<td></td>";
                transportOrderItems += "<td align=\"left\">" + dr["OrderCode"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["BillNumber"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Receiver"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Goods"].ToString() + "</td>";
                transportOrderItems += "<td width=\"9%\" align=\"center\">" + dr["Unit"].ToString() + "</td>";
                transportOrderItems += "<td width=\"6%\">" + dr["DispatchCount"].ToString() + "</td>";
                transportOrderItems += "<td width=\"5%\">" + dr["FactDispatchCount"].ToString() + "</td>";
                transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}", dr["UnitPrice"].ToString()) + "</td>";
                transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}", dr["TotalPrice"].ToString()) + "</td>";
                transportOrderItems += "</tr>";
            }
        }
예제 #4
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder   bll   = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            txtDispatchTime.Text       = model.DispatchTime.ToString("yyyy-MM-dd");
            txtBackTime.Text           = model.BackTime.ToString("yyyy-MM-dd");
            ddlMotorcade.SelectedValue = model.MotorcadeName;
            ddlCarNumber.SelectedValue = model.CarNumber;
            txtDriver.Text             = model.Driver;
            txtRemarks.Text            = model.Remarks;

            BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem();
            DataTable dt = itemBll.GetList(" TransportOrderId = " + model.Id + "").Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                string dispatchCount = dr["DispatchCount"].ToString().Equals("0.00") ? "包车" : dr["DispatchCount"].ToString();
                transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\" data-order-id=\"" + dr["OrderId"].ToString() + "\">";
                transportOrderItems += "<td width=\"5%\"><input type=\"hidden\" name=\"orderId\" value=\"" + dr["OrderId"].ToString() + "\"/></td>";
                transportOrderItems += "<td width=\"10%\">" + dr["BillNumber"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Receiver"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Goods"].ToString() + "</td>";
                transportOrderItems += "<td width=\"9%\">" + dr["Unit"].ToString() + "</td>";
                transportOrderItems += "<td width=\"6%\">" + dispatchCount + "</td>";
                transportOrderItems += "<td width=\"5%\"><input type=\"text\" name=\"factDispatchCount\" value=\"" + dr["FactDispatchCount"].ToString() + "\" class=\"input small\"/></td>";
                transportOrderItems += "<td width=\"5%\">" + dr["UnitPrice"].ToString() + "</td>";
                transportOrderItems += "<td width=\"5%\">" + dr["TotalPrice"].ToString() + "</td>";
                transportOrderItems += "</tr>";
            }
        }
예제 #5
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder   bll   = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            txtReceiptTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
            txtRemarks.Text     = model.Remarks;
        }
예제 #6
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder   bll   = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            ddlDriver.SelectedValue   = model.DriverId.ToString();
            txtFactDispatchTime.Text  = model.DispatchTime.ToString("yyyy-MM-dd");
            txtFactDispatchCount.Text = model.DispatchCount.ToString();
            txtFactWeight.Text        = model.Weight.ToString();
            txtLoadingDate.Text       = DateTime.Now.ToString("yyyy-MM-dd");
            txtPayee.Text             = GetDriverName(model.DriverId);
        }
예제 #7
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder   bll   = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            labFactDispatchTime.Text = model.FactDispatchTime.Value.ToString("yyyy-MM-dd");
            txtFactBackTime.Text     = DateTime.Now.ToString("yyyy-MM-dd");
            labMotorcade.Text        = model.MotorcadeName;
            labCarNumber.Text        = model.CarNumber;
            labDriver.Text           = model.Driver;
            labAdvance.Text          = model.Advance.ToString();
            labPayee.Text            = model.Driver;
            txtRepayment.Text        = model.Advance.ToString();
            txtFactRepayment.Text    = "0.00";

            BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem();
            DataTable dt = itemBll.GetList(" TransportOrderId = " + model.Id + "").Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                transportOrderItems += "<td width=\"5%\"><input type=\"hidden\" name=\"transportOrderItemId\" value=\"" + dr["Id"].ToString() + "\"/></td>";
                transportOrderItems += "<td align=\"left\">" + dr["OrderCode"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\"><select name='roundStatus'>";
                transportOrderItems += "<option value='往'>往</option>";
                transportOrderItems += "<option value='返'>返</option>";
                transportOrderItems += "<option value='往返'>往返</option>";
                transportOrderItems += "</select></td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Receiver"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Goods"].ToString() + "</td>";
                transportOrderItems += "<td width=\"9%\">" + dr["Unit"].ToString() + "</td>";
                transportOrderItems += "<td width=\"6%\"><input type=\"text\" name=\"factDispatchCount\" class=\"input small\" value=\"" + dr["FactDispatchCount"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"5%\"><input type=\"text\" name=\"factReceivedCount\" class=\"input small\" value=\"" + dr["FactReceivedCount"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}", dr["UnitPrice"].ToString()) + "</td>";
                transportOrderItems += "<td width=\"5%\">¥<input type=\"text\" name=\"totalPrice\" value=\"" + dr["TotalPrice"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "</tr>";
            }

            BLL.CostItem costItemBll = new BLL.CostItem();
            DataTable    costItemDT  = costItemBll.GetAllList().Tables[0];

            foreach (DataRow dr in costItemDT.Rows)
            {
                consumptions += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                consumptions += "<td width=\"5%\"><input type=\"hidden\" name=\"costItemName\" value=\"" + dr["Name"].ToString() + "\"/></td>";
                consumptions += "<td width=\"5%\">" + dr["Name"].ToString() + "</td>";
                consumptions += "<td width=\"50%\">¥<input type=\"text\" name=\"money\" class=\"input small\" value=\"0.00\"/></td>";
                consumptions += "</tr>";
            }
        }
예제 #8
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder   bll   = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            txtFactArriveDate.Text    = model.FactArriveDate.Value.ToString("yyyy-MM-dd");
            txtFactBackTime.Text      = model.BackTime.Value.ToString("yyyy-MM-dd");
            txtFactDispatchCount.Text = model.FactDispatchCount.ToString();
            txtFactWeight.Text        = model.FactWeight.ToString();
            txtReceivedWeight.Text    = model.FactWeight.ToString();
            txtUnloadingWeight.Text   = model.FactWeight.ToString();
            txtFactCarriage.Text      = model.FactCarriage.ToString();
            txtRepayment.Text         = model.Advance.ToString();
            txtFactRepayment.Text     = "0.00";

            BLL.Order itemBll = new BLL.Order();
            DataTable dt      = itemBll.GetPrintList(0, " and A.TransportOrderId = " + model.Id + "", " order by A.Id desc").Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                transportOrderItems += "<td width=\"5%\"><input type=\"hidden\" name=\"OrderId\" value=\"" + dr["Id"].ToString() + "\"/></td>";
                transportOrderItems += "<td align=\"left\">" + dr["BillNumber"].ToString() + "</td>";
                transportOrderItems += "<td width=\"13%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"13%\">" + dr["Receiver"].ToString() + "</td>";
                transportOrderItems += "<td width=\"12%\">" + dr["GoodsName"].ToString() + "</td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"UnitPrice\" class=\"input small\" value=\"" + dr["UnitPrice"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\"><input type=\"text\" name=\"Weight\" class=\"input small\" value=\"" + dr["Weight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"Freight\" value=\"" + dr["Freight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"PaidFreight\" value=\"" + dr["PaidFreight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"UnpaidFreight\" value=\"" + dr["UnpaidFreight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "</tr>";
            }

            BLL.CostItem costItemBll = new BLL.CostItem();
            DataTable    costItemDT  = costItemBll.GetAllList().Tables[0];

            foreach (DataRow dr in costItemDT.Rows)
            {
                consumptions += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                consumptions += "<td width=\"5%\"><input type=\"hidden\" name=\"costItemName\" value=\"" + dr["Name"].ToString() + "\"/></td>";
                consumptions += "<td width=\"5%\">" + dr["Name"].ToString() + "</td>";
                consumptions += "<td width=\"50%\">¥<input type=\"text\" name=\"money\" class=\"input small\" value=\"0.00\"/></td>";
                consumptions += "</tr>";
            }
        }
예제 #9
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder   bll   = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            txtDispatchTime.Text             = model.DispatchTime.ToString("yyyy-MM-dd");
            ddlDriver.SelectedValue          = model.DriverId.ToString();
            txtCustomerRemarks.Text          = model.CustomerRemarks;
            txtHaulwayRemarks.Text           = model.HaulwayRemarks;
            txtDispatchCount.Text            = model.DispatchCount.ToString();
            txtWeight.Text                   = model.Weight.ToString();
            txtCarriageUnitPrice.Text        = model.CarriageUnitPrice.ToString();
            txtCarriage.Text                 = model.Carriage.ToString();
            txtLoadingCapacityRunning.Text   = model.LoadingCapacityRunning.ToString();
            txtNoLoadingCapacityRunning.Text = model.NoLoadingCapacityRunning.ToString();
            txtRemarks.Text                  = model.Remarks;
        }
예제 #10
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.Status      = 3;

            if (bll.UpdateReceipt(model))
            {
                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.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;
        }
예제 #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.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;
        }
예제 #13
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);
        }
예제 #14
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder   bll   = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            labCode.Text             = model.Code;
            labFactDispatchTime.Text = model.FactDispatchTime.ToString("yyyy-MM-dd");
            Model.Driver driver = new BLL.Driver().GetModel(model.DriverId);
            if (driver != null)
            {
                labDriver.Text    = driver.RealName;
                labLinkTel.Text   = driver.LinkTel;
                labCarNumber.Text = driver.CarNumber;
            }
            labPayee.Text   = model.Payee;
            labAdvance.Text = model.Advance.ToString();

            BLL.Order itemBll = new BLL.Order();
            DataTable dt      = itemBll.GetPrintList(0, " and A.TransportOrderId = " + model.Id + "", " order by A.Id desc").Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                transportOrderItems += "<td></td>";
                transportOrderItems += "<td align=\"left\">" + dr["Code"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["BillNumber"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["WeighbridgeNumber"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Receiver"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["GoodsName"].ToString() + "</td>";
                transportOrderItems += "<td width=\"6%\">" + dr["Quantity"].ToString() + "</td>";
                transportOrderItems += "<td width=\"5%\">" + dr["Weight"].ToString() + "</td>";
                transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}", dr["UnitPrice"].ToString()) + "</td>";
                transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}", dr["Freight"].ToString()) + "</td>";
                transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}", dr["HandlingCharge"].ToString()) + "</td>";
                transportOrderItems += "</tr>";
            }
        }
예제 #15
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);
        }
예제 #16
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder bll = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            labCode.Text = model.Code;
            labFactDispatchTime.Text = model.FactDispatchTime.ToString("yyyy-MM-dd");
            Model.Driver driver = new BLL.Driver().GetModel(model.DriverId);
            if (driver != null)
            {
                labDriver.Text = driver.RealName;
                labLinkTel.Text = driver.LinkTel;
                labCarNumber.Text = driver.CarNumber;
            }
            labPayee.Text = model.Payee;
            labAdvance.Text = model.Advance.ToString();

            BLL.Order itemBll = new BLL.Order();
            DataTable dt = itemBll.GetPrintList(0, " and A.TransportOrderId = " + model.Id + "", " order by A.Id desc").Tables[0];
            foreach (DataRow dr in dt.Rows)
            {
                transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                transportOrderItems += "<td></td>";
                transportOrderItems += "<td align=\"left\">" + dr["Code"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["BillNumber"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["WeighbridgeNumber"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Receiver"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["GoodsName"].ToString() + "</td>";
                transportOrderItems += "<td width=\"6%\">" + dr["Quantity"].ToString() + "</td>";
                transportOrderItems += "<td width=\"5%\">" + dr["Weight"].ToString() + "</td>";
                transportOrderItems += "<td width=\"5%\">¥" +string.Format("{0:N2}", dr["UnitPrice"].ToString())+ "</td>";
                transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}", dr["Freight"].ToString()) + "</td>";
                transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}", dr["HandlingCharge"].ToString()) + "</td>";
                transportOrderItems += "</tr>";
            }
        }
예제 #17
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);
        }
예제 #18
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder bll = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            txtDispatchTime.Text = model.DispatchTime.ToString("yyyy-MM-dd");
            txtBackTime.Text = model.BackTime.ToString("yyyy-MM-dd");
            ddlMotorcade.SelectedValue = model.MotorcadeName;
            ddlCarNumber.SelectedValue = model.CarNumber;
            txtDriver.Text = model.Driver;
            txtRemarks.Text = model.Remarks;

            BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem();
            DataTable dt = itemBll.GetList(" TransportOrderId = " + model.Id + "").Tables[0];
            foreach (DataRow dr in dt.Rows)
            {
                string dispatchCount = dr["DispatchCount"].ToString().Equals("0.00") ? "包车" : dr["DispatchCount"].ToString();
                transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\" data-order-id=\"" + dr["OrderId"].ToString() + "\">";
                transportOrderItems += "<td width=\"5%\"><input type=\"hidden\" name=\"orderId\" value=\"" + dr["OrderId"].ToString() + "\"/></td>";
                transportOrderItems += "<td width=\"10%\">" + dr["BillNumber"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Receiver"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Goods"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"9%\">" + dr["Unit"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"6%\">" + dispatchCount + "</td>";
                transportOrderItems += "<td width=\"5%\"><input type=\"text\" name=\"factDispatchCount\" value=\"" + dr["FactDispatchCount"].ToString() + "\" class=\"input small\"/></td>";
                transportOrderItems += "<td width=\"5%\">" + dr["UnitPrice"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"5%\">" + dr["TotalPrice"].ToString()  + "</td>";
                transportOrderItems += "</tr>";
            }
        }
예제 #19
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);
        }
예제 #20
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;
        }
예제 #21
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder bll = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            ddlDriver.SelectedValue = model.DriverId.ToString();
            txtFactDispatchTime.Text = model.DispatchTime.ToString("yyyy-MM-dd");
            txtFactDispatchCount.Text = model.DispatchCount.ToString();
            txtFactWeight.Text = model.Weight.ToString();
            txtLoadingDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
            txtPayee.Text = GetDriverName(model.DriverId);
        }
예제 #22
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder bll = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            txtDispatchTime.Text = model.DispatchTime.ToString("yyyy-MM-dd");
            ddlDriver.SelectedValue = model.DriverId.ToString();
            txtCustomerRemarks.Text = model.CustomerRemarks;
            txtHaulwayRemarks.Text = model.HaulwayRemarks;
            txtDispatchCount.Text = model.DispatchCount.ToString();
            txtWeight.Text = model.Weight.ToString();
            txtCarriageUnitPrice.Text = model.CarriageUnitPrice.ToString();
            txtCarriage.Text = model.Carriage.ToString();
            txtLoadingCapacityRunning.Text = model.LoadingCapacityRunning.ToString();
            txtNoLoadingCapacityRunning.Text = model.NoLoadingCapacityRunning.ToString();
            txtRemarks.Text = model.Remarks;
        }
예제 #23
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);
        }
예제 #24
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;
        }
예제 #25
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder bll = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            txtReceiptTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
            txtRemarks.Text = model.Remarks;
        }
예제 #26
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder bll = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            labFactDispatchTime.Text = model.FactDispatchTime.Value.ToString("yyyy-MM-dd");
            txtFactBackTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
            labMotorcade.Text = model.MotorcadeName;
            labCarNumber.Text = model.CarNumber;
            labDriver.Text = model.Driver;
            labAdvance.Text = model.Advance.ToString();
            labPayee.Text = model.Driver;
            txtRepayment.Text = model.Advance.ToString();
            txtFactRepayment.Text = "0.00";

            BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem();
            DataTable dt = itemBll.GetList(" TransportOrderId = " + model.Id + "").Tables[0];
            foreach (DataRow dr in dt.Rows)
            {
                transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                transportOrderItems += "<td width=\"5%\"><input type=\"hidden\" name=\"transportOrderItemId\" value=\"" + dr["Id"].ToString() + "\"/></td>";
                transportOrderItems += "<td align=\"left\">" + dr["OrderCode"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\"><select name='roundStatus'>";
                transportOrderItems += "<option value='往'>往</option>";
                transportOrderItems += "<option value='返'>返</option>";
                transportOrderItems += "<option value='往返'>往返</option>";
                transportOrderItems += "</select></td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Receiver"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Goods"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"9%\">" + dr["Unit"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"6%\"><input type=\"text\" name=\"factDispatchCount\" class=\"input small\" value=\"" + dr["FactDispatchCount"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"5%\"><input type=\"text\" name=\"factReceivedCount\" class=\"input small\" value=\"" + dr["FactReceivedCount"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}",dr["UnitPrice"].ToString())+ "</td>";
                transportOrderItems += "<td width=\"5%\">¥<input type=\"text\" name=\"totalPrice\" value=\"" + dr["TotalPrice"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "</tr>";
            }

            BLL.CostItem costItemBll = new BLL.CostItem();
            DataTable costItemDT = costItemBll.GetAllList().Tables[0];
            foreach (DataRow dr in costItemDT.Rows)
            {
                consumptions += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                consumptions += "<td width=\"5%\"><input type=\"hidden\" name=\"costItemName\" value=\"" + dr["Name"].ToString() + "\"/></td>";
                consumptions += "<td width=\"5%\">" + dr["Name"].ToString() + "</td>";
                consumptions += "<td width=\"50%\">¥<input type=\"text\" name=\"money\" class=\"input small\" value=\"0.00\"/></td>";
                consumptions += "</tr>";
            }
        }
예제 #27
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;
        }
예제 #28
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;
        }
예제 #29
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder bll = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            labMotorcade.Text = model.MotorcadeName;
            labCarNumber.Text = model.CarNumber;
            labDriver.Text = model.Driver;
            labPayee.Text = model.Driver;

            BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem();
            DataTable dt = itemBll.GetList(" TransportOrderId = " + model.Id + "").Tables[0];
            foreach (DataRow dr in dt.Rows)
            {
                string dispatchCount = dr["DispatchCount"].ToString().Equals("0.00") ? "包车" : dr["DispatchCount"].ToString();
                transportOrderItems += "<tr data-value=\"" + dr["OrderId"].ToString() + "\">";
                transportOrderItems += "<td width=\"5%\"><input type=\"hidden\" name=\"transportOrderItemId\" value=\"" + dr["Id"].ToString() + "\"/></td>";
                transportOrderItems += "<td align=\"left\">" + dr["OrderCode"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["BillNumber"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Receiver"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Goods"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"9%\" align=\"center\">" + dr["Unit"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"6%\">" + dispatchCount + "</td>";
                transportOrderItems += "<td width=\"5%\">" + dr["FactDispatchCount"].ToString() + "</td>";
                transportOrderItems += "<td width=\"5%\">¥" + dr["UnitPrice"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"5%\">¥" + dr["TotalPrice"].ToString() + "</td>";
                transportOrderItems += "</tr>";
            }
        }
예제 #30
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder bll = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            labCode.Text = model.Code;
            labFactDispatchTime.Text = model.FactDispatchTime.Value.ToString("yyyy-MM-dd");
            labMotorcadeName.Text = model.MotorcadeName;
            labCarNumber.Text = model.CarNumber;
            labDriver.Text = model.Driver;
            labPayee.Text = model.Payee;
            labAdvance.Text = model.Advance.ToString();

            BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem();
            DataTable dt = itemBll.GetList(" TransportOrderId = " + model.Id + "").Tables[0];
            foreach (DataRow dr in dt.Rows)
            {
                transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                transportOrderItems += "<td></td>";
                transportOrderItems += "<td align=\"left\">" + dr["OrderCode"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["BillNumber"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Receiver"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"10%\">" + dr["Goods"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"9%\" align=\"center\">" + dr["Unit"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"6%\">" + dr["DispatchCount"].ToString() + "</td>";
                transportOrderItems += "<td width=\"5%\">" + dr["FactDispatchCount"].ToString() + "</td>";
                transportOrderItems += "<td width=\"5%\">¥" +string.Format("{0:N2}", dr["UnitPrice"].ToString())+ "</td>";
                transportOrderItems += "<td width=\"5%\">¥" + string.Format("{0:N2}",dr["TotalPrice"].ToString())  + "</td>";
                transportOrderItems += "</tr>";
            }
        }
예제 #31
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;
        }
예제 #32
0
        private void ShowInfo(int _id)
        {
            BLL.TransportOrder bll = new BLL.TransportOrder();
            Model.TransportOrder model = bll.GetModel(_id);

            txtFactArriveDate.Text = model.FactArriveDate.Value.ToString("yyyy-MM-dd");
            txtFactBackTime.Text = model.BackTime.Value.ToString("yyyy-MM-dd");
            txtFactDispatchCount.Text = model.FactDispatchCount.ToString();
            txtFactWeight.Text = model.FactWeight.ToString();
            txtReceivedWeight.Text = model.FactWeight.ToString();
            txtUnloadingWeight.Text = model.FactWeight.ToString();
            txtFactCarriage.Text = model.FactCarriage.ToString();
            txtRepayment.Text = model.Advance.ToString();
            txtFactRepayment.Text = "0.00";

            BLL.Order itemBll = new BLL.Order();
            DataTable dt = itemBll.GetPrintList(0, " and A.TransportOrderId = " + model.Id + "", " order by A.Id desc").Tables[0];
            foreach (DataRow dr in dt.Rows)
            {
                transportOrderItems += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                transportOrderItems += "<td width=\"5%\"><input type=\"hidden\" name=\"OrderId\" value=\"" + dr["Id"].ToString() + "\"/></td>";
                transportOrderItems += "<td align=\"left\">" + dr["BillNumber"].ToString() + "</td>";
                transportOrderItems += "<td width=\"13%\">" + dr["Shipper"].ToString() + "</td>";
                transportOrderItems += "<td width=\"13%\">" + dr["Receiver"].ToString()  + "</td>";
                transportOrderItems += "<td width=\"12%\">" + dr["GoodsName"].ToString() + "</td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"UnitPrice\" class=\"input small\" value=\"" + dr["UnitPrice"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\"><input type=\"text\" name=\"Weight\" class=\"input small\" value=\"" + dr["Weight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"Freight\" value=\"" + dr["Freight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"PaidFreight\" value=\"" + dr["PaidFreight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "<td width=\"8%\">¥<input type=\"text\" name=\"UnpaidFreight\" value=\"" + dr["UnpaidFreight"].ToString() + "\" style='width:50px'/></td>";
                transportOrderItems += "</tr>";
            }

            BLL.CostItem costItemBll = new BLL.CostItem();
            DataTable costItemDT = costItemBll.GetAllList().Tables[0];
            foreach (DataRow dr in costItemDT.Rows)
            {
                consumptions += "<tr data-value=\"" + dr["Id"].ToString() + "\">";
                consumptions += "<td width=\"5%\"><input type=\"hidden\" name=\"costItemName\" value=\"" + dr["Name"].ToString() + "\"/></td>";
                consumptions += "<td width=\"5%\">" + dr["Name"].ToString() + "</td>";
                consumptions += "<td width=\"50%\">¥<input type=\"text\" name=\"money\" class=\"input small\" value=\"0.00\"/></td>";
                consumptions += "</tr>";
            }
        }