예제 #1
0
        public void UpdateContractor(Contractor model)
        {
            var contractor = _context.Contractors.FirstOrDefault(e => e.ID == model.ID);

            contractor.Name                 = model.Name;
            contractor.Surname              = model.Surname;
            contractor.Rate                 = model.Rate;
            contractor.Overtime_Rate        = model.Overtime_Rate;
            contractor.Agency               = model.Agency;
            contractor.Agency2              = model.Agency2;
            contractor.Number               = model.Number;
            contractor.Info                 = model.Info;
            contractor.Time_sheet_submitted = model.Time_sheet_submitted;
            contractor.Companyname          = model.Companyname;
            contractor.Company_Number       = model.Company_Number;
            contractor.Address1             = model.Address1;
            contractor.Address2             = model.Address2;
            contractor.Address3             = model.Address3;
            contractor.Address4             = model.Address4;
            contractor.Email                = model.Email;
            contractor.Standard_margin      = model.Standard_margin;
            contractor.overtimeMargin       = model.overtimeMargin;
            contractor.Work_Permit          = model.Work_Permit;
            contractor.charity              = model.charity;
            contractor.Daily_rate           = model.Daily_rate;
            contractor.Hourly_rate          = model.Hourly_rate;
            contractor.selfbilling          = model.selfbilling;
            contractor.Bite_Employee        = model.Bite_Employee;
            contractor.InvoiceID            = model.InvoiceID;
            contractor.ContractorTypeID     = model.ContractorTypeID;
            contractor.Company              = model.Company;
            contractor.Payroll              = model.Payroll;

            _context.Entry(contractor).State = EntityState.Modified;
            _context.SaveChanges();
        }
예제 #2
0
 public int InsertContractor(Contractor model)
 {
     _context.Contractors.Add(model);
     _context.SaveChanges();
     return(model.ID);
 }
예제 #3
0
 public void Create(Contractor model)
 {
     _context.Contractors.Add(model);
     _context.SaveChanges();
 }