Пример #1
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>";
            }
        }
Пример #2
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>";
            }
        }
Пример #3
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("transportOrder_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;
            int errorCount = 0;

            BLL.TransportOrder bll = new BLL.TransportOrder();
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    if (bll.Delete(id))
                    {
                        sucCount += 1;
                    }
                    else
                    {
                        errorCount += 1;
                    }
                }
            }
            AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除运输单" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!",
                       Utils.CombUrlTxt("transportOrder_list.aspx", "carNumber={0}&customer1={1}&customer2={2}&beginTime={3}&endTime={4}&keywords={5}", _carNumber, _customer1, _customer2, _beginTime, _endTime, this.keywords), "Success");
        }
Пример #4
0
 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("transportOrder_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限
     int sucCount = 0;
     int errorCount = 0;
     BLL.TransportOrder bll = new BLL.TransportOrder();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             if (bll.Delete(id))
             {
                 sucCount += 1;
             }
             else
             {
                 errorCount += 1;
             }
         }
     }
     AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除运输单" + sucCount + "条,失败" + errorCount + "条"); //记录日志
     JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!",
         Utils.CombUrlTxt("transportOrder_list.aspx", "carNumber={0}&customer1={1}&customer2={2}&beginTime={3}&endTime={4}&keywords={5}", _carNumber, _customer1, _customer2,_beginTime,_endTime, this.keywords), "Success");
 }
Пример #5
0
        private bool DoAdd()
        {
            bool result = false;
            Model.TransportOrder model = new Model.TransportOrder();
            BLL.TransportOrder bll = new BLL.TransportOrder();

            model.Code = "No" + DateTime.Now.ToString("yyyyMMddhhmmss");
            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();
            model.AddTime = DateTime.Now;

            if (bll.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加运输单:" + model.Id); //记录日志
                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.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);
        }
Пример #7
0
        private bool DoAdd()
        {
            bool result = false;

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

            model.Code                     = "No" + DateTime.Now.ToString("yyyyMMddhhmmss");
            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();
            model.AddTime                  = DateTime.Now;

            if (bll.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加运输单:" + model.Id); //记录日志
                result = true;
            }
            return(result);
        }
Пример #8
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>";
            }
        }
Пример #9
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            if (!string.IsNullOrEmpty(_carNumber))
            {
                ddlCarNumber.SelectedValue = _carNumber;
            }
            if (!string.IsNullOrEmpty(_customer1))
            {
                ddlCustomer1.SelectedValue = _customer1;
            }
            if (!string.IsNullOrEmpty(_customer2))
            {
                ddlCustomer2.SelectedValue = _customer2;
            }
            if (!string.IsNullOrEmpty(_beginTime))
            {
                txtBeginTime.Text = _beginTime;
            }
            if (!string.IsNullOrEmpty(_endTime))
            {
                txtEndTime.Text = _endTime;
            }
            this.txtKeywords.Text = this.keywords;
            BLL.TransportOrder bll = new BLL.TransportOrder();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("transportOrder_list.aspx", "carNumber={0}&customer1={1}&customer2={2}&beginTime={3}&endTime={4}&keywords={5}&page={6}",
                                              _carNumber, _customer1, _customer2, _beginTime, _endTime, this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Пример #10
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;
        }
Пример #11
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;
 }
Пример #12
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);
        }
Пример #13
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);
        }
Пример #14
0
 private void ShowInfo(int _id)
 {
     Model.TransportOrder model = new BLL.TransportOrder().GetModel(_id);
     if (string.IsNullOrEmpty(model.WarningTime.ToString()))
     {
         txtWarningTime.Text = DateTime.Now.AddDays(3).ToString("yyyy-MM-dd");
     }
     else
     {
         txtWarningTime.Text = DateTime.Parse(model.WarningTime.ToString()).ToString("yyyy-MM-dd");
     }
 }
Пример #15
0
 private void ShowInfo(int _id)
 {
     Model.TransportOrder model = new BLL.TransportOrder().GetModel(_id);
     if (string.IsNullOrEmpty(model.WarningTime.ToString()))
     {
         txtWarningTime.Text = DateTime.Now.AddDays(3).ToString("yyyy-MM-dd");
     }
     else
     {
         txtWarningTime.Text = DateTime.Parse(model.WarningTime.ToString()).ToString("yyyy-MM-dd");
     }
 }
Пример #16
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>";
            }
        }
Пример #17
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>";
            }
        }
Пример #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");
            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;
        }
Пример #19
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);
        }
Пример #20
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;
        }
Пример #21
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);
        }
Пример #22
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;
        }
Пример #23
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>";
            }
        }
Пример #24
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);
        }
Пример #25
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>";
            }
        }
Пример #26
0
        private bool DoAdd()
        {
            bool result = false;
            Model.TransportOrder model = new Model.TransportOrder();
            BLL.TransportOrder bll = new BLL.TransportOrder();

            string[] orderIds = Request.Params.GetValues("orderId");
            string[] factDispatchCounts = Request.Params.GetValues("factDispatchCount");
            if (orderIds == null)
            {
                JscriptMsg("请填写运输项信息!", "", "Error");
                return false;
            }

            model.Code = "No" + DateTime.Now.ToString("yyyyMMddhhmmss");
            model.DispatchTime = Convert.ToDateTime(txtDispatchTime.Text.Trim());
            model.FactDispatchTime = DateTime.Now;
            model.BackTime = Convert.ToDateTime(txtBackTime.Text.Trim());
            model.FactBackTime = DateTime.Now;
            model.MotorcadeName = ddlMotorcade.SelectedValue;
            model.CarNumber = ddlCarNumber.SelectedValue;
            model.Driver = txtDriver.Text.Trim();
            model.Remarks = txtRemarks.Text.Trim();

            List<Model.TransportOrderItem> item_list = new List<Model.TransportOrderItem>();//运输子项
            List<Model.Order> order_list = new List<Model.Order>();//订单
            BLL.Order orderBll = new BLL.Order();
            for (int i = 0; i < orderIds.Length; i++)
            {
                Model.Order order = orderBll.GetModel(Convert.ToInt32(orderIds[i]));
                if (order != null)
                {
                    Model.TransportOrderItem item = new Model.TransportOrderItem();
                    item.OrderId = order.Id;
                    item.OrderCode = order.Code;
                    item.ContractNumber = order.ContractNumber;
                    item.BillNumber = order.BillNumber;
                    item.Shipper = order.Shipper;
                    item.Receiver = order.Receiver;
                    item.LoadingAddress = order.LoadingAddress;
                    item.UnloadingAddress = order.UnloadingAddress;
                    item.Goods = order.Goods;
                    item.Unit = order.Unit;
                    item.DispatchCount = order.Quantity;
                    item.FactDispatchCount = Convert.ToDecimal(factDispatchCounts[i]);
                    item.FactReceivedCount = item.FactDispatchCount;
                    item.CompensationCosts = 0.00M;
                    item.MyCosts = 0.00m;
                    item.Haulway = order.Haulway;
                    item.LoadingCapacityRunning = order.LoadingCapacityRunning;
                    item.NoLoadingCapacityRunning = order.NoLoadingCapacityRunning;
                    item.Formula = order.Formula;
                    item.UnitPrice = order.UnitPrice;
                    item.TotalPrice = order.TotalPrice;
                    item.CompanyPrice = item.TotalPrice;
                    item_list.Add(item);

                   // int status = (order.IsCharteredCar == 1 || ((order.DispatchedCount + item.FactDispatchCount) == order.Quantity)) ? 1 : 0;
                    //order.Status = status;
                    order.DispatchedCount = order.DispatchedCount + item.FactDispatchCount;
                    order_list.Add(order);
                }
            }
            if (bll.Add(model,item_list,order_list) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加运输单:" + model.Code); //记录日志
                result = true;
            }
            return result;
        }
Пример #27
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);
        }
Пример #28
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;
        }
Пример #29
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;
        }
Пример #30
0
        private void RptBind()
        {
            string sql = " Status = 3 ";
            if (!string.IsNullOrEmpty(_beginTime))
            {
                sql += " AND FactBackTime >= '" + _beginTime + "' ";
                txtBeginTime.Text = _beginTime;
            }
            else
            {
                sql += " AND FactBackTime >= '" + DateTime.Now.AddMonths(-1) + "' ";
                txtBeginTime.Text = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
            }
            if (!string.IsNullOrEmpty(_endTime))
            {
                sql += " AND FactBackTime <= '" + _endTime + "' ";
                txtEndTime.Text = _endTime;
            }
            else
            {
                sql += " AND FactBackTime <= '" + DateTime.Now + "' ";
                txtEndTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
            }
            string ids = string.Empty;
            BLL.TransportOrder bll = new BLL.TransportOrder();
            DataSet tods = bll.GetList(sql);
            if (tods != null && tods.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in tods.Tables[0].Rows)
                {
                    ids += dr["Id"].ToString() + ",";
                    totalFactRepayment += Utils.StrToDecimal(dr["FactRepayment"].ToString(), 0.00M);
                    totalCarriage += Utils.StrToDecimal(dr["Carriage"].ToString(), 0.00M);
                    totalAdvance += Utils.StrToDecimal(dr["Advance"].ToString(), 0.00M);
                }
                if (ids.EndsWith(","))
                {
                    ids = ids.TrimEnd(',');
                }
            }
            if (!string.IsNullOrEmpty(ids))
            {
                BLL.TransportOrderItem itemBll = new BLL.TransportOrderItem();
                DataSet itemds = itemBll.GetList(" TransportOrderId IN (" + ids + ") ");
                if (itemds != null && itemds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in itemds.Tables[0].Rows)
                    {
                        totalIncome += Utils.StrToDecimal(dr["TotalPrice"].ToString(), 0.00M);
                    }
                }

                BLL.Consumption cBll = new BLL.Consumption();
                DataSet cds = cBll.GetSumList(" TransportOrderId IN (" + ids + ") ");
                if (cds != null && cds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in cds.Tables[0].Rows)
                    {
                        totalCostItem += Utils.StrToDecimal(dr["TotalMoney"].ToString(), 0.00M);
                        costItem += "<tr><td width=\"20%\" style=\"text-align:right\">"+dr["Name"].ToString()+"&nbsp;:&nbsp;&nbsp;</td>";
                        costItem += "<td>¥" + string.Format("{0:N2}", dr["TotalMoney"]) + "</td></tr>";
                    }
                }
            }
            //throw new Exception("totalIncome:" + totalIncome.ToString()
            //    + "totalFactRepayment:" + totalFactRepayment.ToString()
            //    + "totalCarriage:" + totalCarriage.ToString()
            //    + "totalAdvance:" + totalAdvance.ToString()
            //    + "totalCostItem:" + totalCostItem.ToString()
            //    );
            totalGain = totalIncome + totalFactRepayment - totalCarriage - totalAdvance - totalCostItem;
        }
Пример #31
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);
        }
Пример #32
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>";
            }
        }
Пример #33
0
        private void RptBind()
        {
            string sql = " Status >= 2 ";

            if (!string.IsNullOrEmpty(_beginTime))
            {
                sql += " AND FactBackTime >= '" + _beginTime + "' ";
                txtBeginTime.Text = _beginTime;
            }
            else
            {
                sql += " AND FactBackTime >= '" + DateTime.Now.AddMonths(-1) + "' ";
                txtBeginTime.Text = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
            }
            if (!string.IsNullOrEmpty(_endTime))
            {
                sql            += " AND FactBackTime <= '" + _endTime + "' ";
                txtEndTime.Text = _endTime;
            }
            else
            {
                sql            += " AND FactBackTime <= '" + DateTime.Now + "' ";
                txtEndTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
            }
            string ids = string.Empty;

            BLL.TransportOrder bll  = new BLL.TransportOrder();
            DataSet            tods = bll.GetTotalList(sql);

            if (tods != null && tods.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in tods.Tables[0].Rows)
                {
                    ids += dr["Id"].ToString() + ",";
                    totalFactRepayment += Utils.StrToDecimal(dr["FactRepayment"].ToString(), 0.00M);
                    totalCarriage      += Utils.StrToDecimal(dr["FactCarriage"].ToString(), 0.00M);
                    totalAdvance       += Utils.StrToDecimal(dr["Advance"].ToString(), 0.00M);
                }
                if (ids.EndsWith(","))
                {
                    ids = ids.TrimEnd(',');
                }
            }
            if (!string.IsNullOrEmpty(ids))
            {
                BLL.Order itemBll = new BLL.Order();
                DataSet   itemds  = itemBll.GetList(" TransportOrderId IN (" + ids + ") ");
                if (itemds != null && itemds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in itemds.Tables[0].Rows)
                    {
                        totalIncome += Utils.StrToDecimal(dr["Freight"].ToString(), 0.00M);
                    }
                }

                BLL.Consumption cBll = new BLL.Consumption();
                DataSet         cds  = cBll.GetSumList(" TransportOrderId IN (" + ids + ") ");
                if (cds != null && cds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in cds.Tables[0].Rows)
                    {
                        totalCostItem += Utils.StrToDecimal(dr["TotalMoney"].ToString(), 0.00M);
                        costItem      += "<tr><td width=\"20%\" style=\"text-align:right\">" + dr["Name"].ToString() + "&nbsp;:&nbsp;&nbsp;</td>";
                        costItem      += "<td>¥" + string.Format("{0:N2}", dr["TotalMoney"]) + "</td></tr>";
                    }
                }
            }

            totalGain = totalIncome + totalFactRepayment - totalCarriage - totalAdvance - totalCostItem;
        }
Пример #34
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>";
            }
        }
Пример #35
0
        private void TreeBind(string strWhere)
        {
            BLL.Haulway haulwayBll = new BLL.Haulway();
            DataTable   haulwayDT  = haulwayBll.GetList(0, strWhere, "Id desc").Tables[0];

            ddlHaulway.Items.Clear();
            ddlHaulway.Items.Add(new ListItem("请选择运输路线", ""));
            foreach (DataRow dr in haulwayDT.Rows)
            {
                this.ddlHaulway.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString()));
            }

            BLL.Customer customerBll = new BLL.Customer();
            DataTable    customerDT  = customerBll.GetList(0, strWhere, "Id desc").Tables[0];

            ddlShipper.Items.Clear();
            ddlShipper.Items.Add(new ListItem("请选择托运方", ""));
            ddlReceiver.Items.Clear();
            ddlReceiver.Items.Add(new ListItem("请选择收货方", ""));
            foreach (DataRow dr in customerDT.Rows)
            {
                if (!dr["Category"].ToString().Equals("托运方"))
                {
                    this.ddlReceiver.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["Id"].ToString()));
                }
                if (!dr["Category"].ToString().Equals("收货方"))
                {
                    this.ddlShipper.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["Id"].ToString()));
                }
            }

            BLL.Address addressBll = new BLL.Address();
            DataTable   addressDT  = addressBll.GetList(0, strWhere, "Id desc").Tables[0];

            ddlLoadingAddress.Items.Clear();
            ddlLoadingAddress.Items.Add(new ListItem("请选择装货地址", ""));
            ddlUnloadingAddress.Items.Clear();
            ddlUnloadingAddress.Items.Add(new ListItem("请选择卸货地址", ""));
            foreach (DataRow dr in addressDT.Rows)
            {
                if (!dr["CategoryName"].ToString().Equals("卸货地址"))
                {
                    this.ddlLoadingAddress.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString()));
                }
                if (!dr["CategoryName"].ToString().Equals("装货地址"))
                {
                    this.ddlUnloadingAddress.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString()));
                }
            }

            BLL.Goods goodsBll = new BLL.Goods();
            DataTable goodsDT  = goodsBll.GetList(0, strWhere, "Id desc").Tables[0];

            ddlGoods.Items.Clear();
            ddlGoods.Items.Add(new ListItem("请选择承运货物", ""));
            foreach (DataRow dr in goodsDT.Rows)
            {
                this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString()));
            }

            BLL.TransportOrder transportOrderBLL = new BLL.TransportOrder();
            DataTable          transportOrderDT  = transportOrderBLL.GetSelectList(0, " A.Status = 0", "Id DESC").Tables[0];

            ddlTransportOrder.Items.Clear();
            ddlTransportOrder.Items.Add(new ListItem("请选择运输单", ""));
            foreach (DataRow dr in transportOrderDT.Rows)
            {
                this.ddlTransportOrder.Items.Add(new ListItem(string.Format("{0}({1})", dr["CarNumber"].ToString(), dr["Code"].ToString()), dr["Id"].ToString()));
            }
        }
Пример #36
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>";
            }
        }
Пример #37
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);
        }
Пример #38
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);
        }
Пример #39
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>";
            }
        }
Пример #40
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;
        }
Пример #41
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;
        }
Пример #42
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;
        }
Пример #43
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            if (!string.IsNullOrEmpty(_carNumber))
            {
                ddlDriver.SelectedValue = _carNumber;
            }
            //if (!string.IsNullOrEmpty(_beginTime))
            //{
            //    txtBeginTime.Text = _beginTime;
            //}
            //if (!string.IsNullOrEmpty(_endTime))
            //{
            //    txtEndTime.Text = _endTime;
            //}
            this.txtKeywords.Text = this.keywords;
            BLL.TransportOrder bll = new BLL.TransportOrder();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("receipt_register_list.aspx", "carNumber={0}&customer1={1}&customer2={2}&keywords={3}&page={4}",
                _carNumber, _customer1, _customer2, this.keywords, "__id__");
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Пример #44
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;
        }
Пример #45
0
        private void TreeBind(string strWhere)
        {
            BLL.Haulway haulwayBll = new BLL.Haulway();
            DataTable haulwayDT = haulwayBll.GetList(0, strWhere, "Id desc").Tables[0];
            ddlHaulway.Items.Clear();
            ddlHaulway.Items.Add(new ListItem("请选择运输路线", ""));
            foreach (DataRow dr in haulwayDT.Rows)
            {
                this.ddlHaulway.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString()));
            }

            BLL.Customer customerBll = new BLL.Customer();
            DataTable customerDT = customerBll.GetList(0, strWhere, "Id desc").Tables[0];
            ddlShipper.Items.Clear();
            ddlShipper.Items.Add(new ListItem("请选择托运方", ""));
            ddlReceiver.Items.Clear();
            ddlReceiver.Items.Add(new ListItem("请选择收货方", ""));
            foreach (DataRow dr in customerDT.Rows)
            {
                if (!dr["Category"].ToString().Equals("托运方"))
                {
                    this.ddlReceiver.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["Id"].ToString()));
                }
                if (!dr["Category"].ToString().Equals("收货方"))
                {
                    this.ddlShipper.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["Id"].ToString()));
                }
            }

            BLL.Address addressBll = new BLL.Address();
            DataTable addressDT = addressBll.GetList(0, strWhere, "Id desc").Tables[0];
            ddlLoadingAddress.Items.Clear();
            ddlLoadingAddress.Items.Add(new ListItem("请选择装货地址", ""));
            ddlUnloadingAddress.Items.Clear();
            ddlUnloadingAddress.Items.Add(new ListItem("请选择卸货地址", ""));
            foreach (DataRow dr in addressDT.Rows)
            {
                if (!dr["CategoryName"].ToString().Equals("卸货地址"))
                {
                    this.ddlLoadingAddress.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString()));
                }
                if (!dr["CategoryName"].ToString().Equals("装货地址"))
                {
                    this.ddlUnloadingAddress.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString()));
                }
            }

            BLL.Goods goodsBll = new BLL.Goods();
            DataTable goodsDT = goodsBll.GetList(0, strWhere, "Id desc").Tables[0];
            ddlGoods.Items.Clear();
            ddlGoods.Items.Add(new ListItem("请选择承运货物", ""));
            foreach (DataRow dr in goodsDT.Rows)
            {
                this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString()));
            }

            BLL.TransportOrder transportOrderBLL = new BLL.TransportOrder();
            DataTable transportOrderDT = transportOrderBLL.GetSelectList(0, " A.Status = 0", "Id DESC").Tables[0];
            ddlTransportOrder.Items.Clear();
            ddlTransportOrder.Items.Add(new ListItem("请选择运输单", ""));
            foreach (DataRow dr in transportOrderDT.Rows)
            {
                this.ddlTransportOrder.Items.Add(new ListItem(string.Format("{0}({1})", dr["CarNumber"].ToString(), dr["Code"].ToString()), dr["Id"].ToString()));
            }
        }
Пример #46
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>";
            }
        }