Exemplo n.º 1
0
        private void btnImportSelected_Click(object sender, RoutedEventArgs e)
        {
            if (dgData.SelectedItems != null)
            {
                List <CorpInfo> selectedCorps = new List <CorpInfo>();
                foreach (var item in dgData.SelectedItems)
                {
                    if (item is DataRowView)
                    {
                        DataRow  row  = ((DataRowView)item).Row;
                        string   val  = row["ID"].ToString();
                        int      id   = int.Parse(val);
                        CorpInfo corp = _corpInfos.Where(x => x.ID == id).FirstOrDefault();
                        if (corp != null)
                        {
                            selectedCorps.Add(corp);
                        }
                    }
                }

                ImportWindow importWindow = new ImportWindow();
                importWindow.BindData(selectedCorps);
                importWindow.ShowDialog();
            }
        }
Exemplo n.º 2
0
        private void ConvertCorpDataToObjects(CorpInfo corp)
        {
            foreach (DataRow row in corp.Data.Rows)
            {
                Guid tempID = Guid.NewGuid();

                //Title,Surname,First Name,Date of Birth,Gender,Marital Status,Tel No (Home),Tel No (Work),Cellular Tel No,E-mail address,
                _contacts.Add(new Contact()
                {
                    Advisor       = corp.Advisor,
                    Cellular      = row["Cellular Tel No"].ToString(),
                    DateOfBirth   = row["Date of Birth"].ToString(),
                    Email         = row["E-mail address"].ToString(),
                    FirstName     = row["First Name"].ToString(),
                    Fund          = corp.Fund,
                    Gender        = row["Gender"].ToString(),
                    IDNo          = row["Member ID No"].ToString(),
                    LastName      = row["Surname"].ToString(),
                    MaritalStatus = row["Marital Status"].ToString(),
                    MemberNo      = row["Member No"].ToString(),
                    TelNoHome     = row["Tel No (Home)"].ToString(),
                    TelNoWork     = row["Tel No (Work)"].ToString(),
                    TempLinkID    = tempID,
                    Title         = row["Title"].ToString()
                });

                //Date member joined employer,Joined take over scheme date,Total Remuneration,Risk Salary,RA Monthly Premium,Pay frequency,Number of months/weeks to annualise,Member status,Member ID No,Member ID Type,Payroll No,Member No,Member Paypoint Name,
                _fundMembers.Add(new FundMember()
                {
                    Advisor = corp.Advisor,
                    DateMemberJoinedEmployer = row["Date member joined employer"].ToString(),
                    Fund = corp.Fund,
                    TotalRemuneration       = row["Total Remuneration"].ToString(),
                    TempLinkID              = tempID,
                    JoinedTakeOverSchemDate = row["Joined take over scheme date"].ToString(),
                    MemberID                       = row["Member ID No"].ToString(),
                    MemberIDType                   = row["Member ID Type"].ToString(),
                    MemberNo                       = row["Member No"].ToString(),
                    MemberPaypointName             = row["Member Paypoint Name"].ToString(),
                    MemberStatus                   = row["Member status"].ToString(),
                    NumberOfMonthsWeeksToAnnualise = row["Number of months/weeks to annualise"].ToString(),
                    PayFrequency                   = row["Pay frequency"].ToString(),
                    PayrollNo                      = row["Payroll No"].ToString(),
                    RAMonthlyPremium               = row["RA Monthly Premium"].ToString(),
                    RiskSalary                     = row["Risk Salary"].ToString()
                });
            }
        }