public PPTmpControl(CLCardTemplate tp, FrmModeling parent) { this.InitializeComponent(); this.m_tp = tp; this.frmParent = parent; this.InitializePages(); }
private void SelectTemplate() { if (this.lvwTemplates.SelectedItems.Count == 0) { MessageBoxPLM.Show("尚未选中模板。", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { DEBusinessItem item = null; if (this.SelectOldRevision) { if (this.selectedItem == null) { MessageBoxPLM.Show("尚未选中模板。", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } int revNum = Convert.ToInt32(this.numRevisions.Value); item = PLItem.Agent.GetBizItemByMaster(this.selectedItem.Master.Oid, revNum, PLOption.GetUserGlobalOption(this.user.Oid).CurView, this.user.Oid, BizItemMode.BizItem) as DEBusinessItem; this.SelectedTemplate = new CLCardTemplate(this.user.Oid, false, true, item); } else { item = PLItem.Agent.GetBizItemByMaster(this.selectedItem.Master.Oid, 0, PLOption.GetUserGlobalOption(ClientData.LogonUser.Oid).CurView, ClientData.LogonUser.Oid, BizItemMode.BizItem) as DEBusinessItem; this.SelectedTemplate = new CLCardTemplate(this.user.Oid, false, true, item); } try { this.SelectedTemplate.CheckProperties(); } catch (Exception exception) { MessageBoxPLM.Show("严重警告:该模板有关属性填写有错,不能选择该模板,请联系定制人员更正。\n详细信息是:" + exception.Message, "PPM警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } base.DialogResult = DialogResult.OK; } }
public FrmModeling(CLCardTemplate tp) { this.InitializeComponent(); this.m_tp = tp; this.Text = this.m_tp.Item.Master.Id; this.InitializeMyUI(); this.InitializePageControl(); }
private void InitializeData(CLCardTemplate tp, int countRows, int countColumns, string midBegin, string minEnd, bool readOnly) { this.m_tp = tp; this.countRows = countRows; this.countColumns = countColumns; this.midBegin = midBegin; this.midEnd = minEnd; }
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); }
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); }
public PPTmpPage(CLCardTemplate tp, string path, int countRows, int countColumns, string midBegin, string minEnd, bool readOnly) { this.filePath = ""; this.InitializeComponent(); this.Dock = DockStyle.Fill; this.InitializeData(tp, countRows, countColumns, midBegin, minEnd, readOnly); this.TemplateUrl = path; this.InitializeSheet(readOnly); this.InitializeProcess(); this.InitializeHistory(); }
public PPTmpControl(DEBusinessItem item, DEUser user, bool readOnly) { this.InitializeComponent(); this.m_tp = new CLCardTemplate(user.Oid, false, readOnly, item); try { this.m_tp.CheckProperties(); } catch (Exception exception) { MessageBox.Show("警告:模板范围和表中区域没有正确设置,请用编辑界面中的快捷菜单命令更正。\n详细信息是:" + exception.Message, "PPM警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } this.InitializePages(); }
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 tbcProperty_SelectedIndexChanged(object sender, EventArgs e) { if (this.tbcProperty.SelectedIndex == 0) { CLCardTemplate template = new CLCardTemplate(this.uOid, false, this.readOnly, this.pro.Item) { HasCover = this.chkCover.Checked, HasMainPage = this.chkMainPage.Checked, HasNextPage = this.chkNextPage.Checked }; this.pro.UpdateUI(template.Item, ModelContext.MetaModel.GetClassEx("PPCRDTEMPLATE"), this.uOid, this.readOnly); } }
public DlgAutoNumber(CLCardTemplate tp, bool isFromTiModeler) { this.InitializeComponent(); this.m_tp = tp; this.isTiModeler = isFromTiModeler; this.AutoNumberXml = this.m_tp.AutoNumber; this.hasNextPage = this.m_tp.HasNextPage; this.readOnly = this.m_tp.ReadOnly; this.allowUpdate = false; if (isFromTiModeler && ((this.m_tp.Item.State == ItemState.CheckIn) || (this.m_tp.Item.State == ItemState.Release))) { this.allowUpdate = true; } }
private void btnOK_Click(object sender, EventArgs e) { if (this.readOnly) { base.DialogResult = DialogResult.Cancel; base.Close(); } else if (this.pro.UpdateData(false)) { this.Item = this.pro.Item; if (this.pro.Item.Master.ClassName == "PPCRDTEMPLATE") { CLCardTemplate template = new CLCardTemplate(this.uOid, false, false, this.Item) { HasCover = this.chkCover.Checked, HasMainPage = this.chkMainPage.Checked, HasNextPage = this.chkNextPage.Checked }; try { template.CheckProperties(); } catch (Exception exception) { if (MessageBox.Show(exception.Message + "\n现在改正这些错误吗?选择“否”,将在下次提醒您更正该模板中的错误。", "PPM提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { return; } } Cursor current = Cursor.Current; Cursor.Current = Cursors.WaitCursor; try { if (this.updateDirectely) { template.Item.Iteration = PLItem.UpdateItemIterationDirectly(template.Item, this.uOid, false); } else { template.Item.Iteration = PLItem.UpdateItemIteration(template.Item.Iteration, this.uOid, false); } } catch (Exception exception2) { MessageBox.Show("更新模板属性失败!\n" + exception2.Message, "PPC - FrmBrowse", MessageBoxButtons.OK, MessageBoxIcon.Hand); return; } finally { Cursor.Current = current; } BizItemHandlerEvent.Instance.D_AfterIterationUpdated(BizOperationHelper.ConvertPLMBizItemDelegateParam(template.Item)); } base.DialogResult = DialogResult.OK; base.Close(); } }
private void InitializeData(Guid uOid, bool readOnly, bool updateDirectely, DEBusinessItem item) { this.uOid = uOid; this.readOnly = readOnly; this.updateDirectely = updateDirectely; this.Item = item; this.Text = this.Item.Master.Id + "的属性"; if (this.Item.Master.ClassName == "PPCRDTEMPLATE") { if (readOnly) { this.tbcProperty.TabPages.RemoveAt(1); } CLCardTemplate template = new CLCardTemplate(this.uOid, false, readOnly, this.Item); this.chkCover.Checked = template.HasCover; this.chkMainPage.Checked = template.HasMainPage; this.chkNextPage.Checked = template.HasNextPage; try { template.CheckProperties(); } catch (Exception exception) { MessageBox.Show("警告:模板范围和表中区域没有正确设置,请用编辑界面中的快捷菜单命令更正。\n详细信息是:" + exception.Message, "PPM警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { this.tbcProperty.TabPages.RemoveAt(1); } this.pro = new PropertyPanel(this.Item, ModelContext.MetaModel.GetClassEx(this.Item.Master.ClassName), uOid, readOnly); this.pro.Dock = DockStyle.Fill; this.tbcProperty.TabPages[0].Controls.Add(this.pro); if (readOnly) { this.btnOK.Visible = false; this.btnOK.Enabled = false; this.btnCancle.Text = "确定"; } }
public FrmModeling(DEBusinessItem item, DEUser user, bool readOnly) { this.InitializeComponent(); if (item.Iteration == null) { throw new Exception("取得的迭代为空。"); } this.m_tp = new CLCardTemplate(user.Oid, false, readOnly, item); this.Text = item.Master.Id; if (readOnly) { this.Text = this.Text + "(只读)"; } try { this.m_tp.CheckProperties(); } catch (Exception exception) { MessageBox.Show("警告:模板范围和表中区域没有正确设置,请用编辑界面中的快捷菜单命令更正。\n详细信息是:" + exception.Message, "PPM警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } this.InitializePageControl(); if (!readOnly) { this.InitializeMyUI(); } }
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; } }
public DlgNewGuid(string templateType, DEUser user) { this.InitializeComponent(); this.tvHeadItem = new UCSelectClass(false, SelectClassConstraint.BusinessItemClass); this.pnlHeadItem.Controls.Add(this.tvHeadItem); this.tvHeadItem.Dock = DockStyle.Fill; this.tvMainItem = new UCSelectClass(false, SelectClassConstraint.BusinessItemClass); this.pnlMainItem.Controls.Add(this.tvMainItem); this.tvMainItem.Dock = DockStyle.Fill; this.tmpType = templateType; try { this.m_tp = new CLCardTemplate(user.Oid, true, false, null); this.m_tp.UserName = user.Name; } catch (Exception exception) { throw new Exception("新建CLCardTemplate失败。", exception); } PLUser user2 = new PLUser(); int userSecurityByOid = user2.GetUserSecurityByOid(ClientData.LogonUser.Oid); if (userSecurityByOid == 0) { userSecurityByOid = 1; } this.cobGroup.Items.Clear(); for (int i = 1; i <= userSecurityByOid; i++) { this.cobGroup.Items.Add(i); } this.cobGroup.Enabled = true; ArrayList belongingProjGroupByUserOid = user2.GetBelongingProjGroupByUserOid(ClientData.LogonUser.Oid); if ((belongingProjGroupByUserOid != null) && (belongingProjGroupByUserOid.Count > 0)) { this.cobGroup.DataSource = belongingProjGroupByUserOid; this.cobGroup.DisplayMember = "Name"; this.cobGroup.ValueMember = "Oid"; } else { this.cobGroup.Enabled = false; } string clsname = "PPCRDTEMPLATE"; bool isGenIdInServer = false; this.txtId.Text = PLItem.GetIDAtNew(clsname, out isGenIdInServer); this.txtId.Tag = isGenIdInServer; if (isGenIdInServer) { this.txtId.Text = "自动生成"; } if (!string.IsNullOrEmpty(this.txtId.Text)) { this.txtId.ReadOnly = true; this.btnCode.Enabled = false; } else { this.txtId.ReadOnly = false; this.btnCode.Enabled = true; } this.SetTreeViewState(templateType); }
public DlgChangeHeadMainItem(CLCardTemplate tp) { this.InitializeComponent(); this.m_tp = tp; this.InitializeUI(); }