private bool ValidateKeyCell(ArrayList midBindCells, string pageLabel) { if ((midBindCells != null) && (midBindCells.Count != 0)) { PPCardCell cell = null; PPCardCell cell2 = null; foreach (PPCardCell cell3 in midBindCells) { if (cell3.IsKey) { cell = cell3; } else if (cell3.IsSubKey) { cell2 = cell3; } if ((cell != null) && (cell2 != null)) { break; } } if ((cell == null) && (cell2 != null)) { MessageBox.Show(pageLabel + cell2.Address + "设置了子关键列,但是没有设置关键列。必须设置关键列,或者取消子关键列的设置。", "PPM", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(false); } if (((cell != null) && (cell2 != null)) && (cell.ClassName != cell2.LeftClassName)) { MessageBox.Show(pageLabel + "子关键列“" + FormulaCommon2.GetClassLabel(cell2.ClassName) + "”不是关键列“" + FormulaCommon2.GetClassLabel(cell.ClassName) + "”的子对象,请参看子关键列说明。", "PPM", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(false); } } return(true); }
public DlgOption2(PPCardCell cc, bool isCAPP, CLCardTemplate tp) { this.address = ""; this.cobIndex = -2; this.m_tp = tp; this.IsPrintTemplate = !isCAPP; this.InitializeComponent(); this.InitializeImageList(); this.InitBarcodeTemplete(); this.readOnly = true; this.CCInit = cc; }
private void DlgOption2_Load(object sender, EventArgs e) { if (this.cobIndex > -2) { this.cobAttrList.SelectedIndex = this.cobIndex; } if (this.IsPrintTemplate) { this.InitBoolComBox(); } this.InitUltraEditor(); try { this.CardCell = this.CCInit; } catch (Exception exception) { MessageBox.Show(exception.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); base.Close(); return; } this.CCInit = null; }
public ArrayList GetMidBindCells() { ArrayList list = new ArrayList(); if ((this.midBegin != null) && (this.midEnd != null)) { int row = PPCConvert.Address2Row(this.midBegin); int num2 = PPCConvert.Address2Col(this.midBegin); int num3 = PPCConvert.Address2Col(this.midEnd); for (int i = num2; i <= num3; i++) { if ((this.GetCellValue(row, i) != null) && (this.GetCellValue(row, i) != string.Empty)) { PPCardCell cc = new PPCardCell(); PPCardCompiler.ExplainXml(this.GetCellValue(row, i), cc); list.Add(cc); } } } return(list); }
public string GetMainItem() { int row = PPCConvert.Address2Row(this.midBegin); int num2 = PPCConvert.Address2Col(this.midBegin); int num3 = PPCConvert.Address2Col(this.midEnd); for (int i = num2; i <= num3; i++) { string cellValue = this.GetCellValue(row, i); if ((cellValue != null) && (cellValue != "")) { PPCardCell cc = new PPCardCell(); PPCardCompiler.ExplainXml(cellValue, cc); if (((cc != null) && (cc.Area == PPCardArea.Mid)) && (cc.Attachment == PPCellAttach.Option)) { return(cc.ClassName); } } } return(""); }
public DlgOption2(string script, PPCardArea area, bool readOnly, string address, bool isCAPP, string tmpType, CLCardTemplate tp) { this.address = ""; this.cobIndex = -2; this.m_tp = tp; this.IsPrintTemplate = !isCAPP; this.readOnly = readOnly; this.area = area; this.InitializeComponent(); this.InitializeImageList(); this.InitBarcodeTemplete(); if (!readOnly) { this.CreateTypeTree(this.tvwType); } this.CCInit = ccFavorite; if (this.CCInit == null) { this.CCInit = new PPCardCell(); } this.CCInit.Address = address; this.address = address; this.CCInit.IsKey = false; this.CCInit.IsSubKey = false; this.CCInit.AttributeName = ""; if ((script != "") && (script.IndexOf("<") >= 0)) { PPCardCompiler.ExplainXml(script, this.CCInit); this.area = this.CCInit.Area; } if ((this.CCInit.ClassName == "") && (this.area == PPCardArea.Head)) { this.CCInit.ClassName = tmpType; } this.tbcData.SelectedTab = this.tabBinding; if (this.CCInit.IsKey) { this.chkKey.Enabled = true; this.chkSubKey.Enabled = false; } else if (this.CCInit.IsSubKey) { this.chkKey.Enabled = false; this.chkSubKey.Enabled = true; } else { this.chkKey.Enabled = !HasKey; this.chkSubKey.Enabled = !HasSubKey; } if (this.area == PPCardArea.Mid) { this.rbtMid.Checked = true; this.CCInit.Area = PPCardArea.Mid; } else { this.chkKey.Checked = false; this.chkKey.Enabled = false; this.chkSubKey.Checked = false; this.chkSubKey.Enabled = false; this.rbtMid.Checked = false; this.CCInit.Area = PPCardArea.Head; } }
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; } }