예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Contractor contractor = new Contractor
            {
                Name                 = txtName.Text,
                Surname              = txtSurname.Text,
                Rate                 = txtRate.ToDouble(),
                Overtime_Rate        = txtOvertimeRate.ToDouble(),
                Company              = Convert.ToInt32(cboAssociateCompany.SelectedValue),
                Agency               = txtAgency.Text,
                Agency2              = txtAgency2.Text,
                Number               = txtNumber.ToDouble(),
                Info                 = txtInfo.Text,
                Time_sheet_submitted = txtTimesheet.Text,
                InvoiceID            = Convert.ToInt16(cboInvoiced.SelectedValue),
                Standard_margin      = txtStandardMargin.ToDouble(),
                overtimeMargin       = txtOvertimeMargin.ToDouble(),
                Work_Permit          = chkWorkPermit.Checked,
                charity              = chkCharity.Checked,
                Daily_rate           = chkDaily.Checked,
                Hourly_rate          = chkHourly.Checked
            };
            ContractorRepository repository = new ContractorRepository();

            repository.Create(contractor);
        }
예제 #2
0
 public Contractor Create(Contractor newContractor)
 {
     newContractor.Id = _repo.Create(newContractor);
     return(newContractor);
 }
예제 #3
0
 internal Contractor Create(Contractor newContractor)
 {
     newContractor.Id = _repo.Create(newContractor);
     return(newContractor);
 }