示例#1
0
        public void UpdateJob(Job_Infra inst)
        {
            var tempInst = context.Jobs.FirstOrDefault(_ => _.Id == inst.Id);

            tempInst.Id                = inst.Id;
            tempInst.TitleOfJob        = inst.TitleOfJob;
            tempInst.PriceOfUnitOfJob  = inst.PriceOfUnitOfJob;
            tempInst.KindOfJob_InfraId = inst.KindOfJob_InfraId;
            tempInst.UnitOfJob_InfraId = inst.UnitOfJob_InfraId;
            context.SaveChanges();
        }
 public static Job_Domain JobFromInfraToDomain(this Job_Infra @this)
 {
     if (@this != null)
     {
         return(new Job_Domain()
         {
             Id = @this.Id,
             TitleOfJob = @this.TitleOfJob,
             PriceOfUnitOfJob = @this.PriceOfUnitOfJob,
             KindOfJob_DomainId = @this.KindOfJob_InfraId,
             UnitOfJob_DomainId = @this.UnitOfJob_InfraId
         });
     }
     else
     {
         return(null);
     }
 }
示例#3
0
 public void CreateJob(Job_Infra inst)
 {
     context.Jobs.Add(inst);
     context.SaveChanges();
 }