Example #1
0
    /// <summary>
    /// 绑定报表
    /// </summary>
    private void Print()
    {
        UserInfoUtil UserInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
        /*接受参数*/
        int BillID = int.Parse(Request.QueryString["BillID"].ToString());
        /*读取数据*/
        DataTable SubSellBackPri = SubSellBackBus.SubSellBack(BillID);

        if (SubSellBackPri != null && SubSellBackPri.Rows.Count > 0)
        {
            foreach (DataRow row in SubSellBackPri.Rows)
            {
                if (row["FromType"].ToString() == "0")
                {
                    row["FromType"] = "无来源";
                }
                if (row["FromType"].ToString() == "1")
                {
                    row["FromType"] = "销售订单";
                }
                if (row["isAddTax"].ToString() == "0")
                {
                    row["isAddTax"] = "否";
                }
                if (row["isAddTax"].ToString() == "1")
                {
                    row["isAddTax"] = "是";
                }
            }
        }
        DataTable SubSellBackDetail = SubSellBackBus.Details(BillID);

        /*绑定RPT*/
        if (SubSellBackPri != null)
        {
            /*加载主报表*/
            rd.Load(Server.MapPath(@"~/PrinttingModel/SubStoreManager/PrintSellBack.rpt"));
            CrystalReportViewer1.LogOnInfo.Add(ReportUtil.GetTableLogOnInfo("officedba.V_SubStoreSubSellBack"));

            /*加载子报表*/
            ReportDocument rdDetail = rd.Subreports["PrintSellBackDetail.rpt"];
            rdDetail.SetDataSource(SubSellBackDetail);

            //绑定数据
            rd.SetDataSource(SubSellBackPri);
            rd.Refresh();
            this.CrystalReportViewer1.ReportSource = rd;
            rd.SetParameterValue("Creator", UserInfo.UserName);
        }
    }
Example #2
0
    private void BinddrpStorageID()
    {
        DataTable dt = SubSellBackBus.GetdrpStorageID();

        if (dt != null && dt.Rows.Count > 0)
        {
            drpStorageID.DataSource     = dt;
            drpStorageID.DataTextField  = "StorageName";
            drpStorageID.DataValueField = "ID";
            drpStorageID.DataBind();
            ListItem Item = new ListItem("--请选择--", "");
            drpStorageID.Items.Insert(0, Item);
        }
    }
Example #3
0
    private void BinddrpCurrencyType()
    {
        DataTable dt = SubSellBackBus.GetCurrenyType();

        if (dt != null && dt.Rows.Count > 0)
        {
            drpCurrencyType.DataSource     = dt;
            drpCurrencyType.DataTextField  = "CurrencyName";
            drpCurrencyType.DataValueField = "hhh";
            drpCurrencyType.DataBind();

            string aaa = drpCurrencyType.Value;
            CurrencyTypeID.Value = aaa.Split('_')[0];
            txtRate.Text         = aaa.Split('_')[1];
            hiddenRate.Value     = aaa.Split('_')[1];
        }
    }
Example #4
0
    protected void btnImport_Click(object sender, ImageClickEventArgs e)
    {
        string companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;

        string BackNo     = this.txtBackNo.Text;
        string Title      = this.txtTitle.Text;
        string OrderID    = this.HidOrderID.Value;
        string CustName   = this.txtCustName.Text;
        string CustTel    = this.txtCustTel.Text;
        string DeptID     = this.HidDeptID.Value;
        string Seller     = this.HidSeller.Value;
        string BusiStatus = this.drpBusiStatus.Value;

        if (BusiStatus == "0")
        {
            BusiStatus = "";
        }
        string BillStatus = this.ddlBillStatus.Value;

        if (BillStatus == "0")
        {
            BillStatus = "";
        }
        string    CustAddr   = this.txtCustAddr.Text;
        string    EFIndex    = GetBillExAttrControl1.GetExtIndexValue;
        string    EFDesc     = GetBillExAttrControl1.GetExtTxtValue;
        int       TotalCount = 0;
        DataTable dt         = SubSellBackBus.SelectSubSellBack(1, 1000000, "ID", ref TotalCount, BackNo, Title, OrderID, CustName, CustTel, DeptID, Seller, BusiStatus, BillStatus, CustAddr, EFIndex, EFDesc);



        //DataTable dt = WorkCenterBus.GetWorkCenterListBycondition(model, 1, 1000000, "ID desc", ref totalCount);

        //导出标题
        string headerTitle = "单据编号|单据主题|对应销售订单|客户名称|客户联系电话|客户地址|销售分店|退货处理人|单据状态|业务状态";

        string[] header = headerTitle.Split('|');

        //导出标题所对应的列字段名称
        string columnFiled = "BackNo|Title|OrderNo|CustName|CustTel|CustAddr|DeptName|SellerName|BillStatusName|BusiStatusName";

        string[] field = columnFiled.Split('|');

        XBase.Common.OutputToExecl.ExportToTable(this.Page, dt, header, field, "销售退货单");
    }
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel pModel = new PrintParameterSettingModel();

        pModel.CompanyCD     = UserInfo.CompanyCD;
        pModel.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_SUBSTORAGE);
        pModel.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_SUBSELLBACK;


        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "{ExtField1}",  "ExtField1"           },
            { "{ExtField2}",  "ExtField2"           },
            { "{ExtField3}",  "ExtField3"           },
            { "{ExtField4}",  "ExtField4"           },
            { "{ExtField5}",  "ExtField5"           },
            { "{ExtField6}",  "ExtField6"           },
            { "{ExtField7}",  "ExtField7"           },
            { "{ExtField8}",  "ExtField8"           },
            { "{ExtField9}",  "ExtField9"           },
            { "{ExtField10}", "ExtField10"          },
            { "单据编号",         "BackNo"              },
            { "单据主题",         "Title"               },
            { "销售分店",         "DeptName"            },
            { "源单类型",         "FromType"            },
            { "对应分店销售订单",     "OrderID"             },
            { "发货模式",         "SendModeName"        },
            { "发货时间",         "OutDate"             },
            { "发货人",          "OutUserIDName"       },
            { "是否增值税",        "isAddTax"            },
            { "客户名称",         "CustName"            },
            { "客户联系电话",       "CustTel"             },
            { "客户手机号",        "CustMobile"          },
            { "币种",           "CurrencyTypeName"    },
            { "汇率",           "Rate"                },
            { "业务状态",         "BusiStatusName"      },
            { "退货时间",         "BackDate"            },
            { "退货处理人",        "SellerName"          },
            { "入库时间",         "InDate"              },
            { "入库人",          "InUserIDName"        },
            { "结算时间",         "SttlDate"            },
            { "结算人",          "SttlUserIDName"      },
            { "客户地址",         "CustAddr"            },
            { "退货理由描述",       "BackReason"          },
            { "退货数量合计",       "CountTotal"          },
            { "金额合计",         "TotalPrice"          },
            { "税额合计",         "Tax"                 },
            { "含税金额合计",       "TotalFee"            },
            { "整单折扣(%)",      "Discount"            },
            { "折扣金额合计",       "DiscountTotal"       },
            { "折后含税金额",       "RealTotal"           },
            { "应退货款",         "WairPayTotal"        },
            { "已退货款",         "PayedTotal"          },
            { "应退货款余额",       "WairPayTotalOverage" },
            { "单据状态",         "BillStatusName"      },
            { "制单人",          "CreatorName"         },
            { "制单日期",         "CreateDate"          },
            { "确认人",          "ConfirmorName"       },
            { "确认日期",         "ConfirmDate"         },
            { "结单人",          "CloserName"          },
            { "结单日期",         "CloseDate"           },
            { "最后更新人",        "ModifiedUserID"      },
            { "最后更新日期",       "ModifiedDate"        },
            { "备注",           "Remark"              },
        };

        string[,] aDetail =
        {
            { "序号",   "SortNo"       },
            { "产品编号", "ProductNo"    },
            { "产品名称", "ProductName"  },
            { "批次",   "BatchNo"      },
            { "规格",   "standard"     },
            { "单位",   "UnitName"     },
            { "发货数量", "ProductCount" },
            { "退货数量", "BackCount"    },
            { "单价",   "UnitPrice"    },
            { "含税价",  "TaxPrice"     },
            { "折扣",   "Discount"     },
            { "税率",   "TaxRate"      },
            { "金额",   "TotalPrice"   },
            { "含税金额", "TotalFee"     },
            { "仓库",   "StorageName"  },
            { "备注",   "Remark"       }
        };
        if (_isMoreUnit)
        {// 启用多计量单位
            aDetail = new string[, ]
            {
                { "序号", "SortNo" },
                { "产品编号", "ProductNo" },
                { "产品名称", "ProductName" },
                { "批次", "BatchNo" },
                { "规格", "standard" },
                { "基本单位", "UnitName" },
                { "基本数量", "BackCount" },
                { "单位", "UsedUnitName" },
                { "发货数量", "ProductCount" },
                { "退货数量", "UsedUnitCount" },
                { "单价", "UnitPrice" },
                { "含税价", "TaxPrice" },
                { "折扣", "Discount" },
                { "税率", "TaxRate" },
                { "金额", "TotalPrice" },
                { "含税金额", "TotalFee" },
                { "仓库", "StorageName" },
                { "备注", "Remark" }
            };
        }

        #region 扩展属性
        DataTable dtExtTable = TableExtFieldsBus.GetAllList(UserInfo.CompanyCD, "", "officedba.SubSellBack");
        int       countExt   = 0;
        for (int i = 0; i < dtExtTable.Rows.Count; i++)
        {
            aBase[i, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
            countExt++;
        }
        #endregion

        DataTable dbPrint = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(pModel);
        DataTable dt      = SubSellBackBus.SubSellBack(intID);
        ConvertDataTable(dt);
        DataTable dtDetail = SubSellBackBus.Details(intID);

        string strBaseFields   = "";
        string strDetailFields = "";

        if (dbPrint.Rows.Count > 0)
        {
            isSeted.Value   = "1";
            strBaseFields   = dbPrint.Rows[0]["BaseFields"].ToString();
            strDetailFields = dbPrint.Rows[0]["DetailFields"].ToString();
        }
        else
        {
            isSeted.Value = "0";
            strBaseFields = GetDefaultFields(aBase);
            /*基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields += "|ExtField" + (i + 1);
                }
            }
            strDetailFields = GetDefaultFields(aDetail);
        }

        #region 主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("销售退货单", strBaseFields, strDetailFields, aBase, aDetail, dt, dtDetail, true);
        }
        #endregion

        #region 明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("销售退货单", strBaseFields, strDetailFields, aBase, aDetail, dt, dtDetail, false);
        }
        #endregion
    }