Example #1
0
        public T_FB_BORROWAPPLYMASTER GetBorrowApplyMasterByID(string strBorrowApplyMasterId)
        {
            T_FB_BORROWAPPLYMASTER entRd = new T_FB_BORROWAPPLYMASTER();

            using (BorrowApplyMasterBLL bllBorrowApplyMaster = new BorrowApplyMasterBLL())
            {
                entRd = bllBorrowApplyMaster.GetBorrowApplyMasterByID(strBorrowApplyMasterId);
                return(entRd);
            }
        }
Example #2
0
        /// <summary>
        /// 更新借款明细记录
        /// </summary>
        /// <param name="strBorrowMasterID"></param>
        /// <param name="detailList"></param>
        /// <returns></returns>
        public bool UpdateBorrowApplyDetail(string strBorrowMasterID, List <T_FB_BORROWAPPLYDETAIL> detailList)
        {
            bool bRes = false;

            try
            {
                if (string.IsNullOrWhiteSpace(strBorrowMasterID))
                {
                    return(bRes);
                }


                BorrowApplyMasterBLL   masterBLL = new BorrowApplyMasterBLL();
                T_FB_BORROWAPPLYMASTER entMaster = masterBLL.GetBorrowApplyMasterByID(strBorrowMasterID);

                bRes = DelBorrowApplyDetail(strBorrowMasterID);

                foreach (T_FB_BORROWAPPLYDETAIL item in detailList)
                {
                    if (item.EntityKey != null)
                    {
                        item.EntityKey = null;
                    }

                    item.BORROWAPPLYDETAILID = System.Guid.NewGuid().ToString();
                    if (item.T_FB_BORROWAPPLYMASTER == null)
                    {
                        item.T_FB_BORROWAPPLYMASTER = entMaster;
                    }
                    item.T_FB_BORROWAPPLYMASTER.EntityKey = new System.Data.EntityKey("TM_SaaS_OA_EFModelContext.T_FB_BORROWAPPLYMASTER", "BORROWAPPLYMASTERID", entMaster.BORROWAPPLYMASTERID);
                    Tracer.Debug("开始修改");
                    if (item.T_FB_SUBJECT != null)
                    {
                        item.T_FB_SUBJECT.EntityKey = new System.Data.EntityKey("TM_SaaS_OA_EFModelContext.T_FB_SUBJECT", "SUBJECTID", item.T_FB_SUBJECT.SUBJECTID);
                    }
                    Tracer.Debug("开始添加");
                    Add(item);
                }
                bRes = true;
            }
            catch (Exception ex)
            {
                Tracer.Debug(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "调用函数 UpdateBorrowApplyDetail 出现异常,异常信息为:" + ex.ToString());
                bRes = false;
            }

            return(bRes);
        }
Example #3
0
 public T_FB_BORROWAPPLYMASTER GetBorrowApplyMasterByID(string strBorrowApplyMasterId)
 {
     T_FB_BORROWAPPLYMASTER entRd = new T_FB_BORROWAPPLYMASTER();
     using(BorrowApplyMasterBLL bllBorrowApplyMaster = new BorrowApplyMasterBLL())
     {
         entRd = bllBorrowApplyMaster.GetBorrowApplyMasterByID(strBorrowApplyMasterId);
         return entRd;
     }
 }