public IActionResult AddContractSalaryAction(int contractId, double salariu, DateTime dataInceput, DateTime dataSfarsit) { var contract = _contract.GetById(contractId); if (dataSfarsit == DateTime.MinValue) { dataSfarsit = DateTime.MaxValue; } var contractSalary = new ContractSalary { Salariu = salariu, DataInceput = dataInceput, DataSfarsit = dataSfarsit, Contract = contract }; _salary.Add(contractSalary); return(RedirectToAction("Detail", new { id = contractId })); }
public void Remove(ContractSalary contractSalary) { _context.Remove(contractSalary); _context.SaveChanges(); }
public void Add(ContractSalary contractSalary) { _context.Add(contractSalary); _context.SaveChanges(); }