コード例 #1
0
    private void BindCheckType()
    {
        DataTable dt = StorageCheckBus.GetCheckType(UserInfo.CompanyCD);

        if (dt != null && dt.Rows.Count > 0)
        {
            ddlCheckType.DataSource     = dt;
            ddlCheckType.DataTextField  = "TypeName";
            ddlCheckType.DataValueField = "ID";
            ddlCheckType.DataBind();
        }
        ddlCheckType.Items.Insert(0, new ListItem("--请选择--", "0"));
    }
コード例 #2
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_STORAGECHECK;

        StorageCheck StorageCheckM_ = new StorageCheck();

        StorageCheckM_.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        StorageCheckM_.ID        = this.intMrpID;
        StorageCheckM_.CheckNo   = hidno.Value.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"     },
            { "盘点单编号",        "CheckNo"        },
            { "盘点单主题",        "Title"          },
            { "盘点仓库",         "StorageName"    },
            { "盘点类型",         "CheckTypeName"  },
            { "盘点部门",         "DeptName"       },
            { "盘点开始日期",       "CheckStartDate" },
            { "盘点结束日期",       "CheckEndDate"   },
            { "库存调整人",        "CheckUserName"  },
            { "经办人",          "TransactorName" },
            { "库存调整日期",       "CheckDate"      },
            { "现有存量合计",       "NowCount"       },
            { "实盘量合计",        "CheckCount"     },
            { "差异量合计",        "DiffCount"      },
            { "现存金额",         "NowMoney"       },
            { "实盘金额",         "CheckMoney"     },
            { "差异金额",         "DiffMoney"      },
            { "制单人",          "CreatorName"    },
            { "制单日期",         "CreateDate"     },
            { "确认人",          "ConfirmorName"  },
            { "确认日期",         "ConfirmDate"    },
            { "结单人",          "CloserName"     },
            { "结单日期",         "CloseDate"      },
            { "最后更新人",        "ModifiedUserID" },
            { "最后更新日期",       "ModifiedDate"   },
            { "单据状态",         "BillStatusName" },
            { "备注",           "Remark"         },
            { "摘要",           "Summary"        },
        };
        if (HiddenMoreUnit.Value == "True")
        {
            aDetail = new string[, ] {
                { "序号", "SortNo" },
                { "物品编号", "ProdNo" },
                { "物品名称", "ProductName" },
                { "批次", "BatchNo" },
                { "规格", "Specification" },
                { "基本单位", "UnitName" },
                { "基本数量", "CheckCount" },
                { "单位", "UsedUnitName" },
                { "成本单价", "UsedPrice" },
                { "现存数量", "NowCount" },
                { "实盘数量", "UsedUnitCount" },
                { "盈亏类型", "DiffTypeName" },
                { "差异量", "DiffCount" },
                { "备注", "Remark" },
            };
        }
        else
        {
            aDetail = new string[, ] {
                { "序号", "SortNo" },
                { "物品编号", "ProdNo" },
                { "物品名称", "ProductName" },
                { "批次", "BatchNo" },
                { "规格", "Specification" },
                { "单位", "UnitName" },
                { "成本单价", "StandardCost" },
                { "现存数量", "NowCount" },
                { "实盘数量", "CheckCount" },
                { "盈亏类型", "DiffTypeName" },
                { "差异量", "DiffCount" },
                { "备注", "Remark" },
            };
        }


        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = XBase.Business.Office.SupplyChain.TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.StorageCheck");
        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          = StorageCheckBus.StorageCheckGet(StorageCheckM_);
        DataTable dtDetail        = StorageCheckBus.GetStorageCheckDetail(StorageCheckM_);
        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, dtDetail, true);
        }
        #endregion

        #region 明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("期末盘点单", strBaseFields.TrimEnd('|'), strDetailFields.TrimEnd('|'), aBase, aDetail, dtMain, dtDetail, false);
        }
        #endregion
    }