コード例 #1
0
        public int Delete(int id)
        {
            DelevaryInfo delevaryInfoToDelete = context.DelevaryInfos.SingleOrDefault(d => d.DId == id);

            context.DelevaryInfos.Remove(delevaryInfoToDelete);
            return(context.SaveChanges());
        }
コード例 #2
0
        public int Update(DelevaryInfo delevaryInfo)
        {
            DelevaryInfo delevaryInfoToUpdate = context.DelevaryInfos.SingleOrDefault(i => i.DId == delevaryInfo.DId);

            delevaryInfoToUpdate.DelevaryAddress = delevaryInfo.DelevaryAddress;
            delevaryInfoToUpdate.DelevaryCity    = delevaryInfo.DelevaryCity;
            delevaryInfoToUpdate.DelevaryStatus  = delevaryInfo.DelevaryStatus;
            delevaryInfoToUpdate.Pcategory       = delevaryInfo.Pcategory;
            delevaryInfoToUpdate.PickUpAddress   = delevaryInfo.PickUpAddress;
            delevaryInfoToUpdate.PickUpCity      = delevaryInfo.PickUpCity;
            delevaryInfoToUpdate.price           = delevaryInfo.price;
            delevaryInfoToUpdate.weight          = delevaryInfo.weight;
            return(context.SaveChanges());
        }
コード例 #3
0
 public int Insert(DelevaryInfo delevaryInfo)
 {
     context.DelevaryInfos.Add(delevaryInfo);
     return(context.SaveChanges());
 }