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); }
public user FindById(long i) { using (var db = new TMSDBContext()) { return(db.Users.FirstOrDefault((a) => a.id == i)); } }
public address FindById(long i) { using (var db = new TMSDBContext()) { return(db.Addresses.FirstOrDefault((a) => a.id == i)); } }
public IEnumerable <driverdetail> GetAll() { using (var db = new TMSDBContext()) { return(db.Driverdetails.ToList()); } }
public IEnumerable <user> GetAll() { using (var db = new TMSDBContext()) { return(db.Users.ToList()); } }
public driverdetail FindById(long i) { using (var db = new TMSDBContext()) { return(db.Driverdetails.FirstOrDefault((a) => a.id == i)); } }
public IEnumerable <address> GetAll() { using (var db = new TMSDBContext()) { return(db.Addresses.ToList()); } }
public IEnumerable <deliveryorder> GetAll() { using (var db = new TMSDBContext()) { return(db.Deliveryorders.ToList()); } }
public deliveryorder Add(deliveryorder entity) { using (var db = new TMSDBContext()) { var addedvalue = db.Deliveryorders.Add(entity); return(addedvalue); } }
public driverdetail Remove(driverdetail entity) { using (var db = new TMSDBContext()) { db.Driverdetails.Remove(entity); db.SaveChanges(); } return(entity); }
public driverdetail Add(driverdetail entity) { using (var entities = new TMSDBContext()) { entities.Driverdetails.Add(entity); int i = entities.SaveChanges(); } return(entity); }
public address Remove(address entity) { using (var db = new TMSDBContext()) { db.Addresses.Remove(entity); db.SaveChanges(); } return(entity); }
public address Add(address entity) { using (var entities = new TMSDBContext()) { entities.Addresses.Add(entity); int i = entities.SaveChanges(); } return(entity); }
public user Remove(user entity) { using (var db = new TMSDBContext()) { db.Users.Remove(entity); db.SaveChanges(); } return(entity); }
public user Add(user entity) { using (var entities = new TMSDBContext()) { entities.Users.Add(entity); int i = entities.SaveChanges(); } return(entity); }
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); }
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); }
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); }
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); }
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); }