Beispiel #1
0
        public void LoadContractor()
        {
            ViewRepository repo = new ViewRepository();

            currentRecord = repo.ContractorDetails().Where(e => e.HDM == hdmIndex).FirstOrDefault();

            contractor = new LookupRepository().GetContractors().Where(e => e.ID == currentRecord.ID).FirstOrDefault();

            txtid.Text             = currentRecord.ID.ToString();
            txtname.Text           = currentRecord.Name;
            txtsurname.Text        = currentRecord.Surname;
            txtWeek1.Text          = currentRecord.Week1.ToString();
            txtweek2.Text          = currentRecord.Week2.ToString();
            txtweek3.Text          = currentRecord.Week3.ToString();
            txtweek4.Text          = currentRecord.Week4.ToString();
            txtweek5.Text          = currentRecord.Week5.ToString();
            txtoweek1.Text         = currentRecord.OWeek1.ToString();
            txtoweek2.Text         = currentRecord.OWeek2.ToString();
            txtoweek3.Text         = currentRecord.OWeek3.ToString();
            txtoweek4.Text         = currentRecord.OWeek4.ToString();
            txtoweek5.Text         = currentRecord.OWeek5.ToString();
            txtWeek1Rate.Text      = currentRecord.Week1Rate.ToString();
            txtweek2rate.Text      = currentRecord.Week2Rate.ToString();
            txtweek3rate.Text      = currentRecord.Week3Rate.ToString();
            txtweek4rate.Text      = currentRecord.Week4rate.ToString();
            txtoweek1rate.Text     = currentRecord.Oweekrate.ToString();
            txtoweek2rate.Text     = currentRecord.oweek2rate.ToString();
            txtoweek3rate.Text     = currentRecord.oweek3rate.ToString();
            txtoweek4rate.Text     = currentRecord.oweek4rate.ToString();
            txtoweek5rate.Text     = currentRecord.oweek5rate.ToString();
            chkdailyrate1.Checked  = currentRecord.dailyrate1;
            chkdailyrate2.Checked  = currentRecord.dailyrate2;
            chkdailyrate3.Checked  = currentRecord.dailyrate3;
            chkdailyrate4.Checked  = currentRecord.dailyrate4;
            chkdailyrate5.Checked  = currentRecord.dailyrate5;
            chkhourlyrate1.Checked = currentRecord.hourlyrate1;
            chkhourlyrate2.Checked = currentRecord.hourlyrate2;
            chkhourlyrate3.Checked = currentRecord.hourlyrate3;
            chkhourlyrate4.Checked = currentRecord.hourlyrate4;
            txtdaysworked.Text     = currentRecord.days_worked.ToString();
            txthoursworked.Text    = currentRecord.hoursworked.ToString();
            txttotal.Text          = currentRecord.Total.ToString();
            txthdm.Text            = currentRecord.HDM.ToString();
            txtweek5rate.Text      = currentRecord.Week5rate.ToString();
            chkhourlyrate5.Checked = currentRecord.hourlyrate5;
        }