コード例 #1
0
        public ContactPerson MapContactPerson(COMPTEMP row)
        {
            if (string.IsNullOrEmpty(row.SE_TITLE) &&
                string.IsNullOrEmpty(row.SE_F_NAME) &&
                string.IsNullOrEmpty(row.SE_L_NAME) &&
                string.IsNullOrEmpty(row.SE_EMAIL) &&
                string.IsNullOrEmpty(row.SE_POST) &&
                string.IsNullOrEmpty(row.SE_DIRLINE))
                return null;

            return new ContactPerson
            {
                Title = row.SE_TITLE,
                Firstname = row.SE_F_NAME,
                Lastname = row.SE_L_NAME,
                Email = row.SE_EMAIL,
                Position = row.SE_POST,
                DirectLine = row.SE_DIRLINE,
                CreateDate = DateTime.Today,
                Contacts = new Collection<Contact>(),
                Histories = new Collection<ContactPersonHistory>()
                //did not find a field for secruity fax
                //Fax =
            };
        }
コード例 #2
0
ファイル: SiteMapper.cs プロジェクト: changLiuUNSW/BDSystem
        public object Map(COMPTEMP row)
        {
            var site = new Site
            {
                Key = row.KEY,
                Unit = row.UNIT,
                Number = row.NUMBER,
                Street = row.STREET,
                Suburb = row.SUBURB,
                State = row.STATE,
                Postcode = row.P_CODE,
                Name = row.COMPANY,
                BuildingName = row.BUILD_ID,
                //PropertyManagerName = row.AGENT_COMP,
                PropertyManaged = row.MANBYAGENT,
                PMSite = row.PM_SITE,
                Phone = row.PHONE,
                InHouse = row.IN_HOUSE,
                Size = Configuration.MigrationSizeConverter.Convert(row.SALES_REP),
                TsToCall = row.TSTOCALL,
                Qualification = row.QUALI_NO,
                CleaningContract = MapCleaningContract(row),
                SecurityContract = MapSecurityContract(row),
                Contacts = new Collection<Contact>(),
                ContactPersons = new Collection<ContactPerson>(),
                Groups = new Collection<SiteGroup>()
            };

            return site;
        }
コード例 #3
0
        private ContactPerson MapContactPerson(COMPTEMP row)
        {
            if (string.IsNullOrEmpty(row.TITLE) &&
                string.IsNullOrEmpty(row.FIRST_NAME) &&
                string.IsNullOrEmpty(row.LAST_NAME) &&
                string.IsNullOrEmpty(row.EMAIL) &&
                string.IsNullOrEmpty(row.POSITION) &&
                string.IsNullOrEmpty(row.MOBILE) &&
                string.IsNullOrEmpty(row.FAX_CLEAN) &&
                string.IsNullOrEmpty(row.DIR_LINE) &&
                string.IsNullOrEmpty(row.POBOX) &&
                string.IsNullOrEmpty(row.POB_SUBURB) &&
                string.IsNullOrEmpty(row.POB_STATE) &&
                string.IsNullOrEmpty(row.POB_PCODE))
                return null;

            return new ContactPerson
            {
                Title = row.TITLE,
                Firstname = row.FIRST_NAME,
                Lastname = row.LAST_NAME,
                Email = row.EMAIL,
                Position = row.POSITION,
                Mobile = row.MOBILE,
                Fax = row.FAX_CLEAN,
                DirectLine = row.DIR_LINE,
                PoStreet = row.POBOX,
                PoSuburb = row.POB_SUBURB,
                PoState = row.POB_STATE,
                PoPostcode = row.POB_PCODE,
                CreateDate = DateTime.Today,
                Contacts = new Collection<Contact>(),
                Histories = new Collection<ContactPersonHistory>(),
            };
        }
コード例 #4
0
 /// <summary>
 /// map the row into a list of contacts
 /// </summary>
 /// <param name="row"></param>
 /// <returns></returns>
 public virtual object Map(COMPTEMP row)
 {
     return new Contact
     {
         NewManagerDate = row.NEWMANDATE,
         DaToCheck = row.DATA_UPDAT,
         DaToCheckInfo = row.INFO_UPDAT,
         ExtManagement = row.NEED_INFO,
         ReceptionName = row.RECP_NAME,
         Code = Configuration.MigrationCodeConverter.Convert(row.SALES_REP),
         Leads = new Collection<Lead>(),
         CallLines = new Collection<CallLine>()
     };
 }
コード例 #5
0
ファイル: TenentMapper.cs プロジェクト: changLiuUNSW/BDSystem
 private Site MapTenant(COMPTEMP row)
 {
     return new Site
     {
         Key = Configuration.TenantKey,
         Number = row.NUMBER,
         Street = row.STREET,
         Suburb = row.SUBURB,
         State = row.STATE,
         Postcode = row.P_CODE,
         BuildingName = row.BUILD_ID,
         PropertyManaged = true,
         Contacts = new Collection<Contact>(),
         ContactPersons = new Collection<ContactPerson>(),
         Groups = new Collection<SiteGroup>()
     };
 }
コード例 #6
0
        private Contact MapCleaningContact(COMPTEMP row, bool mapContactPerson)
        {
            var contact = base.Map(row) as Contact;
            if (contact == null)
                return null;

            contact.CallFrequency = row.CALL_ON_PM;
            contact.Note = row.NOTE_PAD;
            contact.NextCall = row.NEXT_CALL;
            contact.LastCall = row.LASTCONTAC;
            contact.BusinessTypeId = (int)BusinessTypes.Cleaning;

            if (mapContactPerson)
                contact.ContactPerson = MapContactPerson(row);

            return contact;
        }
コード例 #7
0
ファイル: SiteMapper.cs プロジェクト: changLiuUNSW/BDSystem
        private SecurityContract MapSecurityContract(COMPTEMP row)
        {
            if (string.IsNullOrEmpty(row.CUR_SC) &&
                row.SE_TENDER == null)
                return null;

            return new SecurityContract
            {
                Contarctor = row.CUR_SC,
                ReviewDate = row.SE_TENDER,
                GuardingPersonnel = row.SC_GUAD,
                MobilePatrol = row.SC_MOB_PAT,
                Conceirge = row.CONCIERGE,
                ElectronicInstallation = row.SC_CCTV,
                BackToBaseMonitoring = row.SC_B2BMON,
                SecurityMaintenance = row.SC_MAINTEN
            };
        }
コード例 #8
0
        public object Map(COMPTEMP row)
        {
            if (string.IsNullOrEmpty(row.GRP_NAME) ||
                string.Compare(row.SALES_REP, "PMS", StringComparison.OrdinalIgnoreCase) == 0 ||
                string.Compare(row.SALES_REP, "BMS", StringComparison.OrdinalIgnoreCase) == 0)
            {
                return null;
            }

            return new SiteGroup
            {
                GroupName = row.GRP_NAME,
                AgentComp = row.AGENT_COMP,
                Type = "Group",
                ExternalManagers = new Collection<ExternalManager>(),
                Sites = new Collection<Site>()
            };
        }
コード例 #9
0
        public override object Map(COMPTEMP row)
        {
            if (!row.SECU_CONT)
                return null;

            var contact = base.Map(row) as Contact;

            if (contact == null)
                return null;

            contact.CallFrequency = row.SE_CALLCYC;
            contact.Note = row.SE_CT_MEMO;
            contact.NextCall = row.SENEXTCALL;
            contact.LastCall = row.SELASTCALL;
            contact.BusinessTypeId = (int) BusinessTypes.Security;
            contact.ContactPerson = MapContactPerson(row);
            return contact;
        }
コード例 #10
0
        public override object Map(COMPTEMP row)
        {
            if (row.CLEAN_CONT)
                return MapCleaningContact(row, true);

            if (row.SECU_CONT || row.MAINT_CONT)
                return null;

            //in the case of all three indicators are false
            //we still create a cleaning only if we can find a valid contact person
            var contactPerson = MapContactPerson(row);

            if (contactPerson == null)
                return null;

            var contact = MapCleaningContact(row, false);
            if (contact != null)
                contact.ContactPerson = contactPerson;

            return contact;
        }
コード例 #11
0
ファイル: SiteMapper.cs プロジェクト: changLiuUNSW/BDSystem
        private CleaningContract MapCleaningContract(COMPTEMP row)
        {
            if (string.IsNullOrEmpty(row.CUR_CLN) &&
                string.IsNullOrEmpty(row.CONT_QUOTE) &&
                row.PRICE_PA == 0 &&
                string.IsNullOrEmpty(row.UNSU_OPTIO) &&
                row.TENDER_NEX == null &&
                row.DATEQUOTED == null &&
                row.CLEAN_FREQ == null &&
                row.QUALI_NO == null)
                return null;

            return new CleaningContract
            {
                Contractor = row.CUR_CLN,
                ContactDuringQuote = row.CONT_QUOTE,
                PricePa = Convert.ToDecimal(row.PRICE_PA),
                UnsuccessReason = row.UNSU_OPTIO,
                ReviewDate = row.TENDER_NEX,
                DateQuoted = row.DATEQUOTED,
                CleaningFreq = row.CLEAN_FREQ,
                QualifyingQuantity = row.QUALI_NO
            };
        }
コード例 #12
0
ファイル: TenentMapper.cs プロジェクト: changLiuUNSW/BDSystem
        public object Map(COMPTEMP row)
        {
            if (string.Compare(row.SALES_REP, "PMS", StringComparison.OrdinalIgnoreCase) != 0)
                return null;

            //tenants are saved as sites
            var tenants = new List<Site>();

            if (!string.IsNullOrEmpty(row.M_TENANT1))
            {
                var tenant = MapTenant(row);
                MatchTenantInfo(tenant, row.M_TENANT1, row.STATE);
                tenants.Add(tenant);
            }

            if (!string.IsNullOrEmpty(row.M_TENANT2))
            {
                var tenant = MapTenant(row);
                MatchTenantInfo(tenant, row.M_TENANT2, row.STATE);
                tenants.Add(tenant);
            }

            return tenants;
        }
コード例 #13
0
ファイル: Copier.cs プロジェクト: changLiuUNSW/BDSystem
        private static SiteGroup CopySiteGroup(COMPTEMP origin)
        {
            if (string.IsNullOrEmpty(origin.GRP_NAME) ||
                origin.SALES_REP == "PMS" ||
                origin.SALES_REP == "BMS")
                return null;

            var group = new SiteGroup
            {
                GroupName = origin.GRP_NAME,
                AgentComp = origin.AGENT_COMP
            };

            group.Type = "Group";
            return group;
        }
コード例 #14
0
ファイル: Copier.cs プロジェクト: changLiuUNSW/BDSystem
 private static Site CopySite(COMPTEMP origin)
 {
     return new Site
     {
         Key = origin.KEY,
         Unit = origin.UNIT,
         Number = origin.NUMBER,
         Street = origin.STREET,
         Suburb = origin.SUBURB,
         State = origin.STATE,
         Postcode = origin.P_CODE,
         Name = origin.COMPANY,
         BuildingName = origin.BUILD_ID,
         //PropertyManagerName = origin.AGENT_COMP,
         PropertyManaged = origin.MANBYAGENT,
         PMSite = origin.PM_SITE,
         Phone = origin.PHONE,
         InHouse = origin.IN_HOUSE,
         Size = Migration.GetSize(origin.SALES_REP),
         TsToCall = origin.TSTOCALL,
         Qualification = origin.QUALI_NO
     };
 }
コード例 #15
0
ファイル: Copier.cs プロジェクト: changLiuUNSW/BDSystem
 private static Contact CopySecurityContact(COMPTEMP origin)
 {
     return new Contact
     {
         CallFrequency = origin.SE_CALLCYC,
         Note = origin.SE_CT_MEMO,
         NextCall = origin.SENEXTCALL,
         LastCall = origin.SELASTCALL,
         Code = Migration.GetCode(origin.SE_SAL_REP),
         ContactPerson = CopySeContactPerson(origin),
         BusinessTypeId = (int)BusinessTypes.Security
     };
 }
コード例 #16
0
ファイル: Copier.cs プロジェクト: changLiuUNSW/BDSystem
        private static ContactPerson CopySeContactPerson(COMPTEMP origin)
        {
            if (string.IsNullOrEmpty(origin.SE_TITLE) &&
                string.IsNullOrEmpty(origin.SE_F_NAME) &&
                string.IsNullOrEmpty(origin.SE_L_NAME) &&
                string.IsNullOrEmpty(origin.SE_EMAIL) &&
                string.IsNullOrEmpty(origin.SE_POST) &&
                string.IsNullOrEmpty(origin.SE_DIRLINE))
                return null;

            return new ContactPerson
            {
                Title = origin.SE_TITLE,
                Firstname = origin.SE_F_NAME,
                Lastname = origin.SE_L_NAME,
                Email = origin.SE_EMAIL,
                Position = origin.SE_POST,
                DirectLine = origin.SE_DIRLINE,
                CreateDate = DateTime.Today
                //did not find a field for secruity fax
                //Fax =
            };
        }
コード例 #17
0
ファイル: Copier.cs プロジェクト: changLiuUNSW/BDSystem
 private static Contact CopyMaintContact(COMPTEMP origin)
 {
     return new Contact
     {
         NextCall = null,
         LastCall = null,
         Code = null,
         BusinessTypeId = (int)BusinessTypes.Maintenance
     };
 }
コード例 #18
0
ファイル: Copier.cs プロジェクト: changLiuUNSW/BDSystem
        private static IList<Contact> CopyContacts(COMPTEMP origin)
        {
            var contacts = new List<Contact>();

            if (!origin.CLEAN_CONT /*&& !origin.MAINT_CONT*/ && !origin.SECU_CONT)
                return null;

            if (origin.CLEAN_CONT)
            {
                var contact = CopyCleaningContact(origin);
                CopyContact(origin, ref contact);
                contacts.Add(contact);
            }

            if (origin.SECU_CONT)
            {
                var contact = CopySecurityContact(origin);
                CopyContact(origin, ref contact);
                contacts.Add(contact);
            }

            //we dont generate maitenance record for now
            /*if (origin.MAINT_CONT)
            {
                var contact = CopyMaintContact(origin);
                CopyContact(origin, ref contact);
                contacts.Add(contact);
            }*/

            return contacts;
        }
コード例 #19
0
ファイル: Copier.cs プロジェクト: changLiuUNSW/BDSystem
 private static void CopyContact(COMPTEMP origin, ref Contact contact)
 {
     contact.NewManagerDate = origin.NEWMANDATE;
     contact.DaToCheck = origin.DATA_UPDAT;
     contact.DaToCheckInfo = origin.INFO_UPDAT;
     contact.ExtManagement = origin.NEED_INFO;
     contact.ReceptionName = origin.RECP_NAME;
 }
コード例 #20
0
ファイル: Copier.cs プロジェクト: changLiuUNSW/BDSystem
        private static CleaningContract CopyCleaningContract(COMPTEMP origin)
        {
            if (string.IsNullOrEmpty(origin.CUR_CLN) &&
                string.IsNullOrEmpty(origin.CONT_QUOTE) &&
                origin.PRICE_PA == 0 &&
                string.IsNullOrEmpty(origin.UNSU_OPTIO) &&
                origin.TENDER_NEX == null &&
                origin.DATEQUOTED == null &&
                origin.CLEAN_FREQ == null &&
                origin.QUALI_NO == null)
                return null;

            return new CleaningContract
            {
                Contractor = origin.CUR_CLN,
                ContactDuringQuote = origin.CONT_QUOTE,
                PricePa = Convert.ToDecimal(origin.PRICE_PA),
                UnsuccessReason = origin.UNSU_OPTIO,
                ReviewDate = origin.TENDER_NEX,
                DateQuoted = origin.DATEQUOTED,
                CleaningFreq = origin.CLEAN_FREQ,
                QualifyingQuantity = origin.QUALI_NO
            };
        }
コード例 #21
0
ファイル: Copier.cs プロジェクト: changLiuUNSW/BDSystem
 private static Contact CopyCleaningContact(COMPTEMP origin)
 {
     return new Contact
     {
         CallFrequency = origin.CALL_ON_PM,
         Note = origin.NOTE_PAD,
         NextCall = origin.NEXT_CALL,
         LastCall = origin.LASTCONTAC,
         Code = Migration.GetCode(origin.SALES_REP),
         ContactPerson = CopyClContactPerson(origin),
         BusinessTypeId = (int)BusinessTypes.Cleaning
     };
 }
コード例 #22
0
ファイル: Copier.cs プロジェクト: changLiuUNSW/BDSystem
        private static IList<Site> CopyTenant(COMPTEMP origin)
        {
            var list = new List<Site>();
            var phoneCode = Migration.PhoneCodes[origin.STATE];

            if (!string.IsNullOrEmpty(origin.M_TENANT1))
            {
                list.Add(CopyTenantInfo(origin, origin.M_TENANT1));
            }

            if (!string.IsNullOrEmpty(origin.M_TENANT2))
            {
                list.Add(CopyTenantInfo(origin, origin.M_TENANT2));
            }

            return list;
        }
コード例 #23
0
ファイル: Copier.cs プロジェクト: changLiuUNSW/BDSystem
        private static Site CopyTenantInfo(COMPTEMP origin, string tenant)
        {
            var phoneCode = Migration.PhoneCodes[origin.STATE];

            var site = new Site
            {
                Key = Migration.NextTenantKey(),
                Number = origin.NUMBER,
                Street = origin.STREET,
                Suburb = origin.SUBURB,
                State = origin.STATE,
                Postcode = origin.P_CODE,
                BuildingName = origin.BUILD_ID,
                PropertyManaged = true,
            };

            var regex = string.Format(@"\(?{0}\)?\s*\d{{4,8}}?\s*\d{{4,8}}?", phoneCode);
            if (!MatchTenantWithRegex(site, tenant, regex))
            {
                regex = string.Format(@"{0}\d{{2,2}}\s?\d{{3,3}}\s?\d{{3,3}}", Migration.PhoneCodes["Mobile"]);
                MatchTenantWithRegex(site, tenant, regex);
            }

            return site;
        }
コード例 #24
0
ファイル: Copier.cs プロジェクト: changLiuUNSW/BDSystem
        private static ContactPerson CopyClContactPerson(COMPTEMP origin)
        {
            if (string.IsNullOrEmpty(origin.TITLE) &&
                string.IsNullOrEmpty(origin.FIRST_NAME) &&
                string.IsNullOrEmpty(origin.LAST_NAME) &&
                string.IsNullOrEmpty(origin.EMAIL) &&
                string.IsNullOrEmpty(origin.POSITION) &&
                string.IsNullOrEmpty(origin.MOBILE) &&
                string.IsNullOrEmpty(origin.FAX_CLEAN) &&
                string.IsNullOrEmpty(origin.DIR_LINE) &&
                string.IsNullOrEmpty(origin.POBOX) &&
                string.IsNullOrEmpty(origin.POB_SUBURB) &&
                string.IsNullOrEmpty(origin.POB_STATE) &&
                string.IsNullOrEmpty(origin.POB_PCODE))
                return null;

            return new ContactPerson
            {
                Title = origin.TITLE,
                Firstname = origin.FIRST_NAME,
                Lastname = origin.LAST_NAME,
                Email = origin.EMAIL,
                Position = origin.POSITION,
                Mobile = origin.MOBILE,
                Fax = origin.FAX_CLEAN,
                DirectLine = origin.DIR_LINE,
                PoStreet = origin.POBOX,
                PoSuburb = origin.POB_SUBURB,
                PoState = origin.POB_STATE,
                PoPostcode = origin.POB_PCODE,
                CreateDate = DateTime.Today
            };
        }