Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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;
        }
Ejemplo n.º 4
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;
        }