22 lines
710 B
C#
22 lines
710 B
C#
|
using ServiceStationContracts.StorageContracts;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace ServiceStationsDataBaseImplement.Implements {
|
|||
|
public class WorkClientStorage : IWorkClientStorage {
|
|||
|
public bool Add_Points(WorkClientBindingModel model) {
|
|||
|
using var context = new Database();
|
|||
|
var rec = context.WorksClients.FirstOrDefault(x => x.WorkId == model.Work_Id && x.ClientId == model.Client_Id);
|
|||
|
if (rec == null) {
|
|||
|
return false;
|
|||
|
}
|
|||
|
var ans = rec.Update(model);
|
|||
|
context.SaveChanges();
|
|||
|
return ans;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|