Ejemplo n.º 1
0
 public void DeleteSlipDetail(SlipDetail slipDetail)
 {
     if ((slipDetail.EntityState == EntityState.Detached))
     {
         this.ObjectContext.SlipDetails.Attach(slipDetail);
     }
     this.ObjectContext.SlipDetails.DeleteObject(slipDetail);
 }
Ejemplo n.º 2
0
        //public IQueryable<SlipDetail> GetSlipDetailsByCompanyIDSlipIDForAdd(global::System.Guid companyID, global::System.Guid slipID)
        //{
        //    return new EnumerableQuery<SlipDetail>(new List<SlipDetail> { new SlipDetail {
        //        CompanyID = companyID,
        //        SlipID = global::System.Guid.NewGuid(),
        //        SlipDetailID = global::System.Guid.NewGuid()
        //    } });
        //}


        public void InsertSlipDetail(SlipDetail slipDetail)
        {
            if ((slipDetail.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(slipDetail, EntityState.Added);
            }
            else
            {
                this.ObjectContext.SlipDetails.AddObject(slipDetail);
            }
        }
Ejemplo n.º 3
0
        private void GetAddSlipDetails(global::System.Guid companyID, global::System.Guid slipID)
        {
            //this.NowLoading<SlipDetail>(
            //    this.Context.GetSlipDetailsByCompanyIDSlipIDForAddQuery(companyID, slipID),
            //    ent =>
            //    {
            //        this.SlipDetails = this.SlipDetails.Concat(ent);
            //        this.SlipDetail = ent.FirstOrDefault();

            //        this.Context.SlipDetails.Add(this.SlipDetail);
            //    }
            //);

            var ent = SlipDetail.CreateAddNewSlipDetail(companyID, slipID);
            //var entList = new List <SlipDetail> { ent };
            var entList = new ObservableCollection <SlipDetail> {
                ent
            };

            this.SlipDetails = this.SlipDetails.Concat(entList);
            this.SlipDetail  = ent;

            this.Context.SlipDetails.Add(this.SlipDetail);
        }
Ejemplo n.º 4
0
 public void UpdateSlipDetail(SlipDetail currentSlipDetail)
 {
     this.ObjectContext.SlipDetails.AttachAsModified(currentSlipDetail);
 }