コード例 #1
0
 public SecurityDB.secUserRow GetSecUserForOfficer(officeDB.OfficerRow or)
 {
     SecurityDB.secUserRow sur;
     if (!or.IsUserNameNull())
     {
         sur = Load(or.UserName);
         if (sur == null)
         {
             throw new AtriumException("Officer must have an account");
         }
     }
     else
     {
         throw new AtriumException("Officer must have a user name");
     }
     return(sur);
 }
コード例 #2
0
        protected override void BeforeChange(DataColumn dc, DataRow ddr)
        {
            base.BeforeChange(dc, ddr);
            string ObjectName = this.myOfficerDT.TableName;

            officeDB.OfficerRow dr = (officeDB.OfficerRow)ddr;
            switch (dc.ColumnName)
            {
            case "OfficerCode":
                if (dr.IsUserNameNull())
                {
                    dr.UserName = dr.OfficerCode;
                }
                break;

            case "PositionCode":
                if (!myA.CheckDomain(dr.PositionCode, myA.AtMng.GetFile().Codes("PositionCode")))
                {
                    throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Position Code");
                }
                if (dr.PositionCode == "LA" && dr.IsAssistantIdNull())
                {
                    throw new RequiredException("Assistant");
                }
                break;

            case "EmailAddress":
                if (dr.IsEmailAddressNull())
                {
                    throw new RequiredException(dc.ColumnName);
                }
                break;

            default:
                break;
            }
        }