Ejemplo n.º 1
0
 private void OnAutoNumber(object sender, EventArgs e)
 {
     try {
         DEMetaAttribute attribute = ModelContext.MetaModel.GetAttribute("PPCRDTEMPLATE", "AUTONUMBER");
         if (attribute == null)
         {
             MessageBox.Show("请先为“卡片模板”类定制“自动编号规则(AUTONUMBER)”属性,长度应不小于100。", "PPM", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             DlgAutoNumber number = new DlgAutoNumber(this.m_tp, true);
             if (number.ShowDialog() == DialogResult.OK)
             {
                 string str = PPCardCompiler.CreateXML(number.NumberFormat);
                 if (str.Length > attribute.Size)
                 {
                     MessageBox.Show(string.Concat(new object[] { "设置自动编号规则形成的脚本长度 ", str.Length.ToString(), " 超过了“卡片模板”类属性“AUTONUMBER”的长度 ", attribute.Size, " 。\n请修改该属性的长度,否则模板将不会保存该规则。" }), "PPM", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 }
                 else
                 {
                     this.m_tp.AutoNumber = str;
                     this.m_tp.IsSaved    = false;
                 }
             }
         }
     } catch (Exception exception) {
         MessageBox.Show("自动编号规则设置出错,请重试。具体原因为:\n" + exception.Message, "PPM", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Ejemplo n.º 2
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     try {
         if (this.allowUpdate)
         {
             if ((this.btnOK.Text == "更新") || (this.btnOK.Text == "设置"))
             {
                 this.rbtAllPages.Enabled = true;
                 this.groupBox1.Enabled   = true;
                 this.groupBox2.Enabled   = true;
                 if (!this.hasNextPage)
                 {
                     this.cmbNextPageCol.Enabled = false;
                 }
                 this.btnOK.Text = "确定";
             }
             else if (this.btnOK.Text == "确定")
             {
                 string attrValue = PPCardCompiler.CreateXML(this.NumberFormat);
                 this.m_tp.Item.Iteration.SetAttrValue("AUTONUMBER", attrValue);
                 PLItem.UpdateItemIterationDirectly(this.m_tp.Item, this.m_tp.UserOid, false);
                 base.DialogResult = DialogResult.OK;
             }
         }
         else
         {
             AutoNumber numberFormat = this.NumberFormat;
             base.DialogResult = DialogResult.OK;
         }
     } catch {
         MessageBox.Show("自动编号设置出错。", ConstCommon.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 4
0
        private void OnInsertProcessRecord(object sender, EventArgs e)
        {
            ArrayList list = new ArrayList(this.lstProcess.Count);

            foreach (CLState state in this.lstProcess)
            {
                list.Add(state.CellSign);
            }
            DlgProcessList list2 = new DlgProcessList(this.lstProcess, this.readOnly);

            list2.ShowDialog();
            if (!this.readOnly)
            {
                foreach (string str in list)
                {
                    this.SetCellValue(str, "");
                }
                this.lstProcess = list2.Processes;
                foreach (CLState state2 in this.lstProcess)
                {
                    this.SetCellValue(state2.CellSign, PPCardCompiler.CreateXML(state2));
                }
            }
        }
Ejemplo n.º 5
0
        private void OnInsertModifyRecord(object sender, EventArgs e)
        {
            ArrayList list = new ArrayList(this.lstHistory.Count);

            foreach (CLHistory history in this.lstHistory)
            {
                list.Add(history.CellSign);
            }
            DlgHistoryList list2 = new DlgHistoryList(this.lstHistory, this.readOnly);

            list2.ShowDialog();
            if (!this.readOnly)
            {
                foreach (string str in list)
                {
                    this.SetCellValue(str, "");
                }
                this.lstHistory = list2.Histories;
                foreach (CLHistory history2 in this.lstHistory)
                {
                    this.SetCellValue(history2.CellSign, PPCardCompiler.CreateXML(history2));
                }
            }
        }
Ejemplo n.º 6
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            PPCardCell cardCell = this.CardCell;

            if ((cardCell.AttributeName == "") || (cardCell.ClassName == ""))
            {
                MessageBox.Show("有关属性没有定制或者没有正确定制,请检查并更正。", "工艺", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else if ((!this.IsPrintTemplate && (((this.m_tp.HeadClass != ((string)this.txtField.Tag)) && ModelContext.MetaModel.IsCard(this.txtField.Tag as string)) || this.rbtMid.Checked)) && ((cardCell.LeftClassName == "") || (cardCell.LeftRelName == "")))
            {
                MessageBox.Show("关联关系没有定制,请检查并更正。", "工艺", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else if (cardCell.IsBarcode && (cardCell.BarcodeTemplate == ""))
            {
                MessageBox.Show("条码输出没有选择条码模板,请检查并更正。", "工艺", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else if ((!this.IsPrintTemplate && (cardCell.DataType == 9)) && (cardCell.Area != PPCardArea.Head))
            {
                MessageBox.Show("只有表头才能绑定网格类型,请检查并更正。", "工艺", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                if (this.pnlGrid.Visible)
                {
                    if (!CLPPFile.CheckAddress(cardCell.Address))
                    {
                        MessageBox.Show("网格的起始单元格格式不对。", "工艺", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                    if (!CLPPFile.CheckAddress(cardCell.Address2))
                    {
                        MessageBox.Show("网格的结束单元格格式不对。", "工艺", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
                if (cardCell.IsSubKey)
                {
                    if (!HasKey)
                    {
                        MessageBox.Show("您还没有设置关键列,不能设置子关键列。", "工艺", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                    if (cardCell.IsKey)
                    {
                        MessageBox.Show("一列不能既设置成关键列,又设置成子关键列。", "工艺", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
                this.rtxScript.Text = PPCardCompiler.CreateXML(cardCell);
                ccFavorite          = new PPCardCell(cardCell);
                ccFavorite.Script   = "";
                if (cardCell.IsKey)
                {
                    HasKey = true;
                }
                else if (cardCell.IsSubKey)
                {
                    HasSubKey = true;
                }
                base.DialogResult = DialogResult.OK;
            }
        }