Example #1
0
        public List<TemplatePageParam> TemplatePages = new List<TemplatePageParam>();   // 定制的页面

        // 从Application对象中装载数据
        public virtual void LoadData(ApplicationInfo ai,
            string strPath)
        {
            this.PageHeader = ai.GetString(strPath,
                "PageHeader", this.PageHeaderDefault);

                // "%date% 册移交清单 - %barcodefilename% - (共 %pagecount% 页)");
            this.PageFooter = ai.GetString(strPath,
                "PageFooter", this.PageFooterDefault);
            // "%pageno%/%pagecount%");

            this.TableTitle = ai.GetString(strPath,
                "TableTitle", this.TableTitleDefault);
            
            // "%date% 册移交清单");

            this.LinesPerPage = ai.GetInt(strPath,
                "LinesPerPage", this.LinesPerPageDefault);
            
            // 20);

            int nCount = ai.GetInt(strPath, "ColumnsCount", 0);
            if (nCount != 0) // 只有当外部存储中有配置信息时,才清除构造函数创建的缺省信息
            {
                Columns.Clear();
                for (int i = 0; i < nCount; i++)
                {
                    string strColumnName = ai.GetString(strPath,
                        "ColumnName_" + i.ToString(),
                        "");
                    if (String.IsNullOrEmpty(strColumnName) == true)
                        break;

                    string strColumnCaption = ai.GetString(strPath,
                        "ColumnCaption_" + i.ToString(),
                        "");

                    int nMaxChars = ai.GetInt(strPath,
                        "ColumnMaxChars_" + i.ToString(),
                        -1);
                    int nWidthChars = ai.GetInt(strPath,
    "ColumnWidthChars_" + i.ToString(),
    -1);

                    string strEvalue = ai.GetString(strPath,
    "ColumnEvalue_" + i.ToString(),
    "");


                    Column column = new Column();
                    column.Name = strColumnName;
                    column.Caption = strColumnCaption;
                    column.WidthChars = nWidthChars;
                    column.MaxChars = nMaxChars;
                    column.Evalue = strEvalue;

                    this.Columns.Add(column);
                }
            }

            nCount = ai.GetInt(strPath, "TemplatePagesCount", 0);
            if (nCount != 0) // 只有当外部存储中有配置信息时,才清除构造函数创建的缺省信息
            {
                this.TemplatePages.Clear();
                for (int i = 0; i < nCount; i++)
                {
                    TemplatePageParam param = new TemplatePageParam();
                    param.Caption = ai.GetString(strPath,
                        "TemplateCaption_" + i.ToString(),
                        "");
                    param.FilePath = ai.GetString(strPath,
                        "TemplateFilePath_" + i.ToString(),
                        "");

                    Debug.Assert(String.IsNullOrEmpty(this.DataDir) == false, "");

                    param.FilePath = UnMacroPath(param.FilePath);

                    Debug.Assert(param.FilePath.IndexOf("%") == -1, "去除宏以后的路径字符串里面不能有%符号");

                    this.TemplatePages.Add(param);
                }
            }
        }
Example #2
0
        private void button_OK_Click(object sender, EventArgs e)
        {
            PrintOption.PageHeader = this.textBox_pageHeader.Text;
            PrintOption.PageFooter = this.textBox_pageFooter.Text;

            PrintOption.TableTitle = this.textBox_tableTitle.Text;

            try
            {
                PrintOption.LinesPerPage = Convert.ToInt32(this.textBox_linesPerPage.Text);
            }
            catch
            {
                MessageBox.Show(this, "每页行数值必须为纯数字");
                return;
            }



            PrintOption.Columns.Clear();
            for (int i = 0; i < this.listView_columns.Items.Count; i++)
            {
                ListViewItem item = this.listView_columns.Items[i];

                Column column = new Column();
                column.Name = ListViewUtil.GetItemText(item, COLUMN_NAME); // item.Text;
                column.Caption = ListViewUtil.GetItemText(item, COLUMN_CAPTION);  // item.SubItems[1].Text;

                try
                {
                    column.WidthChars = Convert.ToInt32(
                        ListViewUtil.GetItemText(item, COLUMN_WIDTHCHARS)
                        // item.SubItems[2].Text
                        );
                }
                catch
                {
                    column.WidthChars = -1;
                }

                try
                {
                    column.MaxChars = Convert.ToInt32(
                        ListViewUtil.GetItemText(item, COLUMN_MAXCHARS)
                        // item.SubItems[2].Text
                        );
                }
                catch
                {
                    column.MaxChars = -1;
                }

                column.Evalue = ListViewUtil.GetItemText(item, COLUMN_EVALUE);

                PrintOption.Columns.Add(column);
            }

            // 兑现最后一次对textbox的修改
            this.RefreshContentToTemplateFile();

            /*
            // 保存模板列表
            if (this.m_bTempaltesChanged == true)
            {
                PrintOption.TemplatePages.Clear();
                for (int i = 0; i < this.listView_templates.Items.Count; i++)
                {
                    ListViewItem item = this.listView_templates.Items[i];

                    TemplatePageParam param = new TemplatePageParam();
                    param.Caption = item.Text;
                    param.FilePath = ListViewUtil.GetItemText(item, 1);

                    PrintOption.TemplatePages.Add(param);
                }

                this.m_bTempaltesChanged = false;
            }

            this.m_newCreateTemplateFiles.Clear();  // 避免后面Closing()处理中不小心删除刚刚创建的文件
             * */
            SaveTemplatesChanges();

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Example #3
0
        string PublicationType = "图书"; // 图书 连续出版物

        public AccountBookPrintOption(string strDataDir,
            string strPublicationType)
        {
            this.DataDir = strDataDir;
            this.PublicationType = strPublicationType;

            this.PageHeaderDefault = "%date% 财产帐簿 -- 来源 %sourcedescription% -- (共 %pagecount% 页)";
            this.PageFooterDefault = "%pageno%/%pagecount%";

            this.TableTitleDefault = "%date% 财产帐簿";

            this.LinesPerPageDefault = 20;

            // 2008/9/5 
            // Columns缺省值
            Columns.Clear();

            // "no -- 序号",
            Column column = new Column();
            column.Name = "no -- 序号";
            column.Caption = "序号";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "barcode -- 册条码号"
            column = new Column();
            column.Name = "barcode -- 册条码号";
            column.Caption = "册条码号";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "accessNo -- 索取号"
            column = new Column();
            column.Name = "accessNo -- 索取号";
            column.Caption = "索取号";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "summary -- 摘要"
            column = new Column();
            column.Name = "summary -- 摘要";
            column.Caption = "摘要";
            column.MaxChars = 15;
            this.Columns.Add(column);

            // "location -- 馆藏地点"
            column = new Column();
            column.Name = "location -- 馆藏地点";
            column.Caption = "馆藏地点";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "price -- 册价格"
            column = new Column();
            column.Name = "price -- 册价格";
            column.Caption = "册价格";
            column.MaxChars = -1;
            this.Columns.Add(column);

            /* 缺省时不要包含这个栏目。
            // "biblioPrice -- 种价格"
            column = new Column();
            column.Name = "biblioPrice -- 种价格";
            column.Caption = "种价格";
            column.MaxChars = -1;
            this.Columns.Add(column);
             * */

            // "biblioRecpath -- 种记录路径"
            column = new Column();
            column.Name = "biblioRecpath -- 种记录路径";
            column.Caption = "种记录路径";
            column.MaxChars = -1;
            this.Columns.Add(column);
        }
Example #4
0
        string PublicationType = "图书"; // 图书 连续出版物

        public ItemHandoverPrintOption(string strDataDir,
            string strPublicationType)
        {
            this.DataDir = strDataDir;
            this.PublicationType = strPublicationType;

            this.PageHeaderDefault = "%date% 册移交清单 -- 批次号: %batchno% -- 馆藏地点: %location% -- (共 %pagecount% 页)";
            this.PageFooterDefault = "%pageno%/%pagecount%";

            this.TableTitleDefault = "%date% 册移交清单";

            this.LinesPerPageDefault = 20;

            // 2008/9/5
            // Columns缺省值
            Columns.Clear();

            // "no -- 序号",
            Column column = new Column();
            column.Name = "no -- 序号";
            column.Caption = "序号";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "barcode -- 册条码号"
            column = new Column();
            column.Name = "barcode -- 册条码号";
            column.Caption = "册条码号";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "accessNo -- 索取号"
            column = new Column();
            column.Name = "accessNo -- 索取号";
            column.Caption = "索取号";
            column.MaxChars = -1;
            this.Columns.Add(column);



            // "summary -- 摘要"
            column = new Column();
            column.Name = "summary -- 摘要";
            column.Caption = "摘要";
            column.MaxChars = 50;
            this.Columns.Add(column);


            // "location -- 馆藏地点"
            column = new Column();
            column.Name = "location -- 馆藏地点";
            column.Caption = "-----馆藏地点-----";  // 确保列的宽度的一种简单办法
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "price -- 册价格"
            column = new Column();
            column.Name = "price -- 册价格";
            column.Caption = "册价格";
            column.MaxChars = -1;
            this.Columns.Add(column);

            /* 缺省时不包含种价格
            // "biblioPrice -- 种价格"
            column = new Column();
            column.Name = "biblioPrice -- 种价格";
            column.Caption = "种价格";
            column.MaxChars = -1;
            this.Columns.Add(column);
             * */

            // "biblioRecpath -- 种记录路径"
            column = new Column();
            column.Name = "biblioRecpath -- 种记录路径";
            column.Caption = "种记录路径";
            column.MaxChars = -1;
            this.Columns.Add(column);
        }
Example #5
0
        public PrintBindingPrintOption(string strDataDir,
            string strPublicationType)
        {
            Debug.Assert(this.PublicationType == "连续出版物", "目前仅支持连续出版物");


            this.DataDir = strDataDir;
            this.PublicationType = strPublicationType;

            this.PageHeaderDefault = "%date% 装订单 - 来自: %sourcedescription%";
            this.PageFooterDefault = "";

            this.TableTitleDefault = "合订册";

            this.LinesPerPageDefault = 20;

            // Columns缺省值
            Columns.Clear();

            // "missing -- 缺期状态",
            Column column = new Column();
            column.Name = "missing -- 缺期状态";
            column.Caption = "缺期状态";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "publishTime -- 出版日期",
            column = new Column();
            column.Name = "publishTime -- 出版日期";
            column.Caption = "出版日期";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "volume -- 卷期号"
            column = new Column();
            column.Name = "volume -- 卷期号";
            column.Caption = "卷期号";
            column.MaxChars = -1;
            this.Columns.Add(column);


            // "barcode -- 册条码号"
            column = new Column();
            column.Name = "barcode -- 册条码号";
            column.Caption = "册条码号";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "intact -- 完好率"
            column = new Column();
            column.Name = "intact -- 完好率";
            column.Caption = "完好率";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "refID -- 参考ID"
            column = new Column();
            column.Name = "refID -- 参考ID";
            column.Caption = "参考ID";
            column.MaxChars = -1;
            this.Columns.Add(column);

        }
Example #6
0
        public SettlementPrintOption(string strDataDir)
        {
            this.DataDir = strDataDir;

            this.PageHeaderDefault = "%date% 收费结算清单 - (共 %pagecount% 页)";
            this.PageFooterDefault = "%pageno%/%pagecount%";

            this.TableTitleDefault = "%date% 收费结算清单";

            this.LinesPerPageDefault = 20;

            // Columns缺省值
            Columns.Clear();

            // "id -- 记录ID",
            Column column = new Column();
            column.Name = "id -- 记录ID";
            column.Caption = "记录ID";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "readerBarcode -- 读者证条码号",
            column = new Column();
            column.Name = "readerBarcode -- 读者证条码号";
            column.Caption = "读者证条码号";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "reason -- 原因",
            column = new Column();
            column.Name = "reason -- 原因";
            column.Caption = "原因";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "price -- 金额",
            column = new Column();
            column.Name = "price -- 金额";
            column.Caption = "金额";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "amerceOperator -- 收费者",
            column = new Column();
            column.Name = "amerceOperator -- 收费者";
            column.Caption = "收费者";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "amerceTime -- 收费日期",
            column = new Column();
            column.Name = "amerceTime -- 收费日期";
            column.Caption = "收费日期";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "settlementOperator -- 结算者",
            column = new Column();
            column.Name = "settlementOperator -- 结算者";
            column.Caption = "结算者";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "settlementTime -- 结算日期",
            column = new Column();
            column.Name = "settlementTime -- 结算日期";
            column.Caption = "结算日期";
            column.MaxChars = -1;
            this.Columns.Add(column);

            // "recpath -- 记录路径"
            column = new Column();
            column.Name = "recpath -- 记录路径";
            column.Caption = "记录路径";
            column.MaxChars = -1;
            this.Columns.Add(column);

        }