예제 #1
0
        public void Delete(IList list)
        {
            if (list == null)
            {
                return;
            }

            for (int i = 0; i < list.Count; i++)
            {
                FBEntity entity = list[i] as FBEntity;
                if (entity != null)
                {
                    entity.Actived = false;
                    ExtensionalOrderDetailFBEntityList.Remove(entity);
                }
            }
        }
예제 #2
0
        /// <summary>
        /// 保存数据时用
        /// </summary>
        private void GetValue()
        {
            T_FB_EXTENSIONALORDER eOrder = this.ExtensionalOrderFBEntity.Entity as T_FB_EXTENSIONALORDER;

            //if (this.rbtnApplyTypeBorrow.IsChecked == true)
            //{
            //    eOrder.APPLYTYPE = 2;
            //}
            //else
            //{
            //    eOrder.APPLYTYPE = 1;
            //}
            if (this.rbtnChargePerson.IsChecked == true)
            {
                ChargeApplyMaster.PAYTYPE = 1;
            }
            else
            {
                ChargeApplyMaster.PAYTYPE = 2;
            }

            eOrder.REMARK = this.tbRemark.Text;

            if (this.TravelSubject != null)
            {
                //var sd = this.TravelSubject.SpecialListDetail.FirstOrDefault();
                //(sd.Entity as T_FB_EXTENSIONORDERDETAIL).APPLIEDMONEY = this.TravelSubject.ApplyMoney;

                TravelSubject.SpecialListDetail.ForEach(item =>
                {
                    item.Entity.SetObjValue("CREATEUSERID", eOrder.GetObjValue("CREATEUSERID"));
                    item.Entity.SetObjValue("CREATEDATE", System.DateTime.Now);

                    item.Entity.SetObjValue("UPDATEUSERID", eOrder.GetObjValue("UPDATEUSERID"));
                    item.Entity.SetObjValue("UPDATEDATE", System.DateTime.Now);

                    #region 去掉无关的关联
                    T_FB_EXTENSIONORDERDETAIL detail = item.Entity as T_FB_EXTENSIONORDERDETAIL;
                    if (detail.T_FB_SUBJECT.T_FB_EXTENSIONORDERDETAIL != null)
                    {
                        detail.T_FB_SUBJECT.T_FB_EXTENSIONORDERDETAIL.Clear();
                    }
                    if (detail.T_FB_SUBJECT.T_FB_BUDGETACCOUNT != null)
                    {
                        detail.T_FB_SUBJECT.T_FB_BUDGETACCOUNT.Clear();
                    }
                    #endregion
                });
            }
            ExtensionalOrderDetailFBEntityList.ForEach(item =>
            {
                item.Entity.SetObjValue("CREATEUSERID", eOrder.GetObjValue("CREATEUSERID"));
                item.Entity.SetObjValue("CREATEDATE", System.DateTime.Now);

                item.Entity.SetObjValue("UPDATEUSERID", eOrder.GetObjValue("UPDATEUSERID"));
                item.Entity.SetObjValue("UPDATEDATE", System.DateTime.Now);

                #region 去掉无关的关联
                T_FB_EXTENSIONORDERDETAIL detail = item.Entity as T_FB_EXTENSIONORDERDETAIL;
                if (detail.T_FB_SUBJECT.T_FB_EXTENSIONORDERDETAIL != null)
                {
                    detail.T_FB_SUBJECT.T_FB_EXTENSIONORDERDETAIL.Clear();
                }
                if (detail.T_FB_SUBJECT.T_FB_BUDGETACCOUNT != null)
                {
                    detail.T_FB_SUBJECT.T_FB_BUDGETACCOUNT.Clear();
                }
                #endregion
            });

            if (this.gridForBorrowInfo.Visibility == System.Windows.Visibility.Collapsed)
            {
                var list = GetRelationFBEntities(this.ExtensionalOrderFBEntity, typeof(T_FB_CHARGEAPPLYMASTER).Name);
                list.Clear();
            }
        }