Exemplo n.º 1
0
 public static int SaveFile(FaultLibrary entity)
 {
     using (var Context = new NPDEntities())
     {
         Context.Set <FaultLibrary>().Add(entity);
         return(Context.SaveChanges());
     }
 }
Exemplo n.º 2
0
 public static int SaveCompany(company companyEntity)
 {
     using (var Context = new NPDEntities())
     {
         Context.Set <company>().Add(companyEntity);
         return(Context.SaveChanges());
     }
 }
Exemplo n.º 3
0
 public static int UpdateFault(Fault model)
 {
     using (var Context = new NPDEntities())
     {
         var fault = Context.Faults.FirstOrDefault(x => x.Id == model.Id);
         fault.CompanyId          = model.CompanyId;
         fault.Complexity         = model.Complexity;
         fault.FaultDescription   = model.FaultDescription;
         fault.FaultStatus        = model.Priority < 1 ? 0 : 1;
         fault.Location           = model.Location;
         fault.MachineDescription = model.MachineDescription;
         fault.ModifiedBy         = model.ModifiedBy;
         fault.ModifiedDate       = DateTime.Now;
         fault.Priority           = model.Priority;
         fault.StartDate          = DateTime.Now;
         fault.AssignedTo         = model.AssignedTo;
         return(Context.SaveChanges());
     }
 }