protected override void AfterAdd(DataRow row) { officeDB.OfficerDelegateRow dr = (officeDB.OfficerDelegateRow)row; string ObjectName = this.myDT.TableName; dr.Id = this.myA.AtMng.PKIDGet(ObjectName, 1); dr.WorkAs = false; dr.AccessLevel = 0; }
protected override void AfterUpdate(DataRow dr) { //need to commit efore doing security op // myA.AtMng.AppMan.Commit(); //TODO: this code probably shouldn't be in afterupdate now that we have gone to a single web-call officeDB.OfficerDelegateRow odr = (officeDB.OfficerDelegateRow)dr; myLoadedDels.Remove(odr.DelegateToId); SetDelegateSecurity(odr); }
public void SetDelegateSecurity(officeDB.OfficerDelegateRow odr) { if (odr.WorkAs) { officeDB.OfficerRow or = odr.OfficerRowByOfficerWorkAs; if (or == null) { or = myA.AtMng.GetOfficeForOfficer(odr.DelegateToId).GetOfficer().Load(odr.DelegateToId); } SecurityDB.secUserRow sur = myA.AtMng.SecurityManager.GetsecUser().GetSecUserForOfficer(or); if (!odr.OfficerRow.IsMyFileIdNull()) { myA.GetOfficer().AddUserFileRule(sur.UserId, myA.AtMng.GetFile(odr.OfficerRow.MyFileId).CurrentFile, (int)atSecurity.SpecialRules.DelegateFileRW); } } }
protected override void BeforeUpdate(DataRow dr) { officeDB.OfficerDelegateRow odr = (officeDB.OfficerDelegateRow)dr; }