Пример #1
0
 public deliveryorder Update(deliveryorder entity)
 {
     using (var db = new TMSDBContext())
     {
         var existingEntity = db.Deliveryorders.FirstOrDefault((ad) => ad.id == entity.id);
         if (existingEntity != null)
         {
             existingEntity.billtoaddrid    = entity.billtoaddrid;
             existingEntity.bookingno       = entity.bookingno;
             existingEntity.boxes           = entity.boxes;
             existingEntity.brokername      = entity.brokername;
             existingEntity.brokerrefno     = entity.brokerrefno;
             existingEntity.consigneeaddrid = entity.consigneeaddrid;
             existingEntity.customernotes   = entity.customernotes;
             existingEntity.cutoffdate      = entity.cutoffdate;
             existingEntity.fbrno           = entity.fbrno;
             existingEntity.freightcharges  = entity.freightcharges;
             existingEntity.portoforigin    = entity.portoforigin;
             existingEntity.shipmentweight  = entity.shipmentweight;
             existingEntity.status          = entity.status;
             existingEntity.vesselname      = entity.vesselname;
             existingEntity.isediorder      = entity.isediorder;
             existingEntity.modifiedby      = entity.modifiedby;
             existingEntity.modifiedon      = entity.modifiedon;
             db.SaveChanges();
         }
     }
     return(entity);
 }
Пример #2
0
 public user FindById(long i)
 {
     using (var db = new TMSDBContext())
     {
         return(db.Users.FirstOrDefault((a) => a.id == i));
     }
 }
Пример #3
0
 public address FindById(long i)
 {
     using (var db = new TMSDBContext())
     {
         return(db.Addresses.FirstOrDefault((a) => a.id == i));
     }
 }
Пример #4
0
 public IEnumerable <driverdetail> GetAll()
 {
     using (var db = new TMSDBContext())
     {
         return(db.Driverdetails.ToList());
     }
 }
Пример #5
0
 public IEnumerable <user> GetAll()
 {
     using (var db = new TMSDBContext())
     {
         return(db.Users.ToList());
     }
 }
Пример #6
0
 public driverdetail FindById(long i)
 {
     using (var db = new TMSDBContext())
     {
         return(db.Driverdetails.FirstOrDefault((a) => a.id == i));
     }
 }
Пример #7
0
 public IEnumerable <address> GetAll()
 {
     using (var db = new TMSDBContext())
     {
         return(db.Addresses.ToList());
     }
 }
Пример #8
0
 public IEnumerable <deliveryorder> GetAll()
 {
     using (var db = new TMSDBContext())
     {
         return(db.Deliveryorders.ToList());
     }
 }
Пример #9
0
 public deliveryorder Add(deliveryorder entity)
 {
     using (var db = new TMSDBContext())
     {
         var addedvalue = db.Deliveryorders.Add(entity);
         return(addedvalue);
     }
 }
Пример #10
0
 public driverdetail Remove(driverdetail entity)
 {
     using (var db = new TMSDBContext())
     {
         db.Driverdetails.Remove(entity);
         db.SaveChanges();
     }
     return(entity);
 }
Пример #11
0
 public driverdetail Add(driverdetail entity)
 {
     using (var entities = new TMSDBContext())
     {
         entities.Driverdetails.Add(entity);
         int i = entities.SaveChanges();
     }
     return(entity);
 }
Пример #12
0
 public address Remove(address entity)
 {
     using (var db = new TMSDBContext())
     {
         db.Addresses.Remove(entity);
         db.SaveChanges();
     }
     return(entity);
 }
Пример #13
0
 public address Add(address entity)
 {
     using (var entities = new TMSDBContext())
     {
         entities.Addresses.Add(entity);
         int i = entities.SaveChanges();
     }
     return(entity);
 }
Пример #14
0
 public user Remove(user entity)
 {
     using (var db = new TMSDBContext())
     {
         db.Users.Remove(entity);
         db.SaveChanges();
     }
     return(entity);
 }
Пример #15
0
 public user Add(user entity)
 {
     using (var entities = new TMSDBContext())
     {
         entities.Users.Add(entity);
         int i = entities.SaveChanges();
     }
     return(entity);
 }
Пример #16
0
 public deliveryorder FindById(long i)
 {
     using (var db = new TMSDBContext())
     {
         var retrievedvalue = db.Deliveryorders.FirstOrDefault((d) => d.id == i);
         if (retrievedvalue != null)
         {
             return(retrievedvalue);
         }
     }
     return(null);
 }
Пример #17
0
 public deliveryorder Remove(deliveryorder entity)
 {
     using (var db = new TMSDBContext())
     {
         var retrievedvalue = db.Deliveryorders.FirstOrDefault((d) => d.id == entity.id);
         if (retrievedvalue != null)
         {
             db.Deliveryorders.Remove(retrievedvalue);
         }
     }
     return(entity);
 }
Пример #18
0
 public driverdetail Update(driverdetail entity)
 {
     using (var db = new TMSDBContext())
     {
         var existingEntity = db.Driverdetails.FirstOrDefault((ad) => ad.id == entity.id);
         if (existingEntity != null)
         {
             existingEntity.drivername = entity.drivername;
             existingEntity.driverno   = entity.driverno;
             db.SaveChanges();
         }
     }
     return(entity);
 }
Пример #19
0
 public user Update(user entity)
 {
     using (var db = new TMSDBContext())
     {
         var existingEntity = db.Users.FirstOrDefault((ad) => ad.id == entity.id);
         if (existingEntity != null)
         {
             existingEntity.email      = entity.email;
             existingEntity.firstname  = entity.firstname;
             existingEntity.lastname   = entity.lastname;
             existingEntity.password   = entity.password;
             existingEntity.modifiedby = entity.modifiedby;
             existingEntity.modifiedon = entity.modifiedon;
             db.SaveChanges();
         }
     }
     return(entity);
 }
Пример #20
0
 public address Update(address entity)
 {
     using (var db = new TMSDBContext())
     {
         var existingEntity = db.Addresses.FirstOrDefault((ad) => ad.id == entity.id);
         if (existingEntity != null)
         {
             existingEntity.addressee    = entity.addressee;
             existingEntity.addressline1 = entity.addressline1;
             existingEntity.addressline3 = entity.addressline3;
             existingEntity.addrtype     = entity.addrtype;
             existingEntity.city         = entity.city;
             existingEntity.state        = entity.state;
             existingEntity.country      = entity.country;
             existingEntity.zip          = entity.zip;
             db.SaveChanges();
         }
     }
     return(entity);
 }