예제 #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 Remove(user entity)
 {
     using (var db = new TMSDBContext())
     {
         db.Users.Remove(entity);
         db.SaveChanges();
     }
     return(entity);
 }
예제 #3
0
 public user Add(user entity)
 {
     using (var entities = new TMSDBContext())
     {
         entities.Users.Add(entity);
         int i = entities.SaveChanges();
     }
     return(entity);
 }
예제 #4
0
 public driverdetail Remove(driverdetail entity)
 {
     using (var db = new TMSDBContext())
     {
         db.Driverdetails.Remove(entity);
         db.SaveChanges();
     }
     return(entity);
 }
예제 #5
0
 public driverdetail Add(driverdetail entity)
 {
     using (var entities = new TMSDBContext())
     {
         entities.Driverdetails.Add(entity);
         int i = entities.SaveChanges();
     }
     return(entity);
 }
예제 #6
0
 public address Remove(address entity)
 {
     using (var db = new TMSDBContext())
     {
         db.Addresses.Remove(entity);
         db.SaveChanges();
     }
     return(entity);
 }
예제 #7
0
 public address Add(address entity)
 {
     using (var entities = new TMSDBContext())
     {
         entities.Addresses.Add(entity);
         int i = entities.SaveChanges();
     }
     return(entity);
 }
예제 #8
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);
 }
예제 #9
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);
 }
예제 #10
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);
 }