Exemplo n.º 1
0
 private void DlgAutoNumber_Load(object sender, EventArgs e)
 {
     if (this.isTiModeler)
     {
         this.rbtCurrentPage.Enabled = false;
     }
     if (!this.hasNextPage)
     {
         this.cmbNextPageCol.Enabled = false;
     }
     if (this.readOnly)
     {
         this.rbtAllPages.Enabled = false;
         this.groupBox1.Enabled   = false;
         this.groupBox2.Enabled   = false;
         if (this.allowUpdate)
         {
             if (this.m_tp.AutoNumber == null)
             {
                 this.btnOK.Text = "设置";
             }
             else
             {
                 this.btnOK.Text = "更新";
             }
         }
         else
         {
             this.btnOK.Visible  = false;
             this.btnCancel.Text = "确定";
         }
     }
     if ((this.AutoNumberXml != null) && (this.AutoNumberXml.ToString() != ""))
     {
         AutoNumber number = PPCardCompiler.ExplainAutoNumberXML(this.AutoNumberXml);
         this.txtPrefix.Text      = number.Prefix;
         this.txtPostfix.Text     = number.Postfix;
         this.numStart.Value      = number.Start;
         this.cmbInterval.Text    = number.Interval.ToString();
         this.cmbMainPageCol.Text = PPCConvert.Int2ABC(number.ColAtMainPage);
         this.cmbNextPageCol.Text = PPCConvert.Int2ABC(number.ColAtNextPage);
     }
 }
Exemplo n.º 2
0
 private void GetColList(ArrayList midColLstOfMain, ArrayList midColLstOfNext)
 {
     try {
         if (this.m_tp != null)
         {
             int num  = PPCConvert.Address2Col(this.m_tp.MidBeginOfMain);
             int num2 = PPCConvert.Address2Col(this.m_tp.MidEndOfMain);
             int num3 = PPCConvert.Address2Col(this.m_tp.MidBeginOfNext);
             int num4 = PPCConvert.Address2Col(this.m_tp.MidEndOfNext);
             int row  = PPCConvert.Address2Row(this.m_tp.MidBeginOfMain);
             int num6 = PPCConvert.Address2Row(this.m_tp.MidBeginOfNext);
             if (base.Parent.Text == "首页")
             {
                 for (int i = num; i <= num2; i++)
                 {
                     if (this.GetFirstCell(PPCConvert.RowCol2Address(row, i)) == PPCConvert.RowCol2Address(row, i))
                     {
                         midColLstOfMain.Add(PPCConvert.Int2ABC(i));
                         midColLstOfNext.Add(PPCConvert.Int2ABC(i));
                     }
                 }
             }
             else if (base.Parent.Text == "续页")
             {
                 for (int j = num3; j <= num4; j++)
                 {
                     if (this.GetFirstCell(PPCConvert.RowCol2Address(num6, j)) == PPCConvert.RowCol2Address(num6, j))
                     {
                         midColLstOfNext.Add(PPCConvert.Int2ABC(j));
                         midColLstOfMain.Add(PPCConvert.Int2ABC(j));
                     }
                 }
             }
         }
     } catch (Exception exception) {
         throw new Exception("获取首页或续页的表中有效列出错。" + exception.Message);
     }
 }