示例#1
0
        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 }));
        }
示例#2
0
 public void Remove(ContractSalary contractSalary)
 {
     _context.Remove(contractSalary);
     _context.SaveChanges();
 }
示例#3
0
 public void Add(ContractSalary contractSalary)
 {
     _context.Add(contractSalary);
     _context.SaveChanges();
 }