Exemplo n.º 1
0
        private void GetOfficeKeyInfo(string officeKey)
        {
            if ((_OfficeKeyInfo != null) && (_OfficeKeyInfo.OfficeKey == officeKey))
            {
                return;
            }
            var table = Offices.GetKeyInfoData(officeKey);

            _OfficeKeyInfo = table.Count == 1 ? table[0] : null;
        }
        private static OfficeClass ComputeAlternateOfficeClass(OfficesRow row)
        {
            // check for Governor
            if (row.OfficeLevel.ToOfficeClass() == OfficeClass.StateWide)
            {
                if (row.OfficeKey.SafeSubstring(2).ToLowerInvariant()
                    .StartsWith("gov", StringComparison.Ordinal))
                {
                    return(OfficeClass.USGovernors);
                }
                if (row.OfficeKey.SafeSubstring(2, 2).ToLowerInvariant() == "lt" ||
                    row.OfficeKey.SafeSubstring(2, 10).ToLowerInvariant() == "lieutenant")
                {
                    return(OfficeClass.USLtGovernor);
                }
            }

            // DC specials
            var officeKey = row.OfficeKey;

            if (officeKey.StartsWith("DCStateSenate", StringComparison.OrdinalIgnoreCase))
            {
                officeKey = "DCStateSenate";
            }
            else if (officeKey.StartsWith("DCBoardOfEducation",
                                          StringComparison.OrdinalIgnoreCase))
            {
                officeKey = "DCBoardOfEducation";
            }
            switch (officeKey)
            {
            case "DCMayor":
                return(OfficeClass.DCMayor);

            case "DCStateSenate":
            case "DCChairmanOfTheCouncil":
            case "DCAtLargeMemberOfTheCouncil":
                return(OfficeClass.DCCouncil);

            case "DCBoardOfEducation":
            case "DCStateBoardOfEducationStudentRepresentative":
            case "DCPresidentOfTheBoardOfEducation":
                return(OfficeClass.DCBoardOfEducation);

            case "DCUnitedStatesSenator":
                return(OfficeClass.DCShadowSenator);

            case "DCUnitedStatesRepresentative":
                return(OfficeClass.DCShadowRepresentative);
            }

            return(OfficeClass.Undefined);
        }
 public InspectionDetailsRow AddInspectionDetailsRow(
             System.Guid InspectionId, 
             InspectionTypeMasterRow parentInspectionTypeMasterRowByFK_InspectionDetails_InspectionTypeMaster1, 
             System.Guid InspectingOfficerId, 
             OfficesRow parentOfficesRowByFK_InspectionDetails_Offices, 
             System.Guid LicenseId, 
             string InspectorOfficeName, 
             bool IsDiscrepancyFound, 
             string Remarks, 
             System.Guid InspectionOfficeSI, 
             string InspectorDCName, 
             System.DateTime InspectionSIJoiningDate, 
             string CreatedBy, 
             System.DateTime CreatedAt, 
             string ModifiedBy, 
             System.DateTime ModifiedAt, 
             bool IsDeleted, 
             string DeletedBy, 
             System.DateTime DeletedAt) {
     InspectionDetailsRow rowInspectionDetailsRow = ((InspectionDetailsRow)(this.NewRow()));
     object[] columnValuesArray = new object[] {
             InspectionId,
             null,
             InspectingOfficerId,
             null,
             LicenseId,
             InspectorOfficeName,
             IsDiscrepancyFound,
             Remarks,
             InspectionOfficeSI,
             InspectorDCName,
             InspectionSIJoiningDate,
             CreatedBy,
             CreatedAt,
             ModifiedBy,
             ModifiedAt,
             IsDeleted,
             DeletedBy,
             DeletedAt};
     if ((parentInspectionTypeMasterRowByFK_InspectionDetails_InspectionTypeMaster1 != null)) {
         columnValuesArray[1] = parentInspectionTypeMasterRowByFK_InspectionDetails_InspectionTypeMaster1[0];
     }
     if ((parentOfficesRowByFK_InspectionDetails_Offices != null)) {
         columnValuesArray[3] = parentOfficesRowByFK_InspectionDetails_Offices[0];
     }
     rowInspectionDetailsRow.ItemArray = columnValuesArray;
     this.Rows.Add(rowInspectionDetailsRow);
     return rowInspectionDetailsRow;
 }
 public OfficesRowChangeEvent(OfficesRow row, global::System.Data.DataRowAction action) {
     this.eventRow = row;
     this.eventAction = action;
 }
 public void RemoveOfficesRow(OfficesRow row) {
     this.Rows.Remove(row);
 }
 public void AddOfficesRow(OfficesRow row) {
     this.Rows.Add(row);
 }
Exemplo n.º 7
0
 public UsersInOfficeRolesRow AddUsersInOfficeRolesRow(MembershipsRow parentMembershipsRowByMemberships_UsersInOfficeRoles, RolesRow parentRolesRowByFK_Igrss_UsersInRole_Roles, OfficesRow parentOfficesRowByFK_Igrss_UsersInRole_Igrss_Offices, string Comments, bool IsActive, string CreatedBy, System.DateTime CreatedAt, string ModifiedBy, System.DateTime ModifiedAt, string DeletedBy, System.DateTime DeletedAt, RolesRow parentRolesRowByFK_UsersInRole_Roles) {
     UsersInOfficeRolesRow rowUsersInOfficeRolesRow = ((UsersInOfficeRolesRow)(this.NewRow()));
     rowUsersInOfficeRolesRow.ItemArray = new object[] {
             parentMembershipsRowByMemberships_UsersInOfficeRoles[0],
             parentRolesRowByFK_Igrss_UsersInRole_Roles[0],
             parentOfficesRowByFK_Igrss_UsersInRole_Igrss_Offices[0],
             Comments,
             IsActive,
             CreatedBy,
             CreatedAt,
             ModifiedBy,
             ModifiedAt,
             DeletedBy,
             DeletedAt,
             parentRolesRowByFK_UsersInRole_Roles[0]};
     this.Rows.Add(rowUsersInOfficeRolesRow);
     return rowUsersInOfficeRolesRow;
 }