protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_SUBSTORAGE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_SUBSTORAGECUST;

        SubSellCustInfoModel modelCust = new SubSellCustInfoModel();

        modelCust.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        modelCust.ID        = this.intCustID.ToString();

        #region 1.初始化 取基本信息及明细信息的字段以及对应的标题
        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "客户名称",   "CustName"   },
            { "客户联系电话", "CustTel"    },
            { "客户手机号",  "CustMobile" },
            { "客户地址",   "CustAddr"   },
        };

        #endregion

        #region 2.所设的打印模板设置

        DataTable dbPrint       = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtCust        = SubSellOrderBus.GetOneData(this.intCustID);
        string    strBaseFields = "";
        if (dbPrint.Rows.Count > 0)
        {
            #region 设置过打印模板设置时 直接取出表里设置的值
            isSeted.Value = "1";
            strBaseFields = dbPrint.Rows[0]["BaseFields"].ToString();
            #endregion
        }
        else
        {
            #region 未设置过打印模板设置 默认显示所有的
            isSeted.Value = "0";

            /*未设置过打印模板设置时,默认显示的字段  基本信息字段*/
            for (int m = 0; m < aBase.Length / 2; m++)
            {
                strBaseFields = strBaseFields + aBase[m, 1] + "|";
            }
            #endregion

            /*两种都可以*/
        }
        #endregion

        #region 3.输出主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("客户", strBaseFields.TrimEnd('|'), "", aBase, aBase, dtCust, dtCust, true);
        }
        #endregion
    }
Exemple #2
0
 /// <summary>
 /// 获取MRP信息
 /// </summary>
 /// <returns>DataTable</returns>
 public static DataTable GetPrintParameterSettingInfo(PrintParameterSettingModel model)
 {
     try
     {
         return(PrintParameterSettingDBHelper.GetPrintParameterSettingInfo(model));
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
        /// <summary>
        /// 该单据是否设置过打印模板
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static int CountPrintSets(PrintParameterSettingModel model)
        {
            string sql = "select count(*) as countPrints from officedba.PrintParameterSetting where BillTypeFlag=@BillTypeFlag and PrintTypeFlag=@PrintTypeFlag and CompanyCD=@CompanyCD";

            SqlParameter[] parms = new SqlParameter[3];
            parms[0] = SqlHelper.GetParameter("@CompanyCD", model.CompanyCD);
            parms[1] = SqlHelper.GetParameter("@BillTypeFlag", model.BillTypeFlag);
            parms[2] = SqlHelper.GetParameter("@PrintTypeFlag", model.PrintTypeFlag);
            object obj = SqlHelper.ExecuteScalar(sql, parms);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
        /// <summary>
        /// 获取打印模板设置详细信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static DataTable GetPrintParameterSettingInfo(PrintParameterSettingModel model)
        {
            #region 查询语句
            //查询SQL拼写
            StringBuilder searchSql = new StringBuilder();
            searchSql.AppendLine("select * from officedba.PrintParameterSetting where BillTypeFlag=@BillTypeFlag and PrintTypeFlag=@PrintTypeFlag and CompanyCD=@CompanyCD");

            #endregion

            //定义查询的命令
            SqlCommand comm = new SqlCommand();
            //添加公司代码参数
            comm.Parameters.Add(SqlHelper.GetParameterFromString("@CompanyCD", model.CompanyCD));
            comm.Parameters.Add(SqlHelper.GetParameterFromString("@BillTypeFlag", model.BillTypeFlag.ToString()));
            comm.Parameters.Add(SqlHelper.GetParameterFromString("@PrintTypeFlag", model.PrintTypeFlag.ToString()));


            //指定命令的SQL文
            comm.CommandText = searchSql.ToString();
            //执行查询
            return(SqlHelper.ExecuteSearch(comm));
        }
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_PURCHASE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_PROVIDERLINKMAN;

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "联系人姓名",  "LinkManName"    },
            { "供应商姓名",  "CustName"       },
            { "性别",     "SexName"        },
            { "重要程度",   "ImportantName"  },
            { "称谓",     "Appellation"    },
            { "单位",     "Company"        },
            { "部门",     "Department"     },
            { "职务",     "Position"       },
            { "负责业务",   "Operation"      },
            { "工作电话",   "WorkTel"        },
            { "传真",     "Fax"            },
            { "移动电话",   "Handset"        },
            { "邮件地址",   "MailAddress"    },
            { "家庭电话",   "HomeTel"        },
            { "MSN",    "MSN"            },
            { "QQ",     "QQ"             },
            { "邮编",     "Post"           },
            { "联系人类型",  "LinkTypeName"   },
            { "年龄",     "Age"            },
            { "证件类型",   "PaperType"      },
            { "证件号",    "PaperNum"       },
            { "最后更新日期", "ModifiedDate"   },
            { "最后更新人",  "ModifiedUserID" },
            { "生日",     "Birthday"       },
            { "爱好",     "Likes"          },
            { "备注",     "Remark"         },
        };
        DataTable dbPrint = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);

        DataTable dtProviderInfo = ProviderLinkManBus.SelectProviderLinkMan(this.intMrpID);

        string strBaseFields   = "";
        string strDetailFields = "";
        /*第二明细*/
        string strDetailSecondFields = "";

        if (dbPrint.Rows.Count > 0)
        {
            isSeted.Value   = "1";
            strBaseFields   = dbPrint.Rows[0]["BaseFields"].ToString();
            strDetailFields = dbPrint.Rows[0]["DetailFields"].ToString();
            /*第二明细*/
            strDetailSecondFields = dbPrint.Rows[0]["DetailSecondFields"].ToString();
        }
        else
        {
            isSeted.Value = "0";
            strBaseFields = "LinkManName|CustName|SexName|ImportantName|Appellation|Company|Department|Position|Operation|WorkTel|Fax|Handset|MailAddress|HomeTel|MSN|QQ|Post|LinkTypeName|Age|PaperType|PaperNum|ModifiedDate|ModifiedUserID|Birthday|Likes|Remark";
        }

        #region 2.主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("供应商联系人", strBaseFields, null, aBase, null, dtProviderInfo, null, true);
        }
        #endregion

        //#region 3.明细信息
        //if (!string.IsNullOrEmpty(strDetailFields))
        //{
        //    tableDetail.InnerHtml = WritePrintPageTable("物料需求计划", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, false);
        //}
        //#endregion

        ///*第二明细*/
        //#region 4.明细信息2
        //if (!string.IsNullOrEmpty(strDetailSecondFields))
        //{
        //    tableDetail2.InnerHtml = WritePrintPageTable("物料需求计划", strBaseFields, strDetailSecondFields, aBase, aSecondDetail, dtMRP, dtDetail, false);
        //}
        //#endregion
    }
Exemple #6
0
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_PURCHASE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_PurchaseAskPrice;


        //PurchaseApplyModel modelMRP = new PurchaseApplyModel();
        //PurchaseApplyModel.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        //PurchaseApplyModel.ID = this.intMrpID;

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "{ExtField1}",  "ExtField1"      },
            { "{ExtField2}",  "ExtField2"      },
            { "{ExtField3}",  "ExtField3"      },
            { "{ExtField4}",  "ExtField4"      },
            { "{ExtField5}",  "ExtField5"      },
            { "{ExtField6}",  "ExtField6"      },
            { "{ExtField7}",  "ExtField7"      },
            { "{ExtField8}",  "ExtField8"      },
            { "{ExtField9}",  "ExtField9"      },
            { "{ExtField10}", "ExtField10"     },
            { "单据编号",         "AskNo"          },
            { "主题",           "AskTitle"       },
            { "采购类别",         "TypeName"       },
            { "供应商",          "ProviderName"   },
            { "部门",           "DeptName"       },
            { "询价员",          "AskUserName"    },
            { "询价日期",         "AskDate"        },
            { "源单类型",         "FromTypeName"   },
            { "币种",           "CurrencyName"   },
            { "询价次数",         "AskOrder"       },
            { "汇率",           "Rate"           },
            { "是否为增值税",       "ShowName"       },

            { "数量总计",         "CountTotal"     },
            { "金额总计",         "TotalPrice"     },
            { "税额合计",         "TotalTax"       },
            { "含税总额总计",       "TotalFee"       },
            { "整单折扣",         "Discount"       },
            { "折扣金额",         "DiscountTotal"  },
            { "折后含税额",        "RealTotal"      },

            { "单据状态",         "BillStatusName" },
            { "制单人",          "CreatorName"    },
            { "制单日期",         "CreateDate"     },
            { "确认人",          "ConfirmorName"  },
            { "确认日期",         "ConfirmDate"    },
            { "结单人",          "CloserName"     },
            { "结单日期",         "CloseDate"      },
            { "最后更新人",        "ModifiedUserID" },
            { "最后更新日期",       "ModifiedDate"   },
            { "备注",           "Remark"         },
        };


        string[,] aDetail;
        if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
        {
            aDetail = new string[, ] {
                { "物品名称", "ProductName" },
                { "颜色", "ColorName" },
                { "基本数量", "ProductCount" },
                { "交货日期", "RequireDate" },
                { "基本单位", "UnitName" },
                { "单价", "UsedPrice" },
                { "含税价", "TaxPrice" },
                { "单位", "UsedUnitName" },
                { "计划数量", "UsedUnitCount" },
                { "税率", "TaxRate" },
                { "含税金额", "TotalFee" },
                { "税额", "TotalTax" },
                { "规格", "Specification" },
            };
        }
        else
        {
            aDetail = new string[, ] {
                { "物品名称", "ProductName" },
                { "颜色", "ColorName" },
                { "计划数量", "ProductCount" },
                { "交货日期", "RequireDate" },
                { "单位", "UnitName" },
                { "单价", "UnitPrice" },
                { "含税价", "TaxPrice" },
                { "税率", "TaxRate" },
                { "含税金额", "TotalFee" },
                { "税额", "TotalTax" },
                { "规格", "Specification" },
            };
        }

        /*第二明细*/
        //string[,] aSecondDetail = {
        //                   };

        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba." + ConstUtil.CODING_RULE_TABLE_PURCHASEASKPRICE);
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 15; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion

        DataTable dbPrint  = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMRP    = PurchaseAskPriceBus.GetPurAskPricePriByID(this.intMrpID.ToString());
        DataTable dtDetail = PurchaseAskPriceBus.GetPurAskPriceDetail(this.intMrpID.ToString());

        //DataTable PurchaseApplyPrimary = PurchaseApplyBus.GetPurchaseApply(ID);
        //DataTable PurchaseApplySource = PurchaseApplyBus.GetPurchaseApplySource(ID);
        //   DataTable PurchaseApplyDetail2 = PurchasePlanBus.GetPurchasePlanDetail(this.intMrpID.ToString());



        string strBaseFields   = "";
        string strDetailFields = "";
        /*第二明细*/
        string strDetailSecondFields = "";

        if (dbPrint.Rows.Count > 0)
        {
            isSeted.Value   = "1";
            strBaseFields   = dbPrint.Rows[0]["BaseFields"].ToString();
            strDetailFields = dbPrint.Rows[0]["DetailFields"].ToString();
            /*第二明细*/
            strDetailSecondFields = dbPrint.Rows[0]["DetailSecondFields"].ToString();
        }
        else
        {
            isSeted.Value = "0";
            strBaseFields = "AskNo|AskTitle|TypeName|ProviderName|ShowName|TotalTax|DeptName|AskUserName|AskDate|TotalFee|CurrencyName|AskOrder|Rate|FromTypeName|CountTotal|TotalPrice|CreatorName|CreateDate|BillStatusName|ConfirmorName|ConfirmDate|CloserName|CloseDate|ModifiedUserID|ModifiedDate|Remark|Discount|DiscountTotal|RealTotal";
            /*基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields = strBaseFields + "|" + "ExtField" + (i + 1);
                }
            }


            if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
            {
                strDetailFields = "ProductName|ColorName|ProductCount|RequireDate|UsedPrice|UnitName|UsedUnitName|UsedUnitCount|TaxPrice|TotalTax|TaxRate|TotalFee";
                /*第二明细*/
                strDetailSecondFields = "ProductName|ColorName|ProductCount|RequireDate|TotalTax|ProductCount|RequireDate|UsedPrice|UsedUnitName|UsedUnitCount|TotalPrice|OrderCount|UnitName|TaxPrice|Specification";
            }
            else
            {
                strDetailFields = "ProductName|ColorName|ProductCount|RequireDate|UnitPrice|UnitName|TaxPrice|TotalTax|TaxRate|TotalFee";
                /*第二明细*/
                strDetailSecondFields = "ProductName|ColorName|ProductCount|RequireDate|TotalTax|ProductCount|RequireDate|UnitPrice|TotalPrice|OrderCount|UnitName|TaxPrice|Specification";
            }
        }

        #region 2.主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("采购询价", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, true);
        }
        #endregion

        #region 3.明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("采购询价", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, false);
        }
        #endregion

        /*第二明细*/
        #region 4.明细信息2
        //if (!string.IsNullOrEmpty(strDetailSecondFields))
        //{
        //    tableDetail2.InnerHtml = WritePrintPageTable("采购询价", strBaseFields, strDetailSecondFields, aBase, aSecondDetail, dtMRP, PurchaseApplyDetail2, false);
        //}
        #endregion
    }
Exemple #7
0
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_STORAGE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_INRED;

        StorageInRedModel InRedM_ = new StorageInRedModel();

        InRedM_.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        InRedM_.ID        = this.BillID.ToString();

        #region 初始化 取基本信息及明细信息的字段以及对应的标题
        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase;
        string[,] aDetail;
        if (GetIsDisplayPrice() != "none")
        {
            aBase = new string[, ] {
                { "{ExtField1}", "ExtField1" },
                { "{ExtField2}", "ExtField2" },
                { "{ExtField3}", "ExtField3" },
                { "{ExtField4}", "ExtField4" },
                { "{ExtField5}", "ExtField5" },
                { "{ExtField6}", "ExtField6" },
                { "{ExtField7}", "ExtField7" },
                { "{ExtField8}", "ExtField8" },
                { "{ExtField9}", "ExtField9" },
                { "{ExtField10}", "ExtField10" },
                { "入库单编号", "InNo" },
                { "入库单主题", "Title" },
                { "源单类型", "FromType" },
                { "原始入库单", "FromInNo" },
                { "原始入库人", "FromExecutor" },
                { "原始入库时间", "FromEnterDate" },
                { "原始入库部门", "DeptName" },
                { "入库人", "ExecutorName" },
                { "入库时间", "EnterDate" },
                { "入库原因", "ReasonTypeName" },
                { "原始摘要", "FromSummary" },
                { "摘要", "Summary" },
                { "批次", "BatchNo" },
                { "数量合计", "CountTotal" },
                { "金额合计", "A_TotalPrice" },
                { "制单人", "CreatorName" },
                { "制单日期", "CreateDate" },
                { "确认人", "ConfirmorName" },
                { "确认日期", "ConfirmDate" },
                { "结单人", "CloserName" },
                { "结单日期", "CloseDate" },
                { "最后更新人", "ModifiedUserName" },
                { "最后更新日期", "ModifiedDate" },
                { "单据状态", "BillStatus" },
                { "备注", "Remark" },
            };
            if (HiddenMoreUnit.Value == "true")
            {
                aDetail = new string[, ] {
                    { "序号", "SortNo" },
                    { "物品编号", "ProductNo" },
                    { "物品名称", "ProductName" },
                    { "规格", "Specification" },
                    { "基本单位", "UnitID" },
                    { "单位", "UsedUnitName" },             //++
                    { "仓库", "StorageName" },
                    { "原始入库量", "FromBillCount" },
                    { "基本数量", "ProductCount" },
                    { "数量", "UsedUnitCount" },            //++
                    { "红冲单价", "UnitPrice" },
                    { "红冲金额", "B_TotalPrice" },
                };
            }
            else
            {
                aDetail = new string[, ] {
                    { "序号", "SortNo" },
                    { "物品编号", "ProductNo" },
                    { "物品名称", "ProductName" },
                    { "规格", "Specification" },
                    { "单位", "UnitID" },
                    { "仓库", "StorageName" },
                    { "原始入库量", "FromBillCount" },
                    { "红冲数量", "ProductCount" },
                    { "红冲单价", "UnitPrice" },
                    { "红冲金额", "B_TotalPrice" },
                };
            }
        }
        else
        {
            aBase = new string[, ] {
                { "{ExtField1}", "ExtField1" },
                { "{ExtField2}", "ExtField2" },
                { "{ExtField3}", "ExtField3" },
                { "{ExtField4}", "ExtField4" },
                { "{ExtField5}", "ExtField5" },
                { "{ExtField6}", "ExtField6" },
                { "{ExtField7}", "ExtField7" },
                { "{ExtField8}", "ExtField8" },
                { "{ExtField9}", "ExtField9" },
                { "{ExtField10}", "ExtField10" },
                { "入库单编号", "InNo" },
                { "入库单主题", "Title" },
                { "源单类型", "FromType" },
                { "原始入库单", "FromInNo" },
                { "原始入库人", "FromExecutor" },
                { "原始入库时间", "FromEnterDate" },
                { "原始入库部门", "DeptName" },
                { "入库人", "ExecutorName" },
                { "入库时间", "EnterDate" },
                { "入库原因", "ReasonTypeName" },
                { "原始摘要", "FromSummary" },
                { "摘要", "Summary" },
                { "批次", "BatchNo" },
                { "数量合计", "CountTotal" },
                { "制单人", "CreatorName" },
                { "制单日期", "CreateDate" },
                { "确认人", "ConfirmorName" },
                { "确认日期", "ConfirmDate" },
                { "结单人", "CloserName" },
                { "结单日期", "CloseDate" },
                { "最后更新人", "ModifiedUserName" },
                { "最后更新日期", "ModifiedDate" },
                { "单据状态", "BillStatus" },
                { "备注", "Remark" },
            };
            if (HiddenMoreUnit.Value == "true")
            {
                aDetail = new string[, ] {
                    { "序号", "SortNo" },
                    { "物品编号", "ProductNo" },
                    { "物品名称", "ProductName" },
                    { "规格", "Specification" },
                    { "基本单位", "UnitID" },
                    { "单位", "UsedUnitName" },             //++
                    { "仓库", "StorageName" },
                    { "原始入库量", "FromBillCount" },
                    { "基本数量", "ProductCount" },
                    { "数量", "UsedUnitCount" },            //++
                };
            }
            else
            {
                aDetail = new string[, ] {
                    { "序号", "SortNo" },
                    { "物品编号", "ProductNo" },
                    { "物品名称", "ProductName" },
                    { "规格", "Specification" },
                    { "单位", "UnitID" },
                    { "仓库", "StorageName" },
                    { "原始入库量", "FromBillCount" },
                    { "红冲数量", "ProductCount" },
                };
            }
        }
        #endregion


        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = XBase.Business.Office.SupplyChain.TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.StorageInRed");
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 15; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion

        #region 2.所设的打印模板设置

        DataTable dbPrint         = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtDetail        = StorageInRedBus.GetStorageInRedDetailInfo(InRedM_.ID, InRedM_.CompanyCD);
        DataTable dtMain          = StorageInRedBus.GetStorageInRedInfo(InRedM_.ID, InRedM_.CompanyCD);
        string    strBaseFields   = "";
        string    strDetailFields = "";

        if (dbPrint.Rows.Count > 0)
        {
            #region 设置过打印模板设置时 直接取出表里设置的值
            isSeted.Value   = "1";
            strBaseFields   = dbPrint.Rows[0]["BaseFields"].ToString();
            strDetailFields = dbPrint.Rows[0]["DetailFields"].ToString();
            #endregion
        }
        else
        {
            #region 未设置过打印模板设置 默认显示所有的
            isSeted.Value = "0";

            /*未设置过打印模板设置时,默认显示的字段  基本信息字段*/
            for (int m = 10; m < aBase.Length / 2; m++)
            {
                strBaseFields = strBaseFields + aBase[m, 1] + "|";
            }
            /*未设置过打印模板设置时,默认显示的字段 基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields = strBaseFields + "ExtField" + (i + 1) + "|";
                }
            }
            /*未设置过打印模板设置时,默认显示的字段 明细信息字段*/
            for (int n = 0; n < aDetail.Length / 2; n++)
            {
                strDetailFields = strDetailFields + aDetail[n, 1] + "|";
            }
            #endregion

            /*两种都可以*/
        }
        #endregion

        #region 3.输出主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("红冲入库单", strBaseFields.TrimEnd('|'), strDetailFields.TrimEnd('|'), aBase, aDetail, dtMain, dtDetail, true);
        }
        #endregion

        #region 4.输出明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("红冲入库单", strBaseFields.TrimEnd('|'), strDetailFields.TrimEnd('|'), aBase, aDetail, dtMain, dtDetail, false);
        }
        #endregion
    }
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_STORAGE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_ADJUST;

        StorageInitailModel OutSellM_ = new StorageInitailModel();

        OutSellM_.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        OutSellM_.ID        = this.intMrpID.ToString();

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aDetail;
        string[,] aBase =
        {
            { "{ExtField1}",  "ExtField1"      },
            { "{ExtField2}",  "ExtField2"      },
            { "{ExtField3}",  "ExtField3"      },
            { "{ExtField4}",  "ExtField4"      },
            { "{ExtField5}",  "ExtField5"      },
            { "{ExtField6}",  "ExtField6"      },
            { "{ExtField7}",  "ExtField7"      },
            { "{ExtField8}",  "ExtField8"      },
            { "{ExtField9}",  "ExtField9"      },
            { "{ExtField10}", "ExtField10"     },
            { "单据编号",         "AdjustNo"       },
            { "单据标题",         "Title"          },
            { "经办人",          "Executor"       },
            { "调整部门",         "DeptID"         },
            { "调整仓库",         "StorageID"      },
            { "调整原因",         "ReasonType"     },
            { "调整日期 ",        "AdjustDate"     },

            { "摘要",           "Summary"        },
            { "调整数量合计 ",      "CountTotal"     },

            { "调整金额合计 ",      "TotalPrice"     },


            { "制单人",          "Creator"        },

            { "制单日期",         "CreateDate"     },
            { "单据状态",         "BillStatus"     },
            { "确认人",          "Confirmor"      },
            { "确认日期",         "ConfirmDate"    },
            { "结单人",          "Closer"         },
            { "结单日期",         "CloseDate"      },
            { "最后更新人",        "ModifiedUserID" },
            { "最后更新日期",       "ModifiedDate"   },
            { "备注",           "Remark"         },
        };
        if (HiddenMoreUnit.Value == "True")
        {
            aDetail = new string[, ] {
                { "物品编号", "ID" },
                { "物品名称", "ProductID" },
                { "批次", "BatchNo" },
                { "单位", "UsedUnitName" },
                { "基本单位", "UnitID" },
                { "基本数量", "AdjustCount" },
                { "调整类型", "AdjustType" },
                { "调整数量 ", "UsedUnitCount" },
                { "成本单价 ", "UsedPrice" },
                { "调整金额 ", "CostPriceTotal" },
                { "备注 ", "Remark" },
            };
        }
        else
        {
            aDetail = new string[, ] {
                { "物品编号", "ID" },
                { "物品名称", "ProductID" },
                { "批次", "BatchNo" },
                { "单位", "UnitID" },
                { "调整类型", "AdjustType" },
                { "调整数量 ", "AdjustCount" },
                { "成本单价 ", "CostPrice" },
                { "调整金额 ", "CostPriceTotal" },
                { "备注 ", "Remark" },
            };
        }



        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = XBase.Business.Office.SupplyChain.TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.StorageAdjust");
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 15; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion
        DataTable dbPrint         = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMRP           = XBase.Business.Office.StorageManager.StorageAdjustBus.GetAdjustInfo(intMrpID);
        DataTable dtDetail        = XBase.Business.Office.StorageManager.StorageAdjustBus.GetAdjustDetailInfo(intMrpID);
        string    strBaseFields   = "";
        string    strDetailFields = "";


        if (dbPrint.Rows.Count > 0)
        {
            #region 设置过打印模板设置时 直接取出表里设置的值
            isSeted.Value   = "1";
            strBaseFields   = dbPrint.Rows[0]["BaseFields"].ToString();
            strDetailFields = dbPrint.Rows[0]["DetailFields"].ToString();
            #endregion
        }
        else
        {
            #region 未设置过打印模板设置 默认显示所有的
            isSeted.Value = "0";

            /*未设置过打印模板设置时,默认显示的字段  基本信息字段*/
            for (int m = 10; m < aBase.Length / 2; m++)
            {
                strBaseFields = strBaseFields + aBase[m, 1] + "|";
            }
            /*未设置过打印模板设置时,默认显示的字段 基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields = strBaseFields + "ExtField" + (i + 1) + "|";
                }
            }
            /*未设置过打印模板设置时,默认显示的字段 明细信息字段*/
            for (int n = 0; n < aDetail.Length / 2; n++)
            {
                strDetailFields = strDetailFields + aDetail[n, 1] + "|";
            }
            #endregion
        }

        #region 2.主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("日常调整单", strBaseFields.TrimEnd('|'), strDetailFields.TrimEnd('|'), aBase, aDetail, dtMRP, dtDetail, true);
        }
        #endregion

        #region 3.明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("日常调整单", strBaseFields.TrimEnd('|'), strDetailFields.TrimEnd('|'), aBase, aDetail, dtMRP, dtDetail, false);
        }
        #endregion
    }
        /// <summary>
        /// 打印模板参数设置编辑
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool EditPrintParameterSetting(PrintParameterSettingModel model)
        {
            ArrayList listADD = new ArrayList();

            if (CountPrintSets(model) > 0)
            {
                #region  打印参数设置修改SQL语句
                StringBuilder sqlEdit = new StringBuilder();
                sqlEdit.AppendLine("UPDATE officedba.PrintParameterSetting");
                sqlEdit.AppendLine("   SET BaseFields = @BaseFields");
                sqlEdit.AppendLine("      ,DetailFields = @DetailFields");
                sqlEdit.AppendLine("      ,DetailSecondFields = @DetailSecondFields");
                sqlEdit.AppendLine("      ,DetailThreeFields = @DetailThreeFields");
                sqlEdit.AppendLine("      ,DetailFourFields = @DetailFourFields");
                sqlEdit.AppendLine(" WHERE BillTypeFlag=@BillTypeFlag and PrintTypeFlag=@PrintTypeFlag and CompanyCD=@CompanyCD");


                SqlCommand comm = new SqlCommand();
                comm.CommandText = sqlEdit.ToString();
                comm.Parameters.Add(SqlHelper.GetParameter("@BillTypeFlag", model.BillTypeFlag.ToString()));
                comm.Parameters.Add(SqlHelper.GetParameter("@PrintTypeFlag", model.PrintTypeFlag.ToString()));
                comm.Parameters.Add(SqlHelper.GetParameter("@BaseFields", model.BaseFields));
                comm.Parameters.Add(SqlHelper.GetParameter("@DetailFields", model.DetailFields));
                comm.Parameters.Add(SqlHelper.GetParameter("@DetailSecondFields", model.DetailSecondFields));
                comm.Parameters.Add(SqlHelper.GetParameter("@DetailThreeFields", model.DetailThreeFields));
                comm.Parameters.Add(SqlHelper.GetParameter("@DetailFourFields", model.DetailFourFields));
                comm.Parameters.Add(SqlHelper.GetParameter("@CompanyCD", model.CompanyCD));

                listADD.Add(comm);
                #endregion
            }
            else
            {
                #region 打印参数设置添加SQL语句
                StringBuilder sqlPrint = new StringBuilder();
                sqlPrint.AppendLine("INSERT INTO officedba.PrintParameterSetting");
                sqlPrint.AppendLine("           (CompanyCD");
                sqlPrint.AppendLine("           ,BillTypeFlag");
                sqlPrint.AppendLine("           ,PrintTypeFlag");
                sqlPrint.AppendLine("           ,BaseFields");
                sqlPrint.AppendLine("           ,DetailFields");
                sqlPrint.AppendLine("           ,DetailSecondFields");
                sqlPrint.AppendLine("           ,DetailThreeFields");
                sqlPrint.AppendLine("           ,DetailFourFields");
                sqlPrint.AppendLine("           ,ModifiedDate)");
                sqlPrint.AppendLine("     VALUES");
                sqlPrint.AppendLine("           (@CompanyCD");
                sqlPrint.AppendLine("           ,@BillTypeFlag");
                sqlPrint.AppendLine("           ,@PrintTypeFlag");
                sqlPrint.AppendLine("           ,@BaseFields");
                sqlPrint.AppendLine("           ,@DetailFields");
                sqlPrint.AppendLine("           ,@DetailSecondFields");
                sqlPrint.AppendLine("           ,@DetailThreeFields");
                sqlPrint.AppendLine("           ,@DetailFourFields");
                sqlPrint.AppendLine("           ,getdate())");

                SqlCommand comm = new SqlCommand();
                comm.CommandText = sqlPrint.ToString();
                comm.Parameters.Add(SqlHelper.GetParameter("@CompanyCD", model.CompanyCD));
                comm.Parameters.Add(SqlHelper.GetParameter("@BillTypeFlag", model.BillTypeFlag.ToString()));
                comm.Parameters.Add(SqlHelper.GetParameter("@PrintTypeFlag", model.PrintTypeFlag.ToString()));
                comm.Parameters.Add(SqlHelper.GetParameter("@BaseFields", model.BaseFields));
                comm.Parameters.Add(SqlHelper.GetParameter("@DetailFields", model.DetailFields));
                comm.Parameters.Add(SqlHelper.GetParameter("@DetailSecondFields", model.DetailSecondFields));
                comm.Parameters.Add(SqlHelper.GetParameter("@DetailThreeFields", model.DetailThreeFields));
                comm.Parameters.Add(SqlHelper.GetParameter("@DetailFourFields", model.DetailFourFields));
                listADD.Add(comm);
                #endregion
            }

            try
            {
                return(SqlHelper.ExecuteTransWithArrayList(listADD));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;//UserInfo.CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_SALE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_SELLGATHERING;

        //    /*接受参数*/
        string GatheringNo = Request.QueryString["no"].ToString();

        #region 基本信息 明细信息
        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase = { { "{ExtField1}",  "ExtField1"      },
                            { "{ExtField2}",  "ExtField2"      },
                            { "{ExtField3}",  "ExtField3"      },
                            { "{ExtField4}",  "ExtField4"      },
                            { "{ExtField5}",  "ExtField5"      },
                            { "{ExtField6}",  "ExtField6"      },
                            { "{ExtField7}",  "ExtField7"      },
                            { "{ExtField8}",  "ExtField8"      },
                            { "{ExtField9}",  "ExtField9"      },
                            { "{ExtField10}", "ExtField10"     },
                            { "回款计划编号",       "GatheringNo"    },
                            { "主题",           "Title"          },
                            { "源单类型",         "fromTypeName"   },
                            { "源单编号",         "BillNo"         },
                            { "客户名称",         "CustName"       },
                            { "客户类型",         "TypeName"       },
                            { "客户电话",         "Tel"            },
                            { "币种",           "CurrencyName"   },
                            { "业务员",          "SellerName"     },
                            { "部门",           "DeptName"       },
                            { "计划回款金额",       "PlanPrice"      },
                            { "计划回款时间",       "PlanGatherDate" },
                            { "实际回款金额",       "FactPrice"      },
                            { "实际回款时间",       "FactGatherDate" },
                            { "回款相关单号",       "LinkBillNo"     },
                            { "期次",           "GatheringTime"  },
                            { "状态",           "stateName"      },
                            { "制单人",          "CreatorName"    },
                            { "制单日期",         "CreateDate"     },
                            { "最后更新人",        "ModifiedUserID" },
                            { "最后更新日期",       "ModifiedDate"   },
                            { "备注",           "Remark"         }, };

        #endregion

        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.SellGathering");
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 22; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion

        DataTable dbPrint       = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMain        = SellGatheringBus.GetRepOrder(GatheringNo);
        string    strBaseFields = "";

        if (dbPrint.Rows.Count > 0)
        {
            isSeted.Value = "1";
            strBaseFields = dbPrint.Rows[0]["BaseFields"].ToString();
        }
        else
        {
            isSeted.Value = "0";
            strBaseFields = "GatheringNo|Title|fromTypeName|BillNo|CustName|TypeName|Tel|CurrencyName|SellerName|DeptName|PlanPrice|PlanGatherDate|FactPrice|";
            strBaseFields = strBaseFields + "FactGatherDate|LinkBillNo|GatheringTime|stateName|CreatorName|CreateDate|ModifiedUserID|ModifiedDate|Remark";
            /*基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields = strBaseFields + "|" + "ExtField" + (i + 1);
                }
            }
        }

        #region 2.主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            //第一个是打印页面的正标题,strBaseFields是在PrintParameterSetting表里设置的主表字段,
            //strDetailFields是在PrintParameterSetting表里设置的明细表的字段,
            //aBase,是打印设置页面上定义取出来的字段及对应的名称,
            //aDetail是打印设置页面上定义取出来的字段及对应的名称,
            //例如明细中的物品编号,对应的就是物品编号及取数据的字段ProdNo,
            //dtMRP是主表的数据集,
            //dtDetail是明细表的数据集,最后一个参数,用来区别是主表信息还是明细信息..
            tableBase.InnerHtml = WritePrintPageTable("销售回款计划", strBaseFields, "", aBase, null, dtMain, null, true);
        }
        #endregion
    }
Exemple #11
0
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel pModel = new PrintParameterSettingModel();

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


        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "{ExtField1}",  "ExtField1"      },
            { "{ExtField2}",  "ExtField2"      },
            { "{ExtField3}",  "ExtField3"      },
            { "{ExtField4}",  "ExtField4"      },
            { "{ExtField5}",  "ExtField5"      },
            { "{ExtField6}",  "ExtField6"      },
            { "{ExtField7}",  "ExtField7"      },
            { "{ExtField8}",  "ExtField8"      },
            { "{ExtField9}",  "ExtField9"      },
            { "{ExtField10}", "ExtField10"     },
            { "入库单编号",        "InNo"           },
            { "入库单主题",        "Title"          },
            { "分店名称",         "DeptName"       },
            { "制单人",          "CreatorName"    },
            { "制单日期",         "CreateDate"     },
            { "单据状态",         "BillStatusName" },
            { "确认人",          "ConfirmorName"  },
            { "确认日期",         "ConfirmDate"    },
            { "最后更新人",        "ModifiedUserID" },
            { "最后更新日期",       "ModifiedDate"   },
            { "备注",           "Remark"         },
        };

        string[,] aDetail =
        {
            { "序号",   "SortNo"      },
            { "物品编号", "ProductNo"   },
            { "物品名称", "ProductName" },
            { "批次",   "BatchNo"     },
            { "规格",   "standard"    },
            { "单位",   "UnitName"    },
            { "入库数量", "SendCount"   }
        };
        if (_isMoreUnit)
        {// 启用多计量单位
            aDetail = new string[, ]
            {
                { "序号", "SortNo" },
                { "物品编号", "ProductNo" },
                { "物品名称", "ProductName" },
                { "批次", "BatchNo" },
                { "规格", "standard" },
                { "基本单位", "UnitName" },
                { "基本数量", "SendCount" },
                { "单位", "UsedUnitName" },
                { "入库数量", "UsedUnitCount" }
            };
        }

        #region 扩展属性
        DataTable dtExtTable = TableExtFieldsBus.GetAllList(UserInfo.CompanyCD, "", "officedba.SubStorageIn");
        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       = SubStorageBus.SubStorageIn(intID);
        string    deptID   = UserInfo.DeptID.ToString();
        DataRow   dtDeptID = SubStorageDBHelper.GetSubDeptFromDeptID(UserInfo.DeptID.ToString());
        if (dtDeptID != null)
        {
            deptID = dtDeptID["ID"].ToString();
        }
        DataTable dtDetail = SubStorageBus.Details(intID, deptID);
        dtDetail.Columns.Add("SortNo", typeof(string));
        for (int i = 0; i < dtDetail.Rows.Count; i++)
        {
            dtDetail.Rows[i]["SortNo"] = i + 1;
        }
        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
    }
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_PURCHASE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_PROVIDERCONTACTHISTORY;

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "联络单编号",  "ContactNo"      },
            { "供应商名称",  "CustName"       },
            { "主题",     "Title"          },
            { "供应商联络人", "LinkManName"    },
            { "联络事由",   "LinkReasonName" },
            { "联络方式",   "LinkModeName"   },
            { "联络时间",   "LinkDate"       },
            { "我方联络人",  "LinkerName"     },
            { "联络内容",   "Contents"       },
        };
        DataTable dbPrint = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);

        DataTable dtProviderInfo = ProviderContactHistoryBus.SelectProviderContactHistory(this.intMrpID);

        string strBaseFields   = "";
        string strDetailFields = "";
        /*第二明细*/
        string strDetailSecondFields = "";

        if (dbPrint.Rows.Count > 0)
        {
            isSeted.Value   = "1";
            strBaseFields   = dbPrint.Rows[0]["BaseFields"].ToString();
            strDetailFields = dbPrint.Rows[0]["DetailFields"].ToString();
            /*第二明细*/
            strDetailSecondFields = dbPrint.Rows[0]["DetailSecondFields"].ToString();
        }
        else
        {
            isSeted.Value = "0";
            strBaseFields = "ContactNo|CustName|Title|LinkManName|LinkReasonName|LinkModeName|LinkDate|LinkerName|Contents";
        }

        #region 2.主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("供应商联络", strBaseFields, null, aBase, null, dtProviderInfo, null, true);
        }
        #endregion

        //#region 3.明细信息
        //if (!string.IsNullOrEmpty(strDetailFields))
        //{
        //    tableDetail.InnerHtml = WritePrintPageTable("物料需求计划", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, false);
        //}
        //#endregion

        ///*第二明细*/
        //#region 4.明细信息2
        //if (!string.IsNullOrEmpty(strDetailSecondFields))
        //{
        //    tableDetail2.InnerHtml = WritePrintPageTable("物料需求计划", strBaseFields, strDetailSecondFields, aBase, aSecondDetail, dtMRP, dtDetail, false);
        //}
        //#endregion
    }
Exemple #13
0
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_STORAGE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_Init;

        StorageInitailModel OutSellM_ = new StorageInitailModel();

        OutSellM_.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        OutSellM_.ID        = this.intMrpID.ToString();

        string[,] aDetail;

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "{ExtField1}",  "ExtField1"        },
            { "{ExtField2}",  "ExtField2"        },
            { "{ExtField3}",  "ExtField3"        },
            { "{ExtField4}",  "ExtField4"        },
            { "{ExtField5}",  "ExtField5"        },
            { "{ExtField6}",  "ExtField6"        },
            { "{ExtField7}",  "ExtField7"        },
            { "{ExtField8}",  "ExtField8"        },
            { "{ExtField9}",  "ExtField9"        },
            { "{ExtField10}", "ExtField10"       },
            { "入库单编号",        "InNo"             },
            { "入库单主题 ",       "Title"            },
            { "仓库",           "StorageName"      },
            { "入库部门 ",        "DeptName"         },
            { "入库人",          "ExecutorName"     },
            { "入库时间",         "EnterDate"        },
            { "摘要 ",          "Summary"          },
            { "批次",           "BatchNo"          },
            { "入库数量合计 ",      "CountTotal"       },
            { "入库金额合计 ",      "A_TotalPrice"     },

            { "制单人",          "CreatorName"      },

            { "制单日期",         "CreateDate"       },
            { "单据状态",         "BillStatusName"   },
            { "确认人",          "ConfirmorName"    },
            { "确认日期",         "ConfirmDate"      },
            { "结单人",          "CloserName"       },
            { "结单日期",         "CloseDate"        },
            { "最后更新人",        "ModifiedUserName" },
            { "最后更新日期",       "ModifiedDate"     },
            { "备注",           "Remark"           },
        };
        if (HiddenMoreUnit.Value == "true")
        {
            aDetail = new string[, ]  {
                { "序号", "SortNo" },
                { "物品编号", "ProductNo" },
                { "物品名称", "ProductName" },
                { "规格", "Specification" },
                { "基本单位", "UnitID" },
                { "基本数量", "ProductCount" },
                { "单位", "UsedUnitName" },                 //++
                { "数量", "UsedUnitCount" },                //++
                { "入库单价 ", "UnitPrice" },
                { "入库金额 ", "B_TotalPrice" },
                { "备注", "DetaiRemark" },
            };
        }
        else
        {
            aDetail = new string[, ]  {
                { "序号", "SortNo" },
                { "物品编号", "ProductNo" },
                { "物品名称", "ProductName" },
                { "规格", "Specification" },
                { "单位", "UnitID" },
                { "数量", "ProductCount" },
                { "入库单价 ", "UnitPrice" },
                { "入库金额 ", "B_TotalPrice" },
                { "备注", "DetaiRemark" },
            };
        }



        #region 1.扩展属性
        DataTable dtExtTable = XBase.Business.Office.SupplyChain.TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.StorageInitail");
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 15; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                    }
                }
            }
        }
        #endregion
        DataTable dbPrint = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMain  = StorageInitailBus.GetStorageInitailDetailInfo(OutSellM_);
        // DataTable dtDetail = MRPBus.GetMRPDetailInfo(modelMRP);
        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 = "InNo|Title|StorageName|DeptName|ExecutorName|EnterDate|Summary|BatchNo|CountTotal|A_TotalPrice"
                            + "|CreatorName|CreateDate|BillStatusName|ConfirmorName|ConfirmDate|CloserName|CloseDate"
                            + "|ModifiedUserName|ModifiedDate|Remark"
                            + "|ExtField1|ExtField2|ExtField3|ExtField4|ExtField5|ExtField6|ExtField7|ExtField8|ExtField9|ExtField10";
            if (HiddenMoreUnit.Value == "True")
            {
                strDetailFields = "SortNo|ProductNo|ProductName|Specification|UnitID|ProductCount|UsedUnitName|UsedUnitCount|UnitPrice|B_TotalPrice|DetaiRemark";
            }
            else
            {
                strDetailFields = "SortNo|ProductNo|ProductName|Specification|UnitID|ProductCount|UnitPrice|B_TotalPrice|DetaiRemark";
            }
        }

        #region 主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("期初库存录入单", strBaseFields.TrimEnd('|'), strDetailFields.TrimEnd('|'), aBase, aDetail, dtMain, dtMain, true);
        }
        #endregion

        #region 明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("期初库存录入单", strBaseFields.TrimEnd('|'), strDetailFields.TrimEnd('|'), aBase, aDetail, dtMain, dtMain, false);
        }
        #endregion
    }
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_SALE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_SELLPLAN;

        SellPlanModel modelMRP = new SellPlanModel();

        modelMRP.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        modelMRP.ID        = this.intMrpID;

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "{ExtField1}",  "ExtField1"       },
            { "{ExtField2}",  "ExtField2"       },
            { "{ExtField3}",  "ExtField3"       },
            { "{ExtField4}",  "ExtField4"       },
            { "{ExtField5}",  "ExtField5"       },
            { "{ExtField6}",  "ExtField6"       },
            { "{ExtField7}",  "ExtField7"       },
            { "{ExtField8}",  "ExtField8"       },
            { "{ExtField9}",  "ExtField9"       },
            { "{ExtField10}", "ExtField10"      },

            { "计划编号",         "PlanNo"          },
            { "计划名称",         "Title"           },
            { "计划类型",         "PlanType"        },

            { "计划时期",         "PlanTime"        },
            { "开始时间",         "StartDate"       },
            { "结束时间",         "EndDate"         },

            { "最低计划额(元)",     "MinPlanTotal"    },
            { "计划总金额(元)",     "PlanTotal"       },

            { "激励方案",         "Hortation"       },

            { "可查看人员",        "CanViewUserName" },

            { "单据状态",         "BillStatus"      },
            { "制单人",          "Creator"         },
            { "制单日期 ",        "CreateDate"      },

            { "确认人",          "Confirmor"       },
            { "确认日期",         "ConfirmDate"     },
            { "结单人",          "Closer"          },

            { "结单日期",         "CloseDate"       },
            { "最后更新人",        "ModifiedUserID"  },
            { "最后更新日期",       "ModifiedDate"    },

            { "备注",           "Remark"          },
        };

        string[,] aDetail =
        {
            { "部门/物品/人员", "DetailTypeName"  },
            { "名称",       "DetailName"      },
            { "最低目标额(元)", "MinDetailotal"   },
            { "目标额(元)",   "DetailTotal"     },
            { " 完成情况",    "AddOrCutText2"   },
            { "目标达成率",    "CompletePercent" },
        };

        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.SellPlan");
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 15; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion


        DataTable dbPrint         = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMRP           = SellPlanBus.GetRepOrder(PlanNo);    //主表 MRPBus.GetMRPInfo(modelMRP);
        DataTable dtDetail        = SellPlanBus.GetOrderDetail(PlanNo); //明细表 MRPBus.GetMRPDetailInfo(modelMRP);
        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 = "PlanNo|Title|PlanType|PlanTime|StartDate|EndDate|MinPlanTotal|PlanTotal|Hortation|CanViewUserName|BillStatus|Creator|CreateDate|Confirmor|ConfirmDate|Closer|CloseDate|ModifiedUserID|ModifiedDate|Remark";
            /*基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields = strBaseFields + "|" + "ExtField" + (i + 1);
                }
            }

            strDetailFields = "DetailTypeName|DetailName|MinDetailotal|DetailTotal|AddOrCutText2|CompletePercent";
        }

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

        #region 明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("销售计划", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, false);
        }
        #endregion
    }
Exemple #15
0
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;//UserInfo.CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_SALE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_SELLBACK;

        //    /*接受参数*/
        string BackNo = Request.QueryString["no"].ToString();

        #region 基本信息 明细信息
        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase = { { "{ExtField1}",  "ExtField1"      },
                            { "{ExtField2}",  "ExtField2"      },
                            { "{ExtField3}",  "ExtField3"      },
                            { "{ExtField4}",  "ExtField4"      },
                            { "{ExtField5}",  "ExtField5"      },
                            { "{ExtField6}",  "ExtField6"      },
                            { "{ExtField7}",  "ExtField7"      },
                            { "{ExtField8}",  "ExtField8"      },
                            { "{ExtField9}",  "ExtField9"      },
                            { "{ExtField10}", "ExtField10"     },
                            { "单据编号",         "BackNo"         },
                            { "主题",           "Title"          },
                            { "源单类型",         "FromTypeText"   },
                            { "源单编号",         "SendNo"         },
                            { "客户名称",         "CustName"       },
                            { "客户电话",         "CustTel"        },
                            { "业务类型",         "BusiTypeName"   },
                            { "结算方式",         "PayTypeName"    },
                            { "支付方式",         "MoneyTypeName"  },
                            { "运送方式",         "CarryTypeName"  },
                            { "币种",           "CurrencyName"   },
                            { "汇率",           "Rate"           },
                            { "业务员",          "SellerName"     },
                            { "部门",           "DeptName"       },
                            { "发货地址",         "SendAddress"    },
                            { "收货地址",         "ReceiveAddress" },
                            { "退货日期",         "BackDate"       },
                            { "是否增值税",        "isAddTaxName"   },
                            { "所属项目",         "ProjectName"    },
                            { "金额合计",         "TotalPrice"     },
                            { "税额合计",         "Tax"            },
                            { "含税金额合计",       "TotalFee"       },
                            { "整单折扣(%)",      "Discount"       },
                            { "折后含税金额",       "RealTotal"      },
                            { "折扣金额",         "DiscountTotal"  },
                            { "退货数量合计",       "CountTotal"     },
                            { "抵应收货款",        "NotPayTotal"    },
                            { "单据状态",         "BillStatusText" },
                            { "制单人",          "CreatorName"    },
                            { "制单日期",         "CreateDate"     },
                            { "确认人",          "ConfirmorName"  },
                            { "确认日期",         "ConfirmDate"    },
                            { "结单人",          "CloserName"     },
                            { "结单日期",         "CloseDate"      },
                            { "最后更新人",        "ModifiedUserID" },
                            { "最后更新日期",       "ModifiedDate"   },
                            { "备注",           "Remark"         },
                            { "建单情况",         "IsOpenbillText" },
                            { "结算状态",         "IsAccText"      },
                            { "已结算金额",        "YAccounts"      },
                            { "入库情况",         "IsSendText"     }, };

        string[,] aDetail;
        //多计量单位
        if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
        {
            aDetail = new string[, ] {
                //{ "序号", "SortNo"},
                { "物品编号", "ProdNo" },
                { "物品名称", "ProductName" },
                { "规格", "Specification" },
                { "颜色", "ColorName" },
                { "基本单位", "UnitName" },
                //{ "交货期限(天)", "SendTime" },
                { "基本数量", "BackNumber" },
                { "单位", "UsedUnitName" },
                { "退货数量", "UsedUnitCount" },
                { "包装要求", "PackageName" },
                { "单价", "UsedPrice" },
                { "含税价", "TaxPrice" },
                { "折扣(%)", "Discount" },
                { "税率(%)", "TaxRate" },
                { "含税金额", "TotalFee" },
                { "金额", "TotalPrice" },
                { "税额", "TotalTax" },
                { "退货原因", "ReasonName" },
                { "备注", "Remark" },
            };
        }
        else
        {
            aDetail = new string[, ] {
                //{ "序号", "SortNo"},
                { "物品编号", "ProdNo" },
                { "物品名称", "ProductName" },
                { "规格", "Specification" },
                { "颜色", "ColorName" },
                { "单位", "UnitName" },
                //{ "交货期限(天)", "SendTime" },
                { "退货数量", "BackNumber" },
                { "包装要求", "PackageName" },
                { "单价", "UnitPrice" },
                { "含税价", "TaxPrice" },
                { "折扣(%)", "Discount" },
                { "税率(%)", "TaxRate" },
                { "含税金额", "TotalFee" },
                { "金额", "TotalPrice" },
                { "税额", "TotalTax" },
                { "退货原因", "ReasonName" },
                { "备注", "Remark" },
            };
        }


        ///*第二明细*/
        //string[,] aSecondDetail = {
        //                        //{ "序号", "SortNo"},
        //                        { "费用类别", "CodeName"},
        //                        { "金额", "FeeTotal" },
        //                        { "备注", "Remark"},
        //                   };
        #endregion

        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.SellBack");
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 40; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion

        DataTable dbPrint  = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMain   = SellBackBus.GetRepOrder(BackNo);       //获取主表数据
        DataTable dtDetail = SellBackBus.GetRepOrderDetail(BackNo); //获取明细表数据:退货明细数据
        //DataTable dtFee = SellOrderBus.GetRepOrderFee(OrderNo);//获取明细表:销售费用明细数据
        string strBaseFields   = "";
        string strDetailFields = "";
        ///*第二明细*/
        //string strDetailSecondFields = "";

        if (dbPrint.Rows.Count > 0)
        {
            isSeted.Value   = "1";
            strBaseFields   = dbPrint.Rows[0]["BaseFields"].ToString();
            strDetailFields = dbPrint.Rows[0]["DetailFields"].ToString();
            ///*第二明细*/
            //strDetailSecondFields = dbPrint.Rows[0]["DetailSecondFields"].ToString();
        }
        else
        {
            isSeted.Value = "0";
            strBaseFields = "BackNo|Title|FromTypeText|SendNo|CustName|CustTel|BusiTypeName|PayTypeName|MoneyTypeName|CarryTypeName|CurrencyName|Rate|";
            strBaseFields = strBaseFields + "SellerName|DeptName|SendAddress|ReceiveAddress|BackDate|isAddTaxName|ProjectName|TotalPrice|Tax|TotalFee|Discount|";
            strBaseFields = strBaseFields + "RealTotal|DiscountTotal|CountTotal|NotPayTotal|BillStatusText|CreatorName|CreateDate|ConfirmorName|ConfirmDate|CloserName|CloseDate|ModifiedUserID|ModifiedDate|Remark|";
            strBaseFields = strBaseFields + "IsOpenbillText|IsAccText|YAccounts|IsSendText";
            /*基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields = strBaseFields + "|" + "ExtField" + (i + 1);
                }
            }
            //多计量单位
            if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
            {
                /*订单明细SortNo|*/
                strDetailFields = "ProdNo|ProductName|Specification|ColorName|UnitName|BackNumber|UsedUnitName|UsedUnitCount|PackageName|UsedPrice|TaxPrice|Discount|TaxRate|TotalFee|TotalPrice|TotalTax|ReasonName|Remark";
            }
            else
            {
                /*订单明细SortNo|*/
                strDetailFields = "ProdNo|ProductName|Specification|ColorName|UnitName|BackNumber|PackageName|UnitPrice|TaxPrice|Discount|TaxRate|TotalFee|TotalPrice|TotalTax|ReasonName|Remark";
            }
        }

        #region 2.主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            //第一个是打印页面的正标题,strBaseFields是在PrintParameterSetting表里设置的主表字段,
            //strDetailFields是在PrintParameterSetting表里设置的明细表的字段,
            //aBase,是打印设置页面上定义取出来的字段及对应的名称,
            //aDetail是打印设置页面上定义取出来的字段及对应的名称,
            //例如明细中的物品编号,对应的就是物品编号及取数据的字段ProdNo,
            //dtMRP是主表的数据集,
            //dtDetail是明细表的数据集,最后一个参数,用来区别是主表信息还是明细信息..
            tableBase.InnerHtml = WritePrintPageTable("销售退货单", strBaseFields, strDetailFields, aBase, aDetail, dtMain, dtDetail, true);
        }
        #endregion

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

        ///*第二明细*/
        //#region 4.明细信息2
        //if (!string.IsNullOrEmpty(strDetailSecondFields))
        //{
        //    tableDetail2.InnerHtml = WritePrintPageTable("销售订单", strBaseFields, strDetailSecondFields, aBase, aSecondDetail, dtMain, dtFee, false);
        //}
        //#endregion
    }
Exemple #16
0
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_SALE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_ADVERSARY;

        AdversaryInfoModel modelMRP = new AdversaryInfoModel();

        modelMRP.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        modelMRP.CustNo    = this.PlanNo;

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        #region 信息的字段
        string[,] aBase =
        {
            { "对手编号",     "CustNo"          },
            { "对手类别",     "CustTypeName"    },
            { "对手细分",     "CustClassName"   },

            { "对手名称",     "CustName"        },
            { "对手简称",     "ShortNam"        },
            { "对手拼音代码",   "PYShort"         },
            { "对手所在区域",   "AreaIDName"      },

            { "成立时间",     "SetupDate"       },
            { "法人代表",     "ArtiPerson"      },
            { "单位性质",     "CompanyTypeName" },

            { "员工总数",     "StaffCount"      },
            { "注册资本(万元)", "SetupMoney"      },
            { "注册地址",     "SetupAddress"    },

            { "公司网址",     "website"         },
            { "资产规模(万元)", "CapitalScale"    },
            { "经营范围",     "SellArea"        },

            { "年销售额(万元)", "SaleroomY"       },
            { "年利润额(万元)", "ProfitY"         },
            { "税务登记号",    "TaxCD"           },

            { "营业执照号",    "BusiNumber"      },
            { "一般纳税人",    "IsTaxName"       },
            { "地址",       "Address"         },

            { "邮编",       "Post"            },
            { "联系人",      "ContactName"     },
            { "电话",       "Tel"             },

            { "手机",       "Mobile"          },
            { "邮件",       "email"           },

            { "对手简介",     "CustNote"        },
            { "主打产品 ",    "Product"         },
            { "竞争产品/方案",  "Project"         },
            { "竞争能力",     "Power"           },
            { "竞争优势",     "Advantage"       },
            { "竞争劣势",     "disadvantage"    },
            { "应对策略",     "Policy"          },
            { "市场占有率(%)", "Market"          },
            { "销售模式",     "SellMode"        },

            { "启用状态",     "UsedStatusName"  },
            { "制单人",      "EmployeeName"    },
            { "制单日期",     "CreatDate"       },
            { "最后更新人",    "ModifiedUserID"  },

            { "最后更新日",    "ModifiedDate"    },
            { "备注",       "Remark"          },
        };

        string[,] aDetail =
        {
            { "对手动态", "Dynamic" },
        };
        #endregion

        DataTable dbPrint         = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMRP           = AdversaryInfoBus.GetRepOrder(PlanNo);       //SellContractBus.GetRepOrder(OfferNo);
        DataTable dtDetail        = AdversaryInfoBus.GetRepOrderDetail(PlanNo); // SellContractBus.GetRepOrderDetail(OfferNo);
        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 = "CustNo|CustTypeName|CustClassName|CustName|ShortNam|PYShort|AreaIDName|SetupDate|ArtiPerson|CompanyTypeName|StaffCount|SetupMoney|" +
                            "SetupAddress|website|CapitalScale|SellArea|SaleroomY|ProfitY|TaxCD|BusiNumber|IsTaxName|Address|Post|ContactName|Tel|Mobile|email|" +
                            "CustNote|Product|Project|Power|Advantage|disadvantage|Policy|Market|SellMode|UsedStatusName|EmployeeName|CreatDate|ModifiedUserID|" +
                            "ModifiedDate|Remark";

            strDetailFields = "Dynamic";
        }

        #region 主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("竞争对手档案", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, true);
        }
        #endregion

        #region 明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("对手动态信息", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, false);
        }
        #endregion
    }
Exemple #17
0
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_CUSTOMER);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_CUSTINFOLINK;

        CustInfoModel modelMRP = new CustInfoModel();

        modelMRP.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        modelMRP.CustNo    = this.CustNo;

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "{ExtField1}",  "ExtField1"        },
            { "{ExtField2}",  "ExtField2"        },
            { "{ExtField3}",  "ExtField3"        },
            { "{ExtField4}",  "ExtField4"        },
            { "{ExtField5}",  "ExtField5"        },
            { "{ExtField6}",  "ExtField6"        },
            { "{ExtField7}",  "ExtField7"        },
            { "{ExtField8}",  "ExtField8"        },
            { "{ExtField9}",  "ExtField9"        },
            { "{ExtField10}", "ExtField10"       },
            { "{ExtField11}", "ExtField11"       },
            { "{ExtField12}", "ExtField12"       },
            { "{ExtField13}", "ExtField13"       },
            { "{ExtField14}", "ExtField14"       },
            { "{ExtField15}", "ExtField15"       },
            { "{ExtField16}", "ExtField16"       },
            { "{ExtField17}", "ExtField17"       },
            { "{ExtField18}", "ExtField18"       },
            { "{ExtField19}", "ExtField19"       },
            { "{ExtField20}", "ExtField20"       },
            { "{ExtField21}", "ExtField21"       },
            { "{ExtField22}", "ExtField22"       },
            { "{ExtField23}", "ExtField23"       },
            { "{ExtField24}", "ExtField24"       },
            { "{ExtField25}", "ExtField25"       },
            { "{ExtField26}", "ExtField26"       },
            { "{ExtField27}", "ExtField27"       },
            { "{ExtField28}", "ExtField28"       },
            { "{ExtField29}", "ExtField29"       },
            { "{ExtField30}", "ExtField30"       },

            { "客户编号",         "CustNo"           },
            { "客户名称",         "CustName"         },
            { "客户大类",         "BigType"          },

            { "拼音缩写",         "CustShort"        },

            { "客户管理分类",       "CustTypeManage"   },
            { "客户营销分类",       "CustTypeSell"     },
            { "客户优质级别",       "CreditGradeNm"    },

            { "客户时间分类",       "CustTypeTime"     },
            { "客户细分",         "CustClassName"    },
            { "客户类别",         "CustTypaNm"       },

            { "建档人",          "CreatorName"      },
            { "建档日期",         "CreatedDate"      },
            { "客户简介",         "CustNote"         },

            { "国家地区",         "CountryName"      },
            { "区域",           "AreaName"         },

            { "业务类型",         "BusiType"         },
            { "分管业务员 ",       "ManagerName"      },

            { "联络期限(天)",      "LinkCycleNm"      },
            { "收货地址",         "ReceiveAddress"   },

            { "允许延期付款",       "CreditManage"     },

            { "帐期天数(天)",      "MaxCreditDate"    },
            { "结算方式",         "PayTypeNm"        },

            { "关系等级",         "RelaGrade"        },
            { "启用状态",         "UsedStatus"       },

            { "最后更新用户",       "ModifiedUserID"   },
            { "最后更新日期",       "ModifiedDate"     },

            { "可查看该客户档案的人员",  "CanViewUserName"  },
            { "卡号",           "CustNum"          },
            { "性别",           "Sex"              },
            { "联系人类型",        "LinkTypeName"     },
            { "身份证号",         "PaperNum"         },
            { "生日",           "Birthday"         },
            { "电话",           "WorkTel"          },
            { "手机",           "Handset"          },
            { "传真",           "Fax"              },
            { "职务",           "Position"         },
            { "年龄",           "Age"              },
            { "邮编",           "Post"             },
            { "Eamil",        "MailAddress"      },
            { "籍贯",           "HomeTown"         },
            { "民族",           "NationalName"     },
            { "所受教育",         "CultureLevelName" },
            { "所学专业",         "ProfessionalName" },
            { "年收入情况",        "IncomeYear"       },
            { "饮食偏好",         "FuoodDrink"       },
            { "喜欢的音乐",        "LoveMusic"        },
            { "喜欢的颜色",        "LoveColor"        },
            { "喜欢的香烟",        "LoveSmoke"        },
            { "爱喝的酒",         "LoveDrink"        },
            { "爱喝的茶",         "LoveTea"          },
            { "喜欢的书籍",        "LoveBook"         },
            { "喜欢的运动",        "LoveSport"        },
            { "喜欢的品牌服饰",      "LoveClothes"      },
            { "喜欢的品牌化妆品",     "Cosmetic"         },
            { "性格描述",         "Nature"           },
            { "外表描述",         "Appearance"       },
            { "健康状况",         "AdoutBody"        },
            { "家人情况",         "AboutFamily"      },
            { "开什么车",         "Car"              },
        };

        string[,] aDetail = { { "", "" } };

        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = XBase.Business.Office.SupplyChain.TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.CustInfo");
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 59; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion

        DataTable dbPrint = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        //DataTable dtMRP = SellContractBus.GetRepOrder(OfferNo);
        DataTable dtMRP = CustInfoBus.GetCustInfoByNo(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, CustBig, CustNo);

        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 = "CustNo|CustName|BigType|CustShort|CustTypeManage|CustTypeSell|CreditGradeNm|CustTypeTime|CustClassName|CustTypaNm|CreatorName|" +
                            "CreatedDate|CustNote|CountryName|AreaName|BusiType|ManagerName|LinkCycleNm|ReceiveAddress|CreditManage|MaxCreditDate|PayTypeNm|RelaGrade|" +
                            "UsedStatus|ModifiedUserID|ModifiedDate|CanViewUserName|CustNum|Sex|LinkTypeName|PaperNum|Birthday|WorkTel|Handset|Fax|Position|Age|Post|" +
                            "MailAddress|HomeTown|NationalName|CultureLevelName|ProfessionalName|IncomeYear|FuoodDrink|LoveMusic|LoveColor|LoveSmoke|LoveDrink|LoveTea|" +
                            "LoveBook|LoveSport|LoveClothes|Cosmetic|Nature|Appearance|AdoutBody|AboutFamily|Car";

            /*基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields = strBaseFields + "|" + "ExtField" + (i + 1);
                }
            }

            strDetailFields = "";
        }

        #region 主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("客户档案", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, null, true);
        }
        #endregion
    }
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;//UserInfo.CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_SALE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_SELLCHANNELSTTL;

        //    /*接受参数*/
        string SttlNo = Request.QueryString["no"].ToString();

        #region 基本信息 明细信息
        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase = { { "{ExtField1}",  "ExtField1"        },
                            { "{ExtField2}",  "ExtField2"        },
                            { "{ExtField3}",  "ExtField3"        },
                            { "{ExtField4}",  "ExtField4"        },
                            { "{ExtField5}",  "ExtField5"        },
                            { "{ExtField6}",  "ExtField6"        },
                            { "{ExtField7}",  "ExtField7"        },
                            { "{ExtField8}",  "ExtField8"        },
                            { "{ExtField9}",  "ExtField9"        },
                            { "{ExtField10}", "ExtField10"       },
                            { "单据编号",         "SttlNo"           },
                            { "主题",           "Title"            },
                            { "源单类型",         "FromTypeText"     },
                            { "源单编号",         "SendNo"           },
                            { "客户名称",         "CustName"         },
                            { "客户电话",         "Tel"              },
                            { "结算方式",         "PayTypeName"      },
                            { "支付方式",         "MoneyTypeName"    },
                            { "币种",           "CurrencyName"     },
                            { "汇率",           "Rate"             },
                            { "业务员",          "SellerName"       },
                            { "部门",           "DeptName"         },
                            { "结算日期",         "SttlDate"         },
                            { "代销金额",         "TotalFee"         },
                            { "代销提成率(%)",     "PushMoneyPercent" },
                            { "代销提成额",        "PushMoney"        },
                            { "手续费合计",        "HandFeeTotal"     },
                            { "应结算金额合计",      "SttlTotal"        },
                            { "代销数量合计",       "CountTotal"       },
                            { "单据状态",         "BillStatusText"   },
                            { "制单人",          "CreatorName"      },
                            { "制单日期",         "CreateDate"       },
                            { "确认人",          "ConfirmorName"    },
                            { "确认日期",         "ConfirmDate"      },
                            { "结单人",          "CloserName"       },
                            { "结单日期",         "CloseDate"        },
                            { "最后更新人",        "ModifiedUserID"   },
                            { "最后更新日期",       "ModifiedDate"     },
                            { "建单情况",         "IsOpenbillText"   },
                            { "回款状态",         "IsAccText"        },
                            { "已回款金额",        "YAccounts"        }, };

        string[,] aDetail;
        //多计量单位
        if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
        {
            aDetail = new string[, ] {
                //{ "序号", "SortNo"},
                { "物品编号", "ProdNo" },
                { "物品名称", "ProductName" },
                { "规格", "Specification" },
                { "基本单位", "UnitName" },
                { "基本数量", "SttlNumber" },
                { "单位", "UsedUnitName" },
                { "代销数量", "ProductCount" },
                { "已结算数量", "SttlCount" },
                { "本次结算数量", "UsedUnitCount" },
                { "单价", "UsedPrice" },
                { "本次结算代销金额", "TotalPrice" },
                { "备注", "Remark" },
            };
        }
        else
        {
            aDetail = new string[, ] {
                //{ "序号", "SortNo"},
                { "物品编号", "ProdNo" },
                { "物品名称", "ProductName" },
                { "规格", "Specification" },
                { "单位", "UnitName" },
                { "代销数量", "ProductCount" },
                { "已结算数量", "SttlCount" },
                { "本次结算数量", "SttlNumber" },
                { "单价", "UnitPrice" },
                { "本次结算代销金额", "TotalPrice" },
                { "备注", "Remark" },
            };
        }


        #endregion

        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.SellChannelSttl");
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 31; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion

        DataTable dbPrint         = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMain          = SellChannelSttlBus.GetRepOrder(SttlNo);       //获取主表数据
        DataTable dtDetail        = SellChannelSttlBus.GetRepOrderDetail(SttlNo); //获取明细表数据
        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 = "SttlNo|Title|FromTypeText|SendNo|CustName|Tel|PayTypeName|MoneyTypeName|CurrencyName|Rate|";
            strBaseFields = strBaseFields + "SellerName|DeptName|SttlDate|TotalFee|PushMoneyPercent|PushMoney|HandFeeTotal|SttlTotal|CountTotal|";
            strBaseFields = strBaseFields + "BillStatusText|CreatorName|CreateDate|ConfirmorName|ConfirmDate|CloserName|CloseDate|ModifiedUserID|ModifiedDate|Remark|";
            strBaseFields = strBaseFields + "IsOpenbillText|IsAccText|YAccounts";
            /*基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields = strBaseFields + "|" + "ExtField" + (i + 1);
                }
            }
            //多计量单位
            if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
            {
                /*订单明细SortNo|*/
                strDetailFields = "ProdNo|ProductName|Specification|UnitName|ProductCount|UsedUnitName|UsedUnitCount|SttlCount|SttlNumber|UsedPrice|TotalPrice|Remark";
            }
            else
            {
                /*订单明细SortNo|*/
                strDetailFields = "ProdNo|ProductName|Specification|UnitName|ProductCount|SttlCount|SttlNumber|UnitPrice|TotalPrice|Remark";
            }
        }

        #region 2.主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            //第一个是打印页面的正标题,strBaseFields是在PrintParameterSetting表里设置的主表字段,
            //strDetailFields是在PrintParameterSetting表里设置的明细表的字段,
            //aBase,是打印设置页面上定义取出来的字段及对应的名称,
            //aDetail是打印设置页面上定义取出来的字段及对应的名称,
            //例如明细中的物品编号,对应的就是物品编号及取数据的字段ProdNo,
            //dtMRP是主表的数据集,
            //dtDetail是明细表的数据集,最后一个参数,用来区别是主表信息还是明细信息..
            tableBase.InnerHtml = WritePrintPageTable("委托代销结算单", strBaseFields, strDetailFields, aBase, aDetail, dtMain, dtDetail, true);
        }
        #endregion

        #region 3.明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("委托代销结算单", strBaseFields, strDetailFields, aBase, aDetail, dtMain, dtDetail, false);
        }
        #endregion
    }
Exemple #19
0
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_PURCHASE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_PurchaseApply;


        //PurchaseApplyModel modelMRP = new PurchaseApplyModel();
        //PurchaseApplyModel.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        //PurchaseApplyModel.ID = this.intMrpID;

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "{ExtField1}",  "ExtField1"      },
            { "{ExtField2}",  "ExtField2"      },
            { "{ExtField3}",  "ExtField3"      },
            { "{ExtField4}",  "ExtField4"      },
            { "{ExtField5}",  "ExtField5"      },
            { "{ExtField6}",  "ExtField6"      },
            { "{ExtField7}",  "ExtField7"      },
            { "{ExtField8}",  "ExtField8"      },
            { "{ExtField9}",  "ExtField9"      },
            { "{ExtField10}", "ExtField10"     },
            { "单据编号",         "ApplyNo"        },
            { "主题",           "Title"          },
            { "采购类别",         "TypeName"       },
            { "申请人",          "ApplyUserName"  },
            { "部门",           "DeptName"       },
            { "源单类型",         "FromTypeName"   },
            { "申请日期",         "ApplyDate"      },
            { "到货地址",         "Address"        },

            { "数量总计",         "CountTotal"     },

            { "单据状态",         "BillStatusName" },
            { "制单人",          "CreatorName"    },
            { "制单日期",         "CreateDate"     },
            { "确认人",          "ConfirmorName"  },
            { "确认日期",         "ConfirmDate"    },
            { "结单人",          "CloserName"     },
            { "结单日期",         "CloseDate"      },
            { "最后更新人",        "ModifiedUserID" },
            { "最后更新日期",       "ModifiedDate"   },
            { "备注",           "Remark"         },
        };
        string[,] aDetail;
        if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
        {
            aDetail = new string[, ] {
                { "序号", "SortNo" },
                { "物品编号", "ProductNo" },
                { "物品名称", "ProductName" },
                { "规格", "Specification" },
                { "颜色", "ColorName" },
                { "基本单位", "UnitName" },
                { "基本数量", "PlanCount" },
                { "单位", "UsedUnitName" },
                { "需求数量", "UsedUnitCount" },

                { "需求日期", "PlanTakeDate" },
                { "申请原因", "ApplyReasonName" },
                { "源单编号", "FromBillNo" },
                { "源单序号", "FromLineNo" },
            };
        }
        else
        {
            aDetail = new string[, ] {
                { "序号", "SortNo" },
                { "物品编号", "ProductNo" },
                { "物品名称", "ProductName" },
                { "规格", "Specification" },
                { "颜色", "ColorName" },
                { "单位", "UnitName" },

                { "需求数量", "PlanCount" },
                { "需求日期", "PlanTakeDate" },
                { "申请原因", "ApplyReasonName" },
                { "源单编号", "FromBillNo" },
                { "源单序号", "FromLineNo" },
            };
        }
        string[,] aSecondDetail;
        /*第二明细*/
        if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
        {
            aSecondDetail = new string[, ] {
                { "序号", "SortNo" },
                { "物品编号", "ProductNo" },
                { "物品名称", "ProductName" },
                { "规格", "Specification" },
                { "颜色", "ColorName" },
                { "基本单位", "UnitName" },
                { "基本数量", "ProductCount" },
                { "单位", "UsedUnitName" },
                { "申请数量", "UsedUnitCount" },
                { "需求日期", "RequireDate" },
            };
        }
        else
        {
            aSecondDetail = new string[, ] {
                { "序号", "SortNo" },
                { "物品编号", "ProductNo" },
                { "物品名称", "ProductName" },
                { "规格", "Specification" },
                { "颜色", "ColorName" },
                { "单位", "UnitName" },
                { "申请数量", "ProductCount" },
                { "需求日期", "RequireDate" },
            };
        }

        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba." + ConstUtil.CODING_RULE_TABLE_PURCHASEAPPLY);
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 15; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion

        DataTable dbPrint  = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMRP    = PurchaseApplyBus.GetPurchaseApply(this.intMrpID.ToString());
        DataTable dtDetail = PurchaseApplyBus.GetPurchaseApplySource(this.intMrpID.ToString());

        //DataTable PurchaseApplyPrimary = PurchaseApplyBus.GetPurchaseApply(ID);
        //DataTable PurchaseApplySource = PurchaseApplyBus.GetPurchaseApplySource(ID);
        DataTable PurchaseApplyDetail2 = PurchaseApplyBus.GetPurchaseApplyDetail(this.intMrpID.ToString());



        string strBaseFields   = "";
        string strDetailFields = "";
        /*第二明细*/
        string strDetailSecondFields = "";

        if (dbPrint.Rows.Count > 0)
        {
            isSeted.Value   = "1";
            strBaseFields   = dbPrint.Rows[0]["BaseFields"].ToString();
            strDetailFields = dbPrint.Rows[0]["DetailFields"].ToString();
            /*第二明细*/
            strDetailSecondFields = dbPrint.Rows[0]["DetailSecondFields"].ToString();
        }
        else
        {
            isSeted.Value = "0";
            strBaseFields = "ApplyNo|Title|TypeName|ApplyUserName|DeptName|FromTypeName|ApplyDate|Address|CountTotal|CreatorName|CreateDate|BillStatusName|ConfirmorName|ConfirmDate|CloserName|CloseDate|ModifiedUserID|ModifiedDate|Remark";
            /*基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields = strBaseFields + "|" + "ExtField" + (i + 1);
                }
            }

            if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
            {
                strDetailFields = "SortNo|ProductNo|ProductName|Specification|ColorName|UnitName|PlanCount|UsedUnitName|UsedUnitCount|PlanTakeDate|ApplyReasonName|FromBillNo|FromLineNo";
            }
            else
            {
                strDetailFields = "SortNo|ProductNo|ProductName|Specification|ColorName|UnitName|PlanCount|PlanTakeDate|ApplyReasonName|FromBillNo|FromLineNo";
            }
            /*第二明细*/
            if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
            {
                strDetailSecondFields = "SortNo|ProductNo|ProductName|Specification|ColorName|UnitName|ProductCount|UsedUnitName|UsedUnitCount|RequireDate";
            }
            else
            {
                strDetailSecondFields = "SortNo|ProductNo|ProductName|Specification|ColorName|UnitName|ProductCount|RequireDate";
            }
        }

        #region 2.主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("采购申请", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, true);
        }
        #endregion

        #region 3.明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("采购申请", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, false);
        }
        #endregion

        /*第二明细*/
        #region 4.明细信息2
        if (!string.IsNullOrEmpty(strDetailSecondFields))
        {
            tableDetail2.InnerHtml = WritePrintPageTable("采购申请", strBaseFields, strDetailSecondFields, aBase, aSecondDetail, dtMRP, PurchaseApplyDetail2, false);
        }
        #endregion
    }
Exemple #20
0
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;//UserInfo.CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_SALE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_SELLSEND;

        //    /*接受参数*/
        string SendNo = Request.QueryString["no"].ToString();

        #region 基本信息 明细信息
        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase = { { "{ExtField1}",  "ExtField1"        },
                            { "{ExtField2}",  "ExtField2"        },
                            { "{ExtField3}",  "ExtField3"        },
                            { "{ExtField4}",  "ExtField4"        },
                            { "{ExtField5}",  "ExtField5"        },
                            { "{ExtField6}",  "ExtField6"        },
                            { "{ExtField7}",  "ExtField7"        },
                            { "{ExtField8}",  "ExtField8"        },
                            { "{ExtField9}",  "ExtField9"        },
                            { "{ExtField10}", "ExtField10"       },
                            { "单据编号",         "SendNo"           },
                            { "主题",           "Title"            },
                            { "源单类型",         "FromTypeText"     },
                            { "源单编号",         "OrderNo"          },
                            { "客户名称",         "CustName"         },
                            { "业务类型",         "BusiTypeName"     },
                            { "销售类别",         "SellTypeName"     },
                            { "结算方式",         "PayTypeName"      },
                            { "支付方式",         "MoneyTypeName"    },
                            { "交货方式",         "TakeTypeName"     },
                            { "运送方式",         "CarryTypeName"    },
                            { "币种",           "CurrencyName"     },
                            { "汇率",           "Rate"             },
                            { "业务员",          "SellerName"       },
                            { "部门",           "DeptName"         },
                            { "收货人姓名",        "Receiver"         },
                            { "发货人",          "SenderName"       },
                            { "预计发货时间",       "IntendSendDate"   },
                            { "发货地址",         "SendAddr"         },
                            { "收货地址",         "ReceiveAddr"      },
                            { "收货人电话",        "Tel"              },
                            { "收货人移动电话",      "Modile"           },
                            { "收货人邮编",        "Post"             },
                            { "是否增值税",        "isAddTaxName"     },
                            { "所属项目",         "ProjectName"      },
                            { "可查看人员",        "CanViewUserName"  },
                            { "金额合计",         "TotalPrice"       },
                            { "税额合计",         "Tax"              },
                            { "含税金额合计",       "TotalFee"         },
                            { "整单折扣(%)",      "Discount"         },
                            { "折扣含税金额",       "RealTotal"        },
                            { "折扣合计",         "DiscountTotal"    },
                            { "发货数量合计",       "CountTotal"       },
                            { "单据状态",         "BillStatusText"   },
                            { "制单人",          "CreatorName"      },
                            { "制单日期",         "CreateDate"       },
                            { "确认人",          "ConfirmorName"    },
                            { "确认日期",         "ConfirmDate"      },
                            { "结单人",          "CloserName"       },
                            { "结单日期",         "CloseDate"        },
                            { "最后更新人",        "ModifiedUserID"   },
                            { "最后更新日期",       "ModifiedDate"     },
                            { "备注",           "Remark"           },
                            { "包装运输说明",       "PackTransit"      },
                            { "付款说明",         "PayRemark"        },
                            { "交付说明",         "DeliverRemark"    },
                            { "运输商",          "TransporterName"  },
                            { "运费合计",         "TransportFee"     },
                            { "运费结算方式",       "TransPayTypeName" }, };

        string[,] aDetail;
        //多计量单位
        if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
        {
            aDetail = new string[, ] {
                //{ "序号", "SortNo"},
                { "物品编号", "ProdNo" },
                { "物品名称", "ProductName" },
                { "规格", "Specification" },
                { "颜色", "ColorName" },
                { "基本单位", "UnitName" },
                { "基本数量", "ProductCount" },
                { "单位", "UsedUnitName" },
                { "数量", "UsedUnitCount" },
                { "发货日期", "SendDate" },
                { "包装要求", "PackageName" },
                { "单价", "UsedPrice" },
                { "含税价", "TaxPrice" },
                { "折扣(%)", "Discount" },
                { "税率(%)", "TaxRate" },
                { "含税金额", "TotalFee" },
                { "金额", "TotalPrice" },
                { "税额", "TotalTax" },
                { "备注", "Remark" },
            };
        }
        else
        {
            aDetail = new string[, ] {
                //{ "序号", "SortNo"},
                { "物品编号", "ProdNo" },
                { "物品名称", "ProductName" },
                { "规格", "Specification" },
                { "颜色", "ColorName" },
                { "单位", "UnitName" },
                { "数量", "ProductCount" },
                { "发货日期", "SendDate" },
                { "包装要求", "PackageName" },
                { "单价", "UnitPrice" },
                { "含税价", "TaxPrice" },
                { "折扣(%)", "Discount" },
                { "税率(%)", "TaxRate" },
                { "含税金额", "TotalFee" },
                { "金额", "TotalPrice" },
                { "税额", "TotalTax" },
                { "备注", "Remark" },
            };
        }

        #endregion

        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.SellSend");
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 47; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion

        DataTable dbPrint         = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMain          = SellSendBus.GetRepOrder(SendNo);       //获取主表数据
        DataTable dtDetail        = SellSendBus.GetRepOrderDetail(SendNo); //获取明细表:订单明细数据
        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 = "SendNo|Title|FromTypeText|OrderNo|CustName|BusiTypeName|SellTypeName|PayTypeName|MoneyTypeName|TakeTypeName|CarryTypeName|CurrencyName|Rate|";
            strBaseFields = strBaseFields + "SellerName|DeptName|Receiver|SenderName|IntendSendDate|SendAddr|ReceiveAddr|Tel|Modile|Post|isAddTaxName|ProjectName|CanViewUserName|TotalPrice|Tax|TotalFee|Discount|";
            strBaseFields = strBaseFields + "RealTotal|DiscountTotal|CountTotal|BillStatusText|CreatorName|CreateDate|ConfirmorName|ConfirmDate|CloserName|CloseDate|ModifiedUserID|ModifiedDate|Remark|";
            strBaseFields = strBaseFields + "PackTransit|PayRemark|DeliverRemark|TransporterName|TransportFee|TransPayTypeName";
            /*基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields = strBaseFields + "|" + "ExtField" + (i + 1);
                }
            }

            //多计量单位
            if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
            {
                /*订单明细SortNo|*/
                strDetailFields = "ProdNo|ProductName|Specification|ColorName|UnitName|ProductCount|UsedUnitName|UsedUnitCount|SendDate|PackageName|UsedPrice|TaxPrice|Discount|TaxRate|TotalFee|TotalPrice|TotalTax|Remark";
            }
            else
            {
                /*订单明细SortNo|*/
                strDetailFields = "ProdNo|ProductName|Specification|ColorName|UnitName|ProductCount|SendDate|PackageName|UnitPrice|TaxPrice|Discount|TaxRate|TotalFee|TotalPrice|TotalTax|Remark";
            }
        }

        #region 2.主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            //第一个是打印页面的正标题,strBaseFields是在PrintParameterSetting表里设置的主表字段,
            //strDetailFields是在PrintParameterSetting表里设置的明细表的字段,
            //aBase,是打印设置页面上定义取出来的字段及对应的名称,
            //aDetail是打印设置页面上定义取出来的字段及对应的名称,
            //例如明细中的物品编号,对应的就是物品编号及取数据的字段ProdNo,
            //dtMRP是主表的数据集,
            //dtDetail是明细表的数据集,最后一个参数,用来区别是主表信息还是明细信息..
            tableBase.InnerHtml = WritePrintPageTable("销售发货单", strBaseFields, strDetailFields, aBase, aDetail, dtMain, dtDetail, true);
        }
        #endregion

        #region 3.明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("销售发货单", strBaseFields, strDetailFields, aBase, aDetail, dtMain, dtDetail, false);
        }
        #endregion
    }
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_STORAGE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_BORROW;

        StorageInitailModel OutSellM_ = new StorageInitailModel();

        OutSellM_.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        OutSellM_.ID        = this.intMrpID.ToString();



        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "{ExtField1}",  "ExtField1"      },
            { "{ExtField2}",  "ExtField2"      },
            { "{ExtField3}",  "ExtField3"      },
            { "{ExtField4}",  "ExtField4"      },
            { "{ExtField5}",  "ExtField5"      },
            { "{ExtField6}",  "ExtField6"      },
            { "{ExtField7}",  "ExtField7"      },
            { "{ExtField8}",  "ExtField8"      },
            { "{ExtField9}",  "ExtField9"      },
            { "{ExtField10}", "ExtField10"     },
            { "借货单编号",        "BorrowNo"       },
            { "借货单主题  ",      "Title"          },
            { "借货人",          "BorrowerText"   },
            { "借货部门",         "DeptName"       },
            { "借货原因",         "Reason"         },
            { "借货日期",         "BorrowDate"     },
            { "借出仓库 ",        "SotorageName"   },
            { "出库日期 ",        "OutDate"        },
            { "出库人 ",         "OuterText"      },

            { "借出部门",         "OutDeptName"    },
            { "摘要",           "Summary"        },
            { "借货数量合计 ",      "CountTotal"     },

            { "借货金额合计 ",      "TotalPrice"     },


            { "制单人",          "CreatorText"    },

            { "制单日期",         "CreateDate"     },
            { "单据状态",         "BillStatusText" },
            { "确认人",          "ConfirmorText"  },
            { "确认日期",         "ConfirmDate"    },
            { "结单人",          "CloserText"     },
            { "结单日期",         "CloseDate"      },
            { "最后更新人",        "ModifiedUserID" },
            { "最后更新日期",       "ModifiedDate"   },
            { "备注",           "Remark"         },
        };

        string[,] aDetail = null;

        if (!UserInfo.IsMoreUnit)
        {
            aDetail = new string[, ] {
                { "序号", "SortNo" },
                { "物品编号", "ProdNo" },
                { "物品名称", "ProductName" },
                { "批次", "BatchNo" },
                { "规格", "Specification" },
                { "单位", "CodeName" },
                { "现有存量", "UseCount" },
                { "借出单价 ", "UnitPrice" },
                { "借货数量 ", "ProductCount" },
                { "借货金额 ", "TotalPrice" },
                { "预计返还日期 ", "ReturnDate" },
                { "预计返还数量 ", "ReturnCount" },
                { "已返还数量 ", "RealReturnCount" },
                { "备注", "Remark" },
            }
        }
        ;
        else
        {
            aDetail = new string[, ] {
                { "序号", "SortNo" },
                { "物品编号", "ProdNo" },
                { "物品名称", "ProductName" },
                { "批次", "BatchNo" },
                { "规格", "Specification" },
                { "基本单位", "CodeName" },
                { "基本数量", "ProductCount" },
                { "单位", "UsedUnitName" },
                { "现有存量", "UseCount" },
                { "借出单价 ", "UsedPrice" },
                { "借货数量 ", "UsedUnitCount" },
                { "借货金额 ", "TotalPrice" },
                { "预计返还日期 ", "ReturnDate" },
                { "预计返还数量 ", "ReturnCount" },
                { "已返还数量 ", "RealReturnCount" },
                { "备注", "Remark" },
            }
        };


        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = XBase.Business.Office.SupplyChain.TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.StorageBorrow");
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 15; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion
        string    No              = Request.QueryString["No"].ToString();
        DataTable dbPrint         = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMRP           = StorageBorrowBus.GetStorageBorrowInfo(intMrpID);
        DataTable dtDetail        = StorageBorrowBus.GetStorageBorrowDetail(OutSellM_.CompanyCD, No);
        string    strBaseFields   = "";
        string    strDetailFields = "";


        if (dbPrint.Rows.Count > 0)
        {
            #region 设置过打印模板设置时 直接取出表里设置的值
            isSeted.Value   = "1";
            strBaseFields   = dbPrint.Rows[0]["BaseFields"].ToString();
            strDetailFields = dbPrint.Rows[0]["DetailFields"].ToString();
            #endregion
        }
        else
        {
            #region 未设置过打印模板设置 默认显示所有的
            isSeted.Value = "0";

            /*未设置过打印模板设置时,默认显示的字段  基本信息字段*/
            for (int m = 10; m < aBase.Length / 2; m++)
            {
                strBaseFields = strBaseFields + aBase[m, 1] + "|";
            }
            /*未设置过打印模板设置时,默认显示的字段 基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields = strBaseFields + "ExtField" + (i + 1) + "|";
                }
            }
            /*未设置过打印模板设置时,默认显示的字段 明细信息字段*/
            for (int n = 0; n < aDetail.Length / 2; n++)
            {
                strDetailFields = strDetailFields + aDetail[n, 1] + "|";
            }
            #endregion
        }

        #region 2.主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("借货申请单", strBaseFields.TrimEnd('|'), strDetailFields.TrimEnd('|'), aBase, aDetail, dtMRP, dtDetail, true);
        }
        #endregion

        #region 3.明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("借货申请单", strBaseFields.TrimEnd('|'), strDetailFields.TrimEnd('|'), aBase, aDetail, dtMRP, dtDetail, false);
        }
        #endregion
    }
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel pModel = new PrintParameterSettingModel();

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


        #region 初始化 取基本信息及明细信息的字段以及对应的标题
        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "{ExtField1}",  "ExtField1"           },
            { "{ExtField2}",  "ExtField2"           },
            { "{ExtField3}",  "ExtField3"           },
            { "{ExtField4}",  "ExtField4"           },
            { "{ExtField5}",  "ExtField5"           },
            { "{ExtField6}",  "ExtField6"           },
            { "{ExtField7}",  "ExtField7"           },
            { "{ExtField8}",  "ExtField8"           },
            { "{ExtField9}",  "ExtField9"           },
            { "{ExtField10}", "ExtField10"          },
            { "单据编号",         "OrderNo"             },
            { "主题",           "Title"               },
            { "销售分店",         "DeptName"            },
            { "发货模式",         "SendModeName"        },
            { "业务员",          "SellerName"          },
            { "客户名称",         "CustName"            },
            { "客户联系电话",       "CustTel"             },
            { "客户手机号",        "CustMobile"          },
            { "下单日期",         "OrderDate"           },
            { "币种",           "CurrencyName"        },
            { "汇率",           "Rate"                },
            { "订货方式",         "OrderMethodTypeName" },
            { "交货方式",         "TakeTypeTypeName"    },
            { "结算方式",         "PayTypeTypeName"     },
            { "支付方式",         "MoneyTypeTypeName"   },
            { "是否为增值税",       "isAddTax"            },
            { "预约发货时间",       "PlanOutDate"         },
            { "运送方式",         "CarryTypeTypeName"   },
            { "配送部门",         "OutDeptName"         },
            { "实际发货时间",       "OutDate"             },
            { "发货人",          "OutUserName"         },
            { "业务状态",         "BusiStatusName"      },
            { "发货地址",         "CustAddr"            },
            { "是否需要安装",       "NeedSetup"           },
            { "预约安装时间",       "PlanSetDate"         },
            { "实际安装时间",       "SetDate"             },
            { "安装工人及联系电话",    "SetUserInfo"         },
            { "数量总计",         "CountTotal"          },
            { "金额合计",         "TotalPrice"          },
            { "税额合计",         "Tax"                 },
            { "含税金额合计",       "TotalFee"            },
            { "整单折扣",         "Discount"            },
            { "折扣金额合计",       "DiscountTotal"       },
            { "折后含税金额",       "RealTotal"           },
            { "已结金额",         "PayedTotal"          },
            { "货款余额",         "WairPayTotal"        },
            { "制单人",          "CreatorName"         },
            { "制单日期",         "CreateDate"          },
            { "单据状态",         "BillStatusName"      },
            { "确认人",          "ConfirmorName"       },
            { "确认日期",         "ConfirmDate"         },
            { "最后更新人",        "ModifiedUserID"      },
            { "结单人",          "CloserName"          },
            { "结单日期",         "CloseDate"           },
            { "最后更新日期",       "ModifiedDate"        },
            { "备注",           "Remark"              },
            { "是否已建单",        "isOpenbill"          },
            { "结算人",          "SttlUserName"        },
            { "结算时间",         "SttlDate"            },
        };

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

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

        #region 2.所设的打印模板设置
        DataTable dbPrint  = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(pModel);
        DataTable dt       = SubSellOrderBus.GetSubSellOrderPrint(BillID);
        DataTable dtDetail = SubSellOrderBus.GetSubSellOrderDetailPrint(BillID);

        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);
        }
        #endregion

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

        #region 4.明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("销售订单", strBaseFields, strDetailFields, aBase, aDetail, dt, dtDetail, false);
        }
        #endregion
    }
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_STORAGE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_DayEnd;
        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "日结日期",               "DailyDate"          },
            { "仓库",                 "StorageName"        },
            { "品名",                 "ProductName"        },
            { "批次",                 "BatchNo"            },
            { "物品编号",               "ProductNo"          },
            { "入库总数量 ",             "InTotal"            },
            { "出库总数量",              "OutTotal"           },
            { "当日结存量",              "TodayCount"         },
            { "当日销售金额",             "SaleFee"            },
            { "当日销售退货金额",           "SaleBackFee"        },
            { "当日采购金额",             "PhurFee"            },
            { "当日采购退货金额",           "PhurBackFee"        },
            { "操作人",                "CreatorName"        },
            { "操作日期",               "CreateDate"         },
            { "期初库存录入数量",           "InitInCount"        },
            { "期初库存导入数量",           "InitBatchCount"     },
            { "采购入库数量",             "PhurInCount"        },
            { "生产完工入库数量",           "MakeInCount"        },
            { "销售退货入库数量",           "SaleBackInCount"    },
            { "门店销售退货入库数量(总店发货模式)", "SubSaleBackInCount" },
            { "红冲入库数量",             "RedInCount"         },
            { "其他入库数量",             "OtherInCount"       },
            { "配送出库数量",             "SendOutCount"       },
            { "领料出库数量",             "TakeOutCount"       },
            { "借货返还数量",             "BackInCount"        },
            { "生产退料数量",             "TakeInCount"        },
            { "库存调拨入库数量",           "DispInCount"        },


            { "配送退货入库数量",           "SendInCount"        },
            { "销售出库数量",             "SaleOutCount"       },
            { "门店销售数量(总店发货模式)",     "SubSaleOutCount"    },
            { "采购退货出库数量",           "PhurBackOutCount"   },
            { "红冲出库数量",             "RedOutCount"        },
            { "其他出库数量",             "OtherOutCount"      },
            { "库存调拨出库数量",           "DispOutCount"       },
            { "借出数量",               "LendCount"          },
            { "库存调整数量",             "AdjustCount"        },
            { "库存报损数量",             "BadCount"           },
            { "盘点调整数量",             "CheckCount"         },
        };



        DataTable dbPrint = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMRP   = DayEndBus.GetStorageDailyInfo(Convert.ToString(this.intMrpID), this.BatchNo, Convert.ToString(this.StorageID), this.DailyDate, model.CompanyCD);



        string strBaseFields = "";

        /*第二明细*/

        if (dbPrint.Rows.Count > 0)
        {
            isSeted.Value = "1";
            strBaseFields = dbPrint.Rows[0]["BaseFields"].ToString();
        }
        else
        {
            isSeted.Value = "0";
            strBaseFields = "DailyDate|StorageName|ProductName|BatchNo|ProductNo|InTotal|OutTotal|TodayCount|SaleFee|SaleBackFee|PhurFee|PhurBackFee|CreatorName|CreateDate|InitInCount|InitBatchCount|PhurInCount|MakeInCount|SaleBackInCount|SubSaleBackInCount|RedInCount|OtherInCount|SendOutCount|TakeOutCount|BackInCount|TakeInCount|DispInCount|SendInCount|SaleOutCount|SubSaleOutCount|PhurBackOutCount|RedOutCount|OtherOutCount|DispOutCount|LendCount|AdjustCount|BadCount|CheckCount";
        }


        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("库存日结明细", strBaseFields, null, aBase, null, dtMRP, null, true);
        }
    }
    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
    }
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = UserInfo.CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_PURCHASE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_PurchaseArrive;

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        Dictionary <string, string> dic = new Dictionary <string, string>();

        dic.Add("ExtField1", "{ExtField1}");
        dic.Add("ExtField2", "{ExtField2}");
        dic.Add("ExtField3", "{ExtField3}");
        dic.Add("ExtField4", "{ExtField4}");
        dic.Add("ExtField5", "{ExtField5}");
        dic.Add("ExtField6", "{ExtField6}");
        dic.Add("ExtField7", "{ExtField7}");
        dic.Add("ExtField8", "{ExtField8}");
        dic.Add("ExtField9", "{ExtField9}");
        dic.Add("ExtField10", "{ExtField10}");
        dic.Add("ArriveNo", "单据编号");
        dic.Add("Title", "主题");
        dic.Add("TypeIDName", "采购类别");
        dic.Add("ProviderName", "供应商");
        dic.Add("DeptName", "部门");
        dic.Add("CheckUserName", "点收人");
        dic.Add("PurchaserName", "采购员");
        dic.Add("CheckDate", "点收日期");
        dic.Add("FromTypeName", "源单类型");
        dic.Add("MoneyTypeName", "支付方式");
        dic.Add("SendAddress", "发货地址");
        dic.Add("ReceiveOverAddress", "收货地址");
        dic.Add("isAddTaxName", "是否为增值税");
        dic.Add("TakeTypeName", "交货方式");
        dic.Add("CarryTypeName", "运送方式");
        dic.Add("PayTypeName", "结算方式");
        dic.Add("CurrencyTypeName", "币种");
        dic.Add("Rate", "汇率");
        dic.Add("ArriveDate", "到货时间");
        dic.Add("ProjectName", "所属项目");


        dic.Add("CountTotal", "数量总计");
        if (UserInfo.IsDisplayPrice)
        {// 出入库显示单价
            dic.Add("TotalMoney", "金额总计");
            dic.Add("TotalTax", "税额合计");
            dic.Add("TotalFee", "含税总额总计");
            dic.Add("Discount", "整单折扣");
            dic.Add("DiscountTotal", "折扣金额");
            dic.Add("RealTotal", "折后含税额");
            dic.Add("OtherTotal", "其他费用支出合计");
        }


        dic.Add("BillStatusName", "单据状态");
        dic.Add("CreatorName", "制单人");
        dic.Add("CreateDate", "制单日期");
        dic.Add("ConfirmorName", "确认人");
        dic.Add("ConfirmDate", "确认日期");
        dic.Add("CloserName", "结单人");
        dic.Add("CloseDate", "结单日期");
        dic.Add("ModifiedUserID", "最后更新人");
        dic.Add("ModifiedDate", "最后更新日期");
        dic.Add("Remark", "备注");
        string[,] aBase = ConvertDictionaryToString(dic, out _sbase);

        dic.Clear();
        dic.Add("SortNo", "序号");
        dic.Add("ProductNo", "物品编号");
        dic.Add("ProductName", "物品名称");
        dic.Add("Specification", "规格");
        dic.Add("ColorName", "颜色");
        if (_isMoreUnit)
        {// 启用多计量单位
            dic.Add("UnitName", "基本单位");
            dic.Add("ProductCount", "基本数量");
            dic.Add("UsedUnitName", "单位");
            dic.Add("UsedUnitCount", "到货数量");
        }
        else
        {
            dic.Add("UnitName", "单位");
            dic.Add("ProductCount", "到货数量");
        }
        if (UserInfo.IsDisplayPrice)
        {// 出入库显示单价
            dic.Add("TotalPrice", "金额");
            dic.Add("UnitPrice", "单价");
            dic.Add("TaxPrice", "含税价");
            dic.Add("TaxRate", "税率");
            dic.Add("TotalFee", "含税金额");
            dic.Add("TotalTax", "税额");
        }

        string[,] aDetail = ConvertDictionaryToString(dic, out _sdetail);

        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = TableExtFieldsBus.GetAllList(UserInfo.CompanyCD, "", "officedba." + ConstUtil.CODING_RULE_TABLE_PURCHASEARRIVE);
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 15; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion

        DataTable dbPrint  = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMRP    = PurchaseArriveBus.SelectArrive(this.intMrpID);
        DataTable dtDetail = PurchaseArriveBus.Details(this.intMrpID);

        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 = strBaseFields + "|" + "ExtField" + (i + 1);
                }
            }
            strDetailFields = GetDefaultFields(aDetail);
        }

        #region 2.主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("采购到货", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, true);
        }
        #endregion

        #region 3.明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("采购到货", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, false);
        }
        #endregion
    }
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_SALE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_SELLCHANCE;

        SellChanceModel modelMRP = new SellChanceModel();

        modelMRP.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        modelMRP.ChanceNo  = this.ChanceNo;

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "{ExtField1}",  "ExtField1"       },
            { "{ExtField2}",  "ExtField2"       },
            { "{ExtField3}",  "ExtField3"       },
            { "{ExtField4}",  "ExtField4"       },
            { "{ExtField5}",  "ExtField5"       },
            { "{ExtField6}",  "ExtField6"       },
            { "{ExtField7}",  "ExtField7"       },
            { "{ExtField8}",  "ExtField8"       },
            { "{ExtField9}",  "ExtField9"       },
            { "{ExtField10}", "ExtField10"      },

            { "机会编号",         "ChanceNo"        },
            { "机会主题",         "Title"           },
            { "机会类型",         "ChanceTypeName"  },

            { "客户名称",         "CustName"        },
            { "客户电话",         "CustTel"         },
            { "客户类型",         "CustTypeName"    },

            { "机会来源",         "HapSourceName"   },
            { "发现日期",         "FindDate"        },
            { "业务员",          "SellerName"      },

            { "部门",           "DeptName"        },
            { "提供人",          "ProvideMan"      },

            { "需求描述",         "Requires"        },

            { "可查看该机会人员",     "CanViewUserName" },
            { "提醒时间",         "RemindTime"      },
            { "提醒手机号",        "RemindMTel"      },
            { "接收人",          "ReceiverName"    },
            { "提醒内容",         "RemindContent"   },

            { "预期金额",         "IntendMoney"     },
            { "预期签单日",        "IntendDate"      },

            { "制单人",          "CreatorName"     },
            { "制单日期",         "CreateDate"      },
            { "最后更新人",        "ModifiedUserID"  },

            { "最后更新日期",       "ModifiedDate"    },
            { "是否被报价",        "IsQuotedName"    },

            { "备注",           "Remark"          },
        };

        string[,] aDetail =
        {
            { "阶段",   "PhaseName"    },
            { "日期",   "PushDate"     },
            { "业务员",  "EmployeeName" },
            { "状态",   "StateName"    },
            { "可能性",  "TypeName"     },
            { "阶段备注", "Remark"       },
        };
        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.SellChance");
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 15; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion

        DataTable dbPrint         = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMRP           = SellChanceBus.GetRepOrder(ChanceNo);       // SellPlanBus.GetRepOrder(PlanNo);
        DataTable dtDetail        = SellChanceBus.GetRepOrderDetail(ChanceNo); //SellPlanBus.GetOrderDetail(PlanNo);
        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 = "ChanceNo|Title|ChanceTypeName|CustName|CustTel|CustTypeName|HapSourceName|FindDate|SellerName|DeptName|ProvideMan|Requires|CanViewUserName|RemindTime|RemindMTel|ReceiverName|RemindContent|IntendMoney|IntendDate|CreatorName|CreateDate|ModifiedUserID|ModifiedDate|IsQuotedName|Remark";
            /*基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields = strBaseFields + "|" + "ExtField" + (i + 1);
                }
            }

            strDetailFields = "PhaseName|PushDate|EmployeeName|StateName|TypeName|Remark";
        }

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

        #region 明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("销售机会", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, false);
        }
        #endregion
    }
Exemple #27
0
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel pModel = new PrintParameterSettingModel();

        pModel.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        pModel.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_QUALITYCHECK);
        pModel.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_CHECKREPORT;


        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "{ExtField1}",  "ExtField1"      },
            { "{ExtField2}",  "ExtField2"      },
            { "{ExtField3}",  "ExtField3"      },
            { "{ExtField4}",  "ExtField4"      },
            { "{ExtField5}",  "ExtField5"      },
            { "{ExtField6}",  "ExtField6"      },
            { "{ExtField7}",  "ExtField7"      },
            { "{ExtField8}",  "ExtField8"      },
            { "{ExtField9}",  "ExtField9"      },
            { "{ExtField10}", "ExtField10"     },
            { "单据编号",         "ReportNo"       },
            { "主题",           "Title"          },
            { "源单类型",         "FromType"       },
            { "源单编号",         "FromReportNo"   },
            { "往来单位",         "OtherCorpName"  },
            { "往来单位大类",       "CorpBigType"    },
            { "生产负责人",        "PrincipalName"  },
            { "生产部门",         "DeptName"       },
            { "质检类别",         "CheckType"      },
            { "检验日期",         "CheckDate"      },
            { "报检人员",         "ApplyUserName"  },
            { "报检部门",         "ApplyDeptName"  },
            { "检验人员",         "CheckerName"    },
            { "检验部门",         "CheckDeptName"  },
            { "检验方案",         "CheckContent"   },
            { "物品编号",         "ProdNo"         },
            { "物品名称",         "ProductName"    },
            { "单位",           "CodeName"       },
            { "规格",           "Specification"  },
            { "报检数量",         "CheckNum"       },
            { "抽样数量",         "SampleNum"      },
            { "检验方式",         "CheckMode"      },
            { "合格数量",         "PassNum"        },
            { "不合格数量",        "NoPass"         },
            { "合格率(%)",       "PassPercent"    },
            { "检验标准",         "CheckStandard"  },
            { "检验结果描述 ",      "CheckResult"    },
            { "检验结果 ",        "IsPass"         },
            { "是否需要复检",       "isRecheck"      },
            { "单据状态",         "BillStatus"     },
            { "制单人",          "CreatorName"    },
            { "制单日期",         "CreateDate"     },
            { "确认人",          "ConfirmorName"  },
            { "确认日期",         "ConfirmDate"    },
            { "结单人",          "CloserName"     },
            { "结单日期",         "CloseDate"      },
            { "最后更新人",        "ModifiedUserID" },
            { "最后更新日期",       "ModifiedDate"   },
            { "备注",           "Remark"         },
        };

        string[,] aDetail =
        {
            { "序号",   "SortNo"        },
            { "检验项目", "CheckItem"     },
            { "检验指标", "CheckStandard" },
            { "检验值",  "CheckValue"    },
            { "检验结论", "CheckResult"   },
            { "检验结果", "isPass"        },
            { "检验数量", "CheckNum"      },
            { "合格数量", "PassNum"       },
            { "不合格数", "NotPassNum"    },
            { "检验人员", "Checker"       },
            { "检验部门", "CheckDeptID"   },
            { "标准值",  "StandardValue" },
            { "指标上限", "NormUpLimit"   },
            { "指标下限", "LowerLimit"    },
            { "备注",   "Remark"        },
        };

        #region 扩展属性
        DataTable dtExtTable = TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.QualityCheckReport");
        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       = CheckReportBus.GetReportInfo(this.intID);
        DataTable dtDetail = CheckReportBus.GetDetailInfo(this.intID);
        dtDetail.Columns.Add("SortNo", typeof(string));
        for (int i = 0; i < dtDetail.Rows.Count; i++)
        {
            dtDetail.Rows[i]["SortNo"] = i + 1;
        }
        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
    }
Exemple #28
0
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_PURCHASE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_PROVIDERINFO;

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "供应商编号",   "CustNo"           },
            { "供应商类别",   "CustTypeName"     },
            { "供应商分类",   "CustClassName"    },
            { "供应商名称",   "CustName"         },
            { "供应商简称",   "CustNam"          },
            { "供应商拼音代码", "PYShort"          },
            { "供应商简介",   "CustNote"         },
            { "国家地区",    "CountryName"      },
            { "省",       "Province"         },
            { "市",       "City"             },
            { "邮编",      "Post"             },
            { "联系人",     "ContactName"      },
            { "电话",      "Tel"              },
            { "传真",      "Fax"              },
            { "手机",      "Mobile"           },
            { "邮件",      "email"            },
            { "在线咨询",    "OnLine"           },
            { "公司网址",    "WebSite"          },
            { "交货方式",    "TakeTypeName"     },
            { "运送方式",    "CarryTypeName"    },
            { "供应商优先级别", "CreditGradeName"  },
            { "热点供应商",   "HotIsName"        },
            { "启用状态",    "UsedStatusName"   },
            { "分管采购员",   "ManagerName"      },
            { "联络期限",    "LinkCycle"        },
            { "所在地区",    "AreaName"         },
            { "发货地址",    "SendAddress"      },
            { "经营范围",    "SellArea"         },
            { "结算方式",    "PayTypeName"      },
            { "币种",      "CurrencyTypeName" },
            { "开户行",     "OpenBank"         },
            { "户名",      "AccountMan"       },
            { "帐号",      "AccountNum"       },
            { "成立时间",    "SetupDate"        },
            { "法人代表",    "ArtiPerson"       },
            { "一般纳税人",   "IsTaxName"        },
            { "税务登记号",   "TaxCD"            },
            { "营业执照号",   "BusiNumber"       },
            { "热度",      "HotHowName"       },
        };
        DataTable dbPrint = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);

        DataTable dtProviderInfo = ProviderInfoBus.SelectProviderInfo(this.intMrpID);

        string strBaseFields   = "";
        string strDetailFields = "";
        /*第二明细*/
        string strDetailSecondFields = "";

        if (dbPrint.Rows.Count > 0)
        {
            isSeted.Value   = "1";
            strBaseFields   = dbPrint.Rows[0]["BaseFields"].ToString();
            strDetailFields = dbPrint.Rows[0]["DetailFields"].ToString();
            /*第二明细*/
            strDetailSecondFields = dbPrint.Rows[0]["DetailSecondFields"].ToString();
        }
        else
        {
            isSeted.Value = "0";
            strBaseFields = "CustNo|CustTypeName|CustClassName|CustName|CustNam|PYShort|CustNote|CountryName|Province|City|Post|ContactName|Tel|Fax|Mobile|email|OnLine|WebSite|TakeTypeName|CarryTypeName|CreditGradeName|HotIsName|UsedStatusName|ManagerName|LinkCycle|AreaName|SendAddress|SellArea|PayTypeName|CurrencyTypeName|OpenBank|AccountMan|AccountNum|SetupDate|ArtiPerson|IsTaxName|TaxCD|BusiNumber|HotHowName";
        }

        #region 2.主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("供应商档案", strBaseFields, null, aBase, null, dtProviderInfo, null, true);
        }
        #endregion

        //#region 3.明细信息
        //if (!string.IsNullOrEmpty(strDetailFields))
        //{
        //    tableDetail.InnerHtml = WritePrintPageTable("物料需求计划", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, false);
        //}
        //#endregion

        ///*第二明细*/
        //#region 4.明细信息2
        //if (!string.IsNullOrEmpty(strDetailSecondFields))
        //{
        //    tableDetail2.InnerHtml = WritePrintPageTable("物料需求计划", strBaseFields, strDetailSecondFields, aBase, aSecondDetail, dtMRP, dtDetail, false);
        //}
        //#endregion
    }
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_STORAGE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_OUTOTHER;

        StorageOutOtherModel OutOtherSellM_ = new StorageOutOtherModel();

        OutOtherSellM_.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        OutOtherSellM_.ID        = this.intMrpID.ToString();

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase;
        string[,] aDetail;
        if (HiddenPrice.Value == "True")
        {
            aBase = new string[, ] {
                { "{ExtField1}", "ExtField1" },
                { "{ExtField2}", "ExtField2" },
                { "{ExtField3}", "ExtField3" },
                { "{ExtField4}", "ExtField4" },
                { "{ExtField5}", "ExtField5" },
                { "{ExtField6}", "ExtField6" },
                { "{ExtField7}", "ExtField7" },
                { "{ExtField8}", "ExtField8" },
                { "{ExtField9}", "ExtField9" },
                { "{ExtField10}", "ExtField10" },
                { "出库单编号", "OutNo" },
                { "出库单主题", "Title" },
                { "源单类型", "FromTypeName" },
                { "源单编号", "FromBillNo" },
                { "往来单位", "OtherCorpName" },
                { "往来单位类型", "CorpBigTypeName" },
                { "发货地址", "SendAddr" },
                { "收货地址", "ReceiveAddr" },
                { "经办人", "SenderName" },
                { "出库部门", "DeptName" },
                { "出库人", "TransactorName" },
                { "出库时间", "OutDate" },
                { "出库原因", "ReasonTypeName" },
                { "数量合计", "CountTotal" },
                { "金额合计", "A_TotalPrice" },
                { "制单人", "CreatorName" },
                { "制单日期", "CreateDate" },
                { "确认人", "ConfirmorName" },
                { "确认日期", "ConfirmDate" },
                { "结单人", "CloserName" },
                { "结单日期", "CloseDate" },
                { "最后更新人", "ModifiedUserName" },
                { "最后更新日期", "ModifiedDate" },
                { "单据状态", "BillStatusName" },
                { "备注", "Remark" },
                { "所属项目", "ProjectName" },
                { "摘要", "Summary" },
            };
            if (HiddenMoreUnit.Value == "True")
            {
                aDetail = new string[, ] {
                    { "序号", "SortNo" },
                    { "物品编号", "ProductNo" },
                    { "物品名称", "ProductName" },
                    { "批次", "BatchNo" },
                    { "规格", "Specification" },
                    { "基本单位", "UnitID" },
                    { "基本数量", "ProductCount" },
                    { "单位", "UsedUnitName" },
                    { "仓库", "StorageName" },
                    { "退货数量", "BackCount" },
                    { "已出库数量", "OutedTotal" },
                    { "未出库数量", "NotOutCount" },
                    { "出库数量", "UsedUnitCount" },
                    { "单价", "UsedPrice" },
                    { "金额", "B_TotalPrice" },
                    { "备注", "DetaiRemark" },
                };
            }
            else
            {
                aDetail = new string[, ] {
                    { "序号", "SortNo" },
                    { "物品编号", "ProductNo" },
                    { "物品名称", "ProductName" },
                    { "批次", "BatchNo" },
                    { "规格", "Specification" },
                    { "单位", "UnitID" },
                    { "仓库", "StorageName" },
                    { "退货数量", "BackCount" },
                    { "已出库数量", "OutedTotal" },
                    { "未出库数量", "NotOutCount" },
                    { "出库数量", "ProductCount" },
                    { "单价", "UnitPrice" },
                    { "金额", "B_TotalPrice" },
                    { "备注", "DetaiRemark" },
                };
            }
        }
        else
        {
            aBase = new string[, ] {
                { "{ExtField1}", "ExtField1" },
                { "{ExtField2}", "ExtField2" },
                { "{ExtField3}", "ExtField3" },
                { "{ExtField4}", "ExtField4" },
                { "{ExtField5}", "ExtField5" },
                { "{ExtField6}", "ExtField6" },
                { "{ExtField7}", "ExtField7" },
                { "{ExtField8}", "ExtField8" },
                { "{ExtField9}", "ExtField9" },
                { "{ExtField10}", "ExtField10" },
                { "出库单编号", "OutNo" },
                { "出库单主题", "Title" },
                { "源单类型", "FromTypeName" },
                { "源单编号", "FromBillNo" },
                { "往来单位", "OtherCorpName" },
                { "往来单位类型", "CorpBigTypeName" },
                { "发货地址", "SendAddr" },
                { "收货地址", "ReceiveAddr" },
                { "经办人", "SenderName" },
                { "出库部门", "DeptName" },
                { "出库人", "TransactorName" },
                { "出库时间", "OutDate" },
                { "出库原因", "ReasonTypeName" },
                { "数量合计", "CountTotal" },
                // { "金额合计", "A_TotalPrice"},
                { "制单人", "CreatorName" },
                { "制单日期", "CreateDate" },
                { "确认人", "ConfirmorName" },
                { "确认日期", "ConfirmDate" },
                { "结单人", "CloserName" },
                { "结单日期", "CloseDate" },
                { "最后更新人", "ModifiedUserName" },
                { "最后更新日期", "ModifiedDate" },
                { "单据状态", "BillStatusName" },
                { "备注", "Remark" },
                { "所属项目", "ProjectName" },
                { "摘要", "Summary" },
            };

            if (HiddenMoreUnit.Value == "True")
            {
                aDetail = new string[, ] {
                    { "序号", "SortNo" },
                    { "物品编号", "ProductNo" },
                    { "物品名称", "ProductName" },
                    { "批次", "BatchNo" },
                    { "规格", "Specification" },
                    { "基本单位", "UnitID" },
                    { "基本数量", "ProductCount" },
                    { "单位", "UsedUnitName" },
                    { "仓库", "StorageName" },
                    { "退货数量", "BackCount" },
                    { "已出库数量", "OutedTotal" },
                    { "未出库数量", "NotOutCount" },
                    { "出库数量", "UsedUnitCount" },
                    { "单价", "UsedPrice" },
                    { "金额", "B_TotalPrice" },
                    { "备注", "DetaiRemark" },
                };
            }
            else
            {
                aDetail = new string[, ] {
                    { "序号", "SortNo" },
                    { "物品编号", "ProductNo" },
                    { "物品名称", "ProductName" },
                    { "批次", "BatchNo" },
                    { "规格", "Specification" },
                    { "单位", "UnitID" },
                    { "仓库", "StorageName" },
                    { "退货数量", "BackCount" },
                    { "已出库数量", "OutedTotal" },
                    { "未出库数量", "NotOutCount" },
                    { "出库数量", "ProductCount" },
                    { "单价", "UnitPrice" },
                    { "金额", "B_TotalPrice" },
                    { "备注", "DetaiRemark" },
                };
            }
        }



        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = XBase.Business.Office.SupplyChain.TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.StorageOutOther");
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 15; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion
        DataTable dbPrint = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMain  = StorageOutOtherBus.GetStorageOutOtherDetailInfo(OutOtherSellM_);
        // DataTable dtDetail = MRPBus.GetMRPDetailInfo(modelMRP);
        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
        {
            #region 未设置过打印模板设置 默认显示所有的
            isSeted.Value = "0";

            /*未设置过打印模板设置时,默认显示的字段  基本信息字段*/
            for (int m = 10; m < aBase.Length / 2; m++)
            {
                strBaseFields = strBaseFields + aBase[m, 1] + "|";
            }
            /*未设置过打印模板设置时,默认显示的字段 基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields = strBaseFields + "ExtField" + (i + 1) + "|";
                }
            }
            /*未设置过打印模板设置时,默认显示的字段 明细信息字段*/
            for (int n = 0; n < aDetail.Length / 2; n++)
            {
                strDetailFields = strDetailFields + aDetail[n, 1] + "|";
            }
            #endregion
        }

        #region 主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("其他出库单", strBaseFields.TrimEnd('|'), strDetailFields.TrimEnd('|'), aBase, aDetail, dtMain, dtMain, true);
        }
        #endregion

        #region 明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("销售出库单", strBaseFields.TrimEnd('|'), strDetailFields.TrimEnd('|'), aBase, aDetail, dtMain, dtMain, false);
        }
        #endregion
    }
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_SALE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_SELLOFFER;

        SellOfferModel modelMRP = new SellOfferModel();

        modelMRP.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        modelMRP.OfferNo   = this.OfferNo;

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "{ExtField1}",  "ExtField1"      },
            { "{ExtField2}",  "ExtField2"      },
            { "{ExtField3}",  "ExtField3"      },
            { "{ExtField4}",  "ExtField4"      },
            { "{ExtField5}",  "ExtField5"      },
            { "{ExtField6}",  "ExtField6"      },
            { "{ExtField7}",  "ExtField7"      },
            { "{ExtField8}",  "ExtField8"      },
            { "{ExtField9}",  "ExtField9"      },
            { "{ExtField10}", "ExtField10"     },

            { "单据编号",         "OfferNo"        },
            { "主题",           "Title"          },
            { "源单类型",         "FromTypeText"   },
            { "源单编号",         "ChanceNo"       },
            { "客户名称",         "CustName"       },
            { "客户电话",         "CustTel"        },
            { "业务类型",         "BusiTypeName"   },
            { "销售类别",         "SellTypeName"   },
            { "结算方式",         "PayTypeName"    },
            { "支付方式",         "MoneyTypeName"  },
            { "交货方式",         "TakeTypeName"   },
            { "运送方式",         "CarryTypeName"  },
            { "币种",           "CurrencyName"   },
            { "汇率",           "Rate"           },
            { "业务员",          "SellerName"     },
            { "部门",           "DeptName"       },
            { "报价日期",         "OfferDate"      },
            { "有效截止日期",       "ExpireDate"     },
            { "报价次数",         "QuoteTime"      },
            { "是否增值税",        "isAddTaxName"   },
            //{ "是否被引用", "Remark"},
            { "金额合计",         "TotalPrice"     },
            { "税额合计",         "TotalTax"       },
            { "含税金额合计",       "TotalFee"       },
            { "整单折扣(%)",      "Discount"       },
            { "折扣金额",         "DiscountTotal"  },
            { "折后含税金额 ",      "RealTotal"      },
            { "产品数量合计",       "CountTotal"     },
            { "单据状态",         "BillStatusText" },
            { "制单人",          "CreatorName"    },
            { "制单日期 ",        "CreateDate"     },
            { "确认人",          "ConfirmorName"  },
            { "确认日期",         "ConfirmDate"    },
            { "结单人",          "CloserName"     },
            { "结单日期",         "CloseDate"      },
            { "最后更新人",        "ModifiedUserID" },
            { "最后更新日期",       "ModifiedDate"   },
            { "交付说明",         "DeliverRemark"  },
            { "包装运输说明",       "PackTransit"    },
            { "付款说明",         "PayRemark"      },
            { "备注",           "Remark"         },
        };
        string[,] aDetail;
        //多计量单位
        if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
        {
            aDetail = new string[, ] {
                { "物品编号", "ProdNo" },
                { "物品名称", "ProductName" },
                { "规格", "Specification" },
                { "基本单位", "CodeName" },
                { "基本数量", "ProductCount" },
                { "单位", "UsedUnitName" },
                { "数量", "UsedUnitCount" },
                { "交货期限(天)", "SendTime" },
                { "包装要求", "TypeName" },
                { "单价", "UsedPrice" },
                { "含税价", "TaxPrice" },
                { "折扣(%)", "Discount" },
                { "税率(%)", "TaxRate" },
                { "含税金额", "TotalFee" },
                { "金额", "TotalPrice" },
                { "税额", "TotalTax" },
                { "备注 ", "Remark" },
            };
        }
        else
        {
            aDetail = new string[, ] {
                { "物品编号", "ProdNo" },
                { "物品名称", "ProductName" },
                { "规格", "Specification" },
                { "单位", "CodeName" },
                { "数量", "ProductCount" },
                { "交货期限(天)", "SendTime" },
                { "包装要求", "TypeName" },
                { "单价", "UnitPrice" },
                { "含税价", "TaxPrice" },
                { "折扣(%)", "Discount" },
                { "税率(%)", "TaxRate" },
                { "含税金额", "TotalFee" },
                { "金额", "TotalPrice" },
                { "税额", "TotalTax" },
                { "备注 ", "Remark" },
            };
        }

        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.SellOffer");
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 15; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion

        DataTable dbPrint         = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMRP           = SellOfferBus.GetRepOrder(OfferNo);       //SellChanceBus.GetRepOrder(ChanceNo);
        DataTable dtDetail        = SellOfferBus.GetRepOrderDetail(OfferNo); //SellPlanBus.GetOrderDetail(PlanNo);
        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 = "OfferNo|Title|FromTypeText|ChanceNo|CustName|CustTel|BusiTypeName|SellTypeName|PayTypeName|MoneyTypeName|" +
                            "TakeTypeName|CarryTypeName|CurrencyName|Rate|SellerName|DeptName|OfferDate|ExpireDate|QuoteTime|isAddTaxName|TotalPrice|" +
                            "TotalTax|TotalFee|Discount|DiscountTotal|RealTotal|CountTotal|BillStatusText|CreatorName|CreateDate|ConfirmorName|" +
                            "ConfirmDate|CloserName|CloseDate|ModifiedUserID|ModifiedDate|DeliverRemark|PackTransit|PayRemark|Remark";

            /*基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields = strBaseFields + "|" + "ExtField" + (i + 1);
                }
            }
            //多计量单位
            if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
            {
                strDetailFields = "ProdNo|ProductName|Specification|CodeName|ProductCount|UsedUnitName|UsedUnitCount|SendTime|TypeName|UsedPrice|TaxPrice|Discount|" +
                                  "TaxRate|TotalFee|TotalPrice|TotalTax|Remark";
            }
            else
            {
                strDetailFields = "ProdNo|ProductName|Specification|CodeName|ProductCount|SendTime|TypeName|UnitPrice|TaxPrice|Discount|" +
                                  "TaxRate|TotalFee|TotalPrice|TotalTax|Remark";
            }
        }

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

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