示例#1
0
        private void OnFunction(object sender, EventArgs e)
        {
            ArrayList midColLstOfMain = new ArrayList();
            ArrayList midColLstOfNext = new ArrayList();

            this.GetColList(midColLstOfMain, midColLstOfNext);
            CLFunction func      = new CLFunction();
            string     cellValue = this.GetCellValue(this.curCell);

            if ((cellValue != null) && (cellValue != ""))
            {
                PPCardCompiler.ExplainXml(cellValue, func);
            }
            else
            {
                func.ColInMainPage     = func.ColInNextPage = PPCConvert.Address2ColName(this.GetFirstCell(this.curCell));
                func.FuncType          = ((MenuItemEx)sender).Text;
                func.DisplayInLastPage = true;
                if (func.FuncType == "单页列小计")
                {
                    func.DisplayInLastPage = false;
                }
            }
            DlgFunction function2 = new DlgFunction(this.m_tp, midColLstOfMain, midColLstOfNext, base.Parent.Text == "首页", func, this.readOnly);

            if ((function2.ShowDialog() == DialogResult.OK) && (function2.script != null))
            {
                this.SetCellValue(this.curCell, function2.script);
            }
        }
示例#2
0
 public DlgFunction(CLCardTemplate tp, bool isMain, CLFunction func)
 {
     this.InitializeComponent();
     this.m_tp         = tp;
     this.isMainPage   = isMain;
     this.functionType = this.Text = func.FuncType;
     this.InitialColumn(null, null, func);
     this.SetControlState(true);
 }
示例#3
0
 private void CreateScript()
 {
     if (this.CheckEnough())
     {
         if ((this.colInNext == null) || (this.colInNext == ""))
         {
             this.colInNext = this.colInMain;
         }
         CLFunction func = new CLFunction(this.functionType, this.colInMain, this.colInNext, this.chkOnlyLastPage.Checked);
         this.script = PPCardCompiler.CreateXML(func);
     }
 }
示例#4
0
 private void InitialColumn(ArrayList midColLstOfMain, ArrayList midColLstOfNext, CLFunction func)
 {
     if (this.isMainPage || (this.functionType != "单页列小计"))
     {
         this.cmbMainPage.DataSource = midColLstOfMain;
         if (!string.IsNullOrEmpty(func.ColInMainPage))
         {
             if (this.cmbMainPage.Items.Count == 0)
             {
                 this.cmbMainPage.Items.Add(func.ColInMainPage);
             }
             this.cmbMainPage.Text = func.ColInMainPage;
         }
     }
     if (this.m_tp.HasNextPage && (!this.isMainPage || (this.functionType != "单页列小计")))
     {
         this.cmbNextPage.DataSource = midColLstOfNext;
         if (!string.IsNullOrEmpty(func.ColInNextPage))
         {
             if (this.cmbNextPage.Items.Count == 0)
             {
                 this.cmbNextPage.Items.Add(func.ColInNextPage);
             }
             this.cmbNextPage.Text = func.ColInNextPage;
         }
     }
     this.chkOnlyLastPage.Checked = func.DisplayInLastPage;
 }
示例#5
0
 public DlgFunction(CLCardTemplate tp, ArrayList midColLstOfMain, ArrayList midColLstOfNext, bool isMain, CLFunction func, bool readOnly)
 {
     this.InitializeComponent();
     this.m_tp         = tp;
     this.isMainPage   = isMain;
     this.functionType = this.Text = func.FuncType;
     this.InitialColumn(midColLstOfMain, midColLstOfNext, func);
     this.SetControlState(readOnly);
 }