Пример #1
0
        private void RptBind()
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            BLL.finance bll    = new BLL.finance();
            string      _where = "";
            Dictionary <string, string> dict = getDict(out _where);
            DataTable dt       = bll.getReconciliationDetail(dict, this.pageSize, this.page, "o_id asc", out this.totalCount, out _p24, out _p25, out _p26, out _p13, out _p14).Tables[0];
            int       _colspan = 1;
            DataTable finDt    = null;

            if (dt.Rows.Count > 0)
            {
                #region 拼接列表Html
                foreach (DataRow dr in dt.Rows)
                {
                    if (!string.IsNullOrEmpty(oidStr) && oidStr.IndexOf(dr["o_id"].ToString()) == -1)
                    {
                        continue;
                    }
                    finDt    = bll.GetList(0, "fin_oid='" + dr["o_id"] + "'" + _where, "").Tables[0];
                    _colspan = finDt.Rows.Count == 0 ? 1 : finDt.Rows.Count;
                    trHtml  += "<tr style=\"text-align: center;\">";
                    trHtml  += "<td rowspan=\"" + _colspan + "\"><a href=\"../order/order_edit.aspx?action=" + DTEnums.ActionEnum.Edit.ToString() + "&oID=" + dr["o_id"] + "\">" + dr["o_id"] + "</a></td>";
                    trHtml  += "<td style=\"text-align: left;\" rowspan=\"" + _colspan + "\">" + dr["o_content"] + "</td>";
                    trHtml  += "<td rowspan=\"" + _colspan + "\">" + ConvertHelper.toDate(finDt.Rows[0]["o_sdate"]).Value.ToString("yyyy-MM-dd") + "<br/>" + ConvertHelper.toDate(finDt.Rows[0]["o_edate"]).Value.ToString("yyyy-MM-dd") + "</td>";
                    if (finDt == null || finDt.Rows.Count == 0)
                    {
                        //trHtml += "<td></td>";
                        trHtml += "<td></td>";
                        trHtml += "<td></td>";
                        trHtml += "<td></td>";
                    }
                    else
                    {
                        //trHtml += "<td>" + ConvertHelper.toDate(finDt.Rows[0]["fin_sdate"]).Value.ToString("yyyy-MM-dd") + "<br/>" + ConvertHelper.toDate(finDt.Rows[0]["fin_edate"]).Value.ToString("yyyy-MM-dd") + "</td>";
                        trHtml += "<td style=\"text-align: left;\">" + finDt.Rows[0]["na_name"] + "<br/>" + finDt.Rows[0]["fin_detail"] + "</td>";
                        trHtml += "<td>" + finDt.Rows[0]["fin_illustration"] + "</td>";
                        trHtml += "<td style=\"word-wrap:break-word;word-break:break-all;\">" + finDt.Rows[0]["fin_expression"] + "<br/>=" + finDt.Rows[0]["fin_money"] + "</td>";
                    }
                    trHtml += "<td style=\"text-align: right;\" rowspan=\"" + _colspan + "\">" + (string.IsNullOrEmpty(_chk) ?  dr["fin_money"] : dr["fcMoney"]) + "</td>";
                    trHtml += "<td style=\"text-align: right;\" rowspan=\"" + _colspan + "\">" + (string.IsNullOrEmpty(_chk) ? dr["rpd_money"] : dr["chkMoney"]) + "</td>";
                    trHtml += "<td style=\"text-align: right;\" rowspan=\"" + _colspan + "\">" + (string.IsNullOrEmpty(_chk) ? dr["unReceiptPay"] : dr["unChkMoney"]) + "</td>";
                    trHtml += "<td rowspan=\"" + _colspan + "\">" + dr["co_name"] + "</td>";
                    trHtml += "</tr>";
                    if (finDt != null && finDt.Rows.Count > 1)
                    {
                        for (int i = 1; i < finDt.Rows.Count; i++)
                        {
                            trHtml += "<tr style=\"text-align: center;\">";
                            //trHtml += "<td>" + ConvertHelper.toDate(finDt.Rows[i]["fin_sdate"]).Value.ToString("yyyy-MM-dd") + "<br/>" + ConvertHelper.toDate(finDt.Rows[i]["fin_edate"]).Value.ToString("yyyy-MM-dd") + "</td>";
                            trHtml += "<td style=\"text-align: left;\">" + finDt.Rows[i]["na_name"] + "<br/>" + finDt.Rows[i]["fin_detail"] + "</td>";
                            trHtml += "<td>" + finDt.Rows[i]["fin_illustration"] + "</td>";
                            trHtml += "<td style=\"word-wrap:break-word;word-break:break-all;\">" + finDt.Rows[i]["fin_expression"] + "<br/>=" + finDt.Rows[i]["fin_money"] + "</td>";
                            trHtml += "</tr>";
                        }
                    }
                }
                trHtml += "<tr style=\"text-align: right;\"><td colspan=\"6\">合计:</td><td>" + _p24 + "</td><td>" + _p25 + "</td><td>" + _p26 + "</td><td></td></tr>";
                #endregion
            }
            else
            {
                trHtml = "<tr><td align=\"center\" colspan=\"10\">暂无记录</td></tr>";
            }
            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("ReconciliationBill.aspx", "page={0}&txtCusName={1}&hCusId={2}&ddltype={3}&ddlsign={4}&txtMoney1={5}&ddlnature={6}&txtsDate={7}&txteDate={8}&txtsDate1={9}&txteDate1={10}&txtName={11}&txtAddress={12}&ddlsign1={13}&txtMoney2={14}&txtPerson1={15}&txtPerson2={16}&txtPerson3={17}&txtPerson4={18}&txtPerson5={19}&txtOrderID={20}&txtChk={21}&ddlstatus={22}&ddllock={23}&ddlarea={24}&txtsDate2={25}&txteDate2={26}&txtsDate3={27}&txteDate3={28}&self={29}",
                                              "__id__", _cusName, _cid, _type, _sign, _money1, _nature, _sdate, _edate, _sdate1, _edate1, _name, _address, _sign1, _money2, _person1, _person2, _person3, _person4, _person5, _oid, _chk, _status, _lockstatus, _area, _sdate2, _edate2, _sdate3, _edate3, _self);
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Пример #2
0
        private void RptBind()
        {
            if (!this.isSearch)
            {
                this.page = DTRequest.GetQueryInt("page", 1);
            }
            else
            {
                this.page = 1;
            }
            BLL.finance bll    = new BLL.finance();
            string      _where = "";
            Dictionary <string, string> dict = getDict(out _where);
            DataTable dt       = bll.getReconciliationDetail(dict, this.pageSize, this.page, "o_id asc", out this.totalCount, out _p24, out _p25, out _p26, out _p13, out _p14).Tables[0];
            int       _colspan = 1;
            DataTable finDt    = null;

            if (dt.Rows.Count > 0)
            {
                #region 拼接列表Html
                foreach (DataRow dr in dt.Rows)
                {
                    finDt    = bll.GetList(0, "fin_oid='" + dr["o_id"] + "'" + _where, _chk, "").Tables[0];
                    _colspan = finDt.Rows.Count == 0 ? 1 : finDt.Rows.Count;
                    trHtml  += "<tr style=\"text-align: center;\">";
                    trHtml  += "<td rowspan=\"" + _colspan + "\"><input type=\"checkbox\" class=\"checkall\" data-id=\"" + dr["o_id"] + "\" data-finmoney=\"" + dr["fin_money"] + "\" data-rpdmoney=\"" + dr["rpd_money"] + "\" data-unMoney=\"" + dr["unReceiptPay"] + "\" data-unchkmoney=\"" + (string.IsNullOrEmpty(_chk) ? "--" : "" + dr["unChkMoney"] + "") + "\"  data-unrpmoney=\"" + (string.IsNullOrEmpty(_chk) ? "" + dr["unReceiptPay"] + "" : "" + dr["unChkMoney"] + "") + "\"/></td>";
                    trHtml  += "<td rowspan=\"" + _colspan + "\"><a href=\"../order/order_edit.aspx?action=" + DTEnums.ActionEnum.Edit.ToString() + "&oID=" + dr["o_id"] + "\"><span class=\"orderstatus_" + dr["o_status"] + "\">" + dr["o_id"] + "</span></a></td>";
                    trHtml  += "<td style=\"text-align: left;\" rowspan=\"" + _colspan + "\">" + dr["c_name"] + "</td>";
                    trHtml  += "<td rowspan=\"" + _colspan + "\">" + ConvertHelper.toDate(dr["o_sdate"]).Value.ToString("yyyy-MM-dd") + "<br/>" + ConvertHelper.toDate(dr["o_edate"]).Value.ToString("yyyy-MM-dd") + "</td>";
                    trHtml  += "<td style=\"text-align: left;\" rowspan=\"" + _colspan + "\">" + dr["o_address"] + "/" + dr["o_content"] + "</td>";
                    if (finDt == null || finDt.Rows.Count == 0)
                    {
                        trHtml += "<td></td>";
                        trHtml += "<td></td>";
                        trHtml += "<td></td>";
                        //trHtml += "<td></td>";
                        trHtml += "<td></td>";
                        trHtml += "<td></td>";
                        trHtml += "<td></td>";
                        trHtml += "<td></td>";
                    }
                    else
                    {
                        _p11   += Utils.ObjToDecimal(finDt.Rows[0]["chkMoney"], 0);
                        trHtml += "<td><input type=\"checkbox\" class=\"check\" data-oid=\"" + dr["o_id"] + "\" data-id=\"" + finDt.Rows[0]["fin_id"] + "\" data-money=\"" + finDt.Rows[0]["fin_money"] + "\" data-chkmoney=\"" + finDt.Rows[0]["chkMoney"] + "\" /></td>";
                        trHtml += "<td style=\"word-wrap:break-word;word-break:break-all;\"><a href=\"javascript:;\" onclick=\"addFinChk(" + finDt.Rows[0]["fin_id"] + ",'" + finDt.Rows[0]["fin_oid"] + "')\">" + finDt.Rows[0]["chk"] + "</a></td>";
                        trHtml += "<td style=\"text-align: right;\">" + finDt.Rows[0]["chkMoney"] + "</td>";
                        //trHtml += "<td>" + ConvertHelper.toDate(finDt.Rows[0]["fin_sdate"]).Value.ToString("yyyy-MM-dd") + "<br/>" + ConvertHelper.toDate(finDt.Rows[0]["fin_edate"]).Value.ToString("yyyy-MM-dd") + "</td>";
                        trHtml += "<td style=\"text-align: center;\">" + finDt.Rows[0]["na_name"] + "<br/>" + finDt.Rows[0]["fin_detail"] + "</td>";
                        trHtml += "<td title=\"" + finDt.Rows[0]["fin_illustration"] + "\">" + (finDt.Rows[0]["fin_illustration"].ToString().Length <= 30 ? finDt.Rows[0]["fin_illustration"].ToString() : finDt.Rows[0]["fin_illustration"].ToString().Substring(0, 30)) + "</td>";
                        trHtml += "<td style=\"word-wrap:break-word;word-break:break-all;\">" + finDt.Rows[0]["fin_expression"] + "<br/>=" + finDt.Rows[0]["fin_money"] + "</td>";
                        trHtml += "<td><span onmouseover=\"tip_index = layer.tips('审批人:" + finDt.Rows[0]["fin_checkNum"] + "-" + finDt.Rows[0]["fin_checkName"] + "<br/>审批备注:" + finDt.Rows[0]["fin_checkRemark"] + "', this, { time: 0 }); \" onmouseout=\"layer.close(tip_index); \" class=\"check_" + finDt.Rows[0]["fin_flag"] + "\"></span></td>";
                    }
                    trHtml += "<td style=\"text-align: right;\" rowspan=\"" + _colspan + "\">" + ((string.IsNullOrEmpty(_chk) || _chk == "空")? "" : "<font color='green'>" + dr["fcMoney"] + "/</font>") + "" + dr["fin_money"] + "</td>";
                    trHtml += "<td style=\"text-align: right;\" rowspan=\"" + _colspan + "\">" + ((string.IsNullOrEmpty(_chk) || _chk == "空")? "" : "<font color='green'>" + dr["chkMoney"] + "/</font>") + "" + dr["rpd_money"] + "</td>";
                    trHtml += "<td style=\"text-align: right;\" rowspan=\"" + _colspan + "\">" + ((string.IsNullOrEmpty(_chk) || _chk == "空")? "" : "<font color='green'>" + dr["unChkMoney"] + "/</font>") + "" + dr["unReceiptPay"] + "</td>";
                    trHtml += "</tr>";

                    if (!string.IsNullOrEmpty(_chk))
                    {
                        _p12 += Utils.ObjToDecimal(dr["unChkMoney"], 0);
                    }
                    _p21 += Utils.ObjToDecimal(dr["fin_money"], 0);
                    _p22 += Utils.ObjToDecimal(dr["rpd_money"], 0);
                    _p23 += Utils.ObjToDecimal(dr["unReceiptPay"], 0);
                    if (finDt != null && finDt.Rows.Count > 1)
                    {
                        for (int i = 1; i < finDt.Rows.Count; i++)
                        {
                            trHtml += "<tr style=\"text-align: center;\">";
                            trHtml += "<td><input type=\"checkbox\" class=\"check\" data-oid=\"" + dr["o_id"] + "\"  data-id=\"" + finDt.Rows[i]["fin_id"] + "\" data-money=\"" + finDt.Rows[i]["fin_money"] + "\" data-chkmoney=\"" + finDt.Rows[i]["chkMoney"] + "\" /></td>";
                            trHtml += "<td style=\"word-wrap:break-word;word-break:break-all;\"><a href=\"javascript:;\" onclick=\"addFinChk(" + finDt.Rows[i]["fin_id"] + ",'" + finDt.Rows[i]["fin_oid"] + "')\">" + finDt.Rows[i]["chk"] + "</a></td>";
                            trHtml += "<td style=\"text-align: right;\">" + finDt.Rows[i]["chkMoney"] + "</td>";
                            //trHtml += "<td>" + ConvertHelper.toDate(finDt.Rows[i]["fin_sdate"]).Value.ToString("yyyy-MM-dd") + "<br/>" + ConvertHelper.toDate(finDt.Rows[i]["fin_edate"]).Value.ToString("yyyy-MM-dd") + "</td>";
                            trHtml += "<td style=\"text-align: center;\">" + finDt.Rows[i]["na_name"] + "<br/>" + finDt.Rows[i]["fin_detail"] + "</td>";
                            trHtml += "<td title=\"" + finDt.Rows[i]["fin_illustration"] + "\">" + (finDt.Rows[i]["fin_illustration"].ToString().Length <= 30 ? finDt.Rows[i]["fin_illustration"].ToString() : finDt.Rows[i]["fin_illustration"].ToString().Substring(0, 30)) + "</td>";
                            trHtml += "<td style=\"word-wrap:break-word;word-break:break-all;\">" + finDt.Rows[i]["fin_expression"] + "<br/>=" + finDt.Rows[i]["fin_money"] + "</td>";
                            trHtml += "<td><span onmouseover=\"tip_index = layer.tips('审批人:" + finDt.Rows[i]["fin_checkNum"] + "-" + finDt.Rows[i]["fin_checkName"] + "<br/>审批备注:" + finDt.Rows[i]["fin_checkRemark"] + "', this, { time: 0 }); \" onmouseout=\"layer.close(tip_index); \" class=\"check_" + finDt.Rows[i]["fin_flag"] + "\"></span></td>";
                            trHtml += "</tr>";
                            _p11   += Utils.ObjToDecimal(finDt.Rows[i]["chkMoney"], 0);
                        }
                    }
                }
                #endregion
            }
            else
            {
                trHtml = "<tr><td align=\"center\" colspan=\"14\">暂无记录</td></tr>";
            }
            p11.Text = _p11.ToString();
            if (!string.IsNullOrEmpty(_chk))
            {
                p12.Text = _p12.ToString();
                p14.Text = _p14.ToString();
            }
            else
            {
                p12.Text = "--";
                p14.Text = "--";
            }
            p13.Text = _chk == "空"?"0":_p13.ToString();
            p21.Text = _p21.ToString();
            p22.Text = _p22.ToString();
            p23.Text = _p23.ToString();
            p24.Text = _p24.ToString();
            p25.Text = _p25.ToString();
            p26.Text = _p26.ToString();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = backUrl();
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);


            ddltype.SelectedValue = _type;
            txtCusName.Text       = _cusName;
            hCusId.Value          = _cid;
            txtCustomer.Text      = _customer;
            hCustomer.Value       = _hcustomer;
            txtsDate.Text         = _sdate;
            txteDate.Text         = _edate;
            txtsDate1.Text        = _sdate1;
            txteDate1.Text        = _edate1;
            txtsDate2.Text        = _sdate2;
            txteDate2.Text        = _edate2;
            //txtsDate3.Text = _sdate3;
            //txteDate3.Text = _edate3;
            ddlstatus.SelectedValue = _status;
            ddlsign.SelectedValue   = _sign;
            txtMoney1.Text          = _money1;
            ddlsign1.SelectedValue  = _sign1;
            txtMoney2.Text          = _money2;
            ddlnature.SelectedValue = _nature;
            txtChk.Text             = _chk;
            ddlarea.SelectedValue   = _area;
            ddllock.SelectedValue   = _lockstatus;
            txtOrderID.Text         = _oid;
            txtName.Text            = _name;
            txtAddress.Text         = _address;
            txtPerson1.Text         = _person1;
            txtPerson2.Text         = _person2;
            txtPerson3.Text         = _person3;
            txtPerson4.Text         = _person4;
            txtPerson5.Text         = _person5;
            ddlcheck.SelectedValue  = _check;
            txtDetails.Text         = _detail;
        }