コード例 #1
0
        private RequisitionDetail getEntityByModel(RequisitionDetailModel model)
        {
            if (model == null) return null;

            RequisitionDetail entity = new RequisitionDetail();

            if (model.Id == 0)
            {
                entity.CreateBy = AuthenticationHelper.UserId;
                entity.CreateDate = DateTime.Now;
            }
            else
            {
                entity.CreateBy = model.CreateBy;
                entity.CreateDate = model.CreateDate;
            }

            entity.Id = model.Id;
            entity.ItemId = model.ItemId;
            entity.NeedByDate = model.NeedByDate;
            entity.Price = model.Price;
            entity.Quantity = model.Quantity;
            entity.RequisitionId = model.RequisitionId;
            entity.Status = model.Status;
            entity.VendorId = model.VendorId;
            entity.VendorSiteId = model.VendorSiteId;

            return entity;
        }
コード例 #2
0
 public string Update(RequisitionDetail entity)
 {
     var originalEntity = this.Context.RequisitionDetails.Find(entity.Id);
     this.Context.Entry(originalEntity).CurrentValues.SetValues(entity);
     this.Context.Entry(originalEntity).State = EntityState.Modified;
     this.Commit();
     return entity.Id.ToString();
 }
コード例 #3
0
 public string Insert(RequisitionDetail entity)
 {
     this.Context.RequisitionDetails.Add(entity);
     this.Commit();
     return entity.Id.ToString();
 }
コード例 #4
0
 public string Update(RequisitionDetail entity)
 {
     return this.repository.Update(entity);
 }
コード例 #5
0
 public string Insert(RequisitionDetail entity)
 {
     return this.repository.Insert(entity);
 }
コード例 #6
0
 public RequisitionDetailModel(RequisitionDetail entity)
 {
     if (entity != null)
     {
         this.CreateBy = entity.CreateBy;
         this.CreateDate = entity.CreateDate;
         this.Id = entity.Id;
         this.ItemId = entity.ItemId;
         this.NeedByDate = entity.NeedByDate;
         this.Price = entity.Price;
         this.Quantity = entity.Quantity;
         this.RequisitionId = entity.RequisitionId;
         this.Status = entity.Status;
         this.UpdateBy = entity.UpdateBy;
         this.UpdateDate = entity.UpdateDate;
         this.VendorId = entity.VendorId;
         this.VendorSiteId = entity.VendorSiteId;
     }
 }