public FISCA.Presentation.DetailContent GetContent() { var content = new FISCA.Presentation.DetailContent(); var Tcontent = new T(); content.Padding = new Padding(0); content.PrimaryKeyChanged += delegate { Tcontent.LoadContent(content.PrimaryKey); }; Tcontent.SaveButtonVisibleChanged += delegate { content.SaveButtonVisible = Tcontent.SaveButtonVisible; }; Tcontent.CancelButtonVisibleChanged += delegate { content.CancelButtonVisible = Tcontent.CancelButtonVisible; }; content.SaveButtonClick += delegate { Tcontent.Save(); }; content.CancelButtonClick += delegate { Tcontent.Undo(); }; content.Group = Tcontent.Title; content.Size = Tcontent.DisplayControl.Size; content.Controls.Add(Tcontent.DisplayControl); Tcontent.DisplayControl.BackColor = Color.Transparent; Tcontent.DisplayControl.Dock = DockStyle.Fill; if (Attribute.IsDefined(Tcontent.GetType(), typeof(FeatureCodeAttribute))) { FeatureCodeAttribute fca = Attribute.GetCustomAttribute(Tcontent.GetType(), typeof(FeatureCodeAttribute)) as FeatureCodeAttribute; if (fca != null) { if (!Framework.Legacy.GlobalOld.Acl[Tcontent.GetType()].Viewable) { return(null); } } } return(content); }
public UpdateRecordItem() { InitializeComponent(); Group = "異動資料"; BGWorker = new BackgroundWorker(); BGWorker.DoWork += new DoWorkEventHandler(BGWorker_DoWork); BGWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BGWorker_RunWorkerCompleted); SHUpdateRecord.AfterChange += new EventHandler <K12.Data.DataChangedEventArgs>(SHUpdateRecord_AfterChange); if (!string.IsNullOrEmpty(_StudentID)) { BGWorker.RunWorkerAsync(); } #region 限判斷程式碼。 //取得此 Class 定議的 FeatureCode。 FeatureCode = FeatureCodeAttribute.GetCode(this.GetType()); _permission = FISCA.Permission.UserAcl.Current[FeatureCode]; btnAdd.Visible = _permission.Editable; btnRemove.Visible = _permission.Editable; bthUpdate.Visible = _permission.Editable; btnView.Visible = !_permission.Editable; #endregion Disposed += new EventHandler(UpdateRecordItem_Disposed); }
protected void RaiseEvent() { if (_valueManager.IsDirty != _SaveButtonVisible) { //判斷權限 if (Attribute.IsDefined(GetType(), typeof(FeatureCodeAttribute))) { FeatureCodeAttribute fca = Attribute.GetCustomAttribute(GetType(), typeof(FeatureCodeAttribute)) as FeatureCodeAttribute; if (fca != null) { if (Framework.Legacy.GlobalOld.Acl[GetType()].Editable) { RefreshSaveButtonStatus(); } } } else //沒有定議權限就按照平常方法處理。 { RefreshSaveButtonStatus(); } if (this.CancelButtonVisibleChanged != null) { CancelButtonVisibleChanged.Invoke(this, new EventArgs()); } } }
public void AddDetailBulider(IDetailBulider item) { DetailContent content = item.GetContent(); if (content == null) { return; } if (Attribute.IsDefined(content.GetType(), typeof(FeatureCodeAttribute))) { FeatureCodeAttribute fca = Attribute.GetCustomAttribute(content.GetType(), typeof(FeatureCodeAttribute)) as FeatureCodeAttribute; if (fca != null) { if (Framework.Legacy.GlobalOld.Acl[content.GetType()].Viewable) { Present.AddDetailBulider(item); } } } else { Present.AddDetailBulider(item); } }
public SchoolYearScorePalmerworm() { InitializeComponent(); EventHub.Instance.ScoreChanged += new EventHandler <ScoreChangedEventArgs>(Instance_ScoreChanged); PreferenceUpdater.Instance.Items.Add(this); LoadPreference(); lvColumnManager1.DenyColumns.AddRange(new ColumnHeader[] { colSchoolYear, colGradeYear }); _bkwEntryLoader.DoWork += new DoWorkEventHandler(_bkwEntryLoader_DoWork); _bkwEntryLoader.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_bkwEntryLoader_RunWorkerCompleted); _bkwSubjectLoader.DoWork += new DoWorkEventHandler(_bkwSubjectLoader_DoWork); _bkwSubjectLoader.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_bkwSubjectLoader_RunWorkerCompleted); Application.Idle += new EventHandler(Application_Idle); //取得此 Class 定議的 FeatureCode。 FeatureCodeAttribute code = Attribute.GetCustomAttribute(this.GetType(), typeof(FeatureCodeAttribute)) as FeatureCodeAttribute; FeatureCode = code.FeatureCode; _permission = CurrentUser.Acl[FeatureCode]; btnAdd.Visible = _permission.Editable; btnDelete.Visible = _permission.Editable; btnModify.Visible = _permission.Editable; btnView.Visible = !_permission.Editable; }
public UpdatePalmerwormItem() { InitializeComponent(); Title = "異動資料"; //SmartSchool.StudentRelated.Student.Instance.NewUpdateRecord += new EventHandler(Instance_NewUpdateRecord); //取得此 Class 定議的 FeatureCode。 FeatureCodeAttribute code = Attribute.GetCustomAttribute(this.GetType(), typeof(FeatureCodeAttribute)) as FeatureCodeAttribute; FeatureCode = code.FeatureCode; _permission = FISCA.Permission.UserAcl.Current[FeatureCode]; btnAdd.Visible = _permission.Editable; btnRemove.Visible = _permission.Editable; bthUpdate.Visible = _permission.Editable; btnView.Visible = !_permission.Editable; }
public BeforeEnrollmentItem() { InitializeComponent(); prlp = new PermRecLogProcess(); Group = "前級畢業資訊"; #region 限判斷程式碼。 //取得此 Class 定議的 FeatureCode。 FeatureCode = FeatureCodeAttribute.GetCode(this.GetType()); _permission = FISCA.Permission.UserAcl.Current[FeatureCode]; txtClass.Enabled = _permission.Editable; txtMemo.Enabled = _permission.Editable; txtSchool.Enabled = _permission.Editable; txtSchoolLocation.Enabled = _permission.Editable; txtSeatNo.Enabled = _permission.Editable; #endregion }
public new void AddDetailBulider(IDetailBulider item) { DetailContent content = item.GetContent(); if (content == null) { return; } if (Attribute.IsDefined(content.GetType(), typeof(FeatureCodeAttribute))) { FeatureCodeAttribute fca = Attribute.GetCustomAttribute(content.GetType(), typeof(FeatureCodeAttribute)) as FeatureCodeAttribute; if (fca != null) { if (Framework.Legacy.GlobalOld.Acl[content.GetType()].Viewable) { base.AddDetailBulider(item); } } } else if (Attribute.IsDefined(content.GetType(), typeof(FISCA.Permission.FeatureCodeAttribute))) { FISCA.Permission.FeatureCodeAttribute fca = Attribute.GetCustomAttribute(content.GetType(), typeof(FISCA.Permission.FeatureCodeAttribute)) as FISCA.Permission.FeatureCodeAttribute; if (fca != null) { if (FISCA.Permission.UserAcl.Current[fca.Code].Viewable) { base.AddDetailBulider(item); } } } else { base.AddDetailBulider(item); } }