Exemple #1
0
 public void UptRepayApplyMasterAndDetailForMobile(string strActionType, T_FB_REPAYAPPLYMASTER repayMaster,
                                                   List <T_FB_REPAYAPPLYDETAIL> repayDetail, ref string strMsg)
 {
     using (RepayApplyMasterBLL repayBLL = new RepayApplyMasterBLL())
     {
         repayBLL.UptRepayApplyMasterAndDetailForMobile(strActionType, repayMaster, repayDetail, ref strMsg);
     }
 }
Exemple #2
0
 public T_FB_REPAYAPPLYMASTER GetRepayApplyMasterByID(string strRepayApplyMasterId)
 {
     T_FB_REPAYAPPLYMASTER entRd = new T_FB_REPAYAPPLYMASTER();
     using(RepayApplyMasterBLL bllRepayApplyMaster = new RepayApplyMasterBLL())
     {
         entRd = bllRepayApplyMaster.GetRepayApplyMasterByID(strRepayApplyMasterId);
         return entRd;
     }
 }
Exemple #3
0
        public T_FB_REPAYAPPLYMASTER GetRepayApplyMasterByID(string strRepayApplyMasterId)
        {
            T_FB_REPAYAPPLYMASTER entRd = new T_FB_REPAYAPPLYMASTER();

            using (RepayApplyMasterBLL bllRepayApplyMaster = new RepayApplyMasterBLL())
            {
                entRd = bllRepayApplyMaster.GetRepayApplyMasterByID(strRepayApplyMasterId);
                return(entRd);
            }
        }
Exemple #4
0
        public bool AddRepayApplyMasterAndDetail(T_FB_REPAYAPPLYMASTER repayMaster, List <T_FB_REPAYAPPLYDETAIL> repayDetail)
        {
            bool re;

            using (RepayApplyMasterBLL repayBLL = new RepayApplyMasterBLL())
            {
                re = repayBLL.AddRepayApplyMasterAndDetail(repayMaster, repayDetail);
                return(re);
            }
        }
Exemple #5
0
        public bool AddRepayApplyMasterAndDetailForMobile(T_FB_REPAYAPPLYMASTER repayMaster, List <T_FB_REPAYAPPLYDETAIL> repayDetail, ref string strMsg)
        {
            bool re;

            using (RepayApplyMasterBLL repayBLL = new RepayApplyMasterBLL())
            {
                re = repayBLL.AddRepayApplyMasterAndDetailForMobile(repayMaster, repayDetail, ref strMsg);
                return(re);
            }
        }
 private void btnDelete_Click(object sender, RoutedEventArgs e)
 {
     if (DaGr.SelectedItems.Count > 0)
     {
         string Result = "";
         string StrTip = "";
         DelInfosList = new ObservableCollection <string>();
         ComfirmWindow com = new ComfirmWindow();
         com.OnSelectionBoxClosed += (obj, result) =>
         {
             for (int i = 0; i < DaGr.SelectedItems.Count; i++)
             {
                 T_FB_REPAYAPPLYMASTER tmpRepay = new T_FB_REPAYAPPLYMASTER();
                 tmpRepay = DaGr.SelectedItems[i] as T_FB_REPAYAPPLYMASTER;
                 string RepayId = "";
                 RepayId = tmpRepay.REPAYAPPLYMASTERID;
                 if (SMT.SaaS.FrameworkUI.Common.Utility.ToolBarButtonOperationPermission(tmpRepay, "T_FB_REPAYAPPLYMASTER", OperationType.Delete, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID))
                 {
                     if (!(DelInfosList.IndexOf(RepayId) > -1))
                     {
                         if (tmpRepay.CHECKSTATES == (int)CheckStates.UnSubmit)
                         {
                             DelInfosList.Add(RepayId);
                         }
                     }
                 }
                 else
                 {
                     //Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("YOUDONOTHAVEPERMISSIONTOOPERATETHEDATA"));
                     StrTip = "您不能删除您选中的第" + (i + 1).ToString() + "条,单据编号为" + tmpRepay.REPAYAPPLYCODE + "的还款申请";
                     ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), StrTip, Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                     return;
                 }
             }
             if (DelInfosList.Count > 0)
             {
                 client.DelRepayApplyMasterAndDetailAsync(DelInfosList);
             }
             else
             {
                 //Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("SELECTITEMSNOTDELETE"));
                 ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), "只能删除未提交的单据!",
                                                Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
             }
         };
         com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
     }
     else
     {
         ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
     }
 }
Exemple #7
0
 public bool UptRepayApplyCheckState(T_FB_REPAYAPPLYMASTER entity, List <T_FB_REPAYAPPLYDETAIL> repayDetail)
 {
     using (RepayApplyMasterBLL repayBLL = new RepayApplyMasterBLL())
     {
         bool   re   = true;
         string sMsg = repayBLL.UptRepayApplyCheckState(entity, repayDetail);
         if (!string.IsNullOrEmpty(sMsg))
         {
             re = false;
         }
         return(re);
     }
 }
Exemple #8
0
        /// <summary>
        /// 更新还款明细
        /// </summary>
        /// <param name="strRepayMasterID"></param>
        /// <param name="detailList"></param>
        /// <returns></returns>
        public bool UpdateRepayApplyDetail(string strRepayMasterID, List <T_FB_REPAYAPPLYDETAIL> detailList)
        {
            bool bRes = false;

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

                RepayApplyMasterBLL   masterBLL = new RepayApplyMasterBLL();
                T_FB_REPAYAPPLYMASTER entMaster = masterBLL.GetRepayApplyMasterByID(strRepayMasterID);
                bRes = DelRepayApplyDetail(strRepayMasterID);

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

                    item.REPAYAPPLYDETAILID = System.Guid.NewGuid().ToString();
                    if (item.T_FB_REPAYAPPLYMASTER == null)
                    {
                        item.T_FB_REPAYAPPLYMASTER = entMaster;
                    }
                    item.T_FB_REPAYAPPLYMASTER.EntityKey = new System.Data.EntityKey("TM_SaaS_OA_EFModelContext.T_FB_REPAYAPPLYMASTER", "REPAYAPPLYMASTERID", item.T_FB_REPAYAPPLYMASTER.REPAYAPPLYMASTERID);

                    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);
                    }

                    if (item.T_FB_BORROWAPPLYDETAIL != null)
                    {
                        item.T_FB_BORROWAPPLYDETAIL.EntityKey = new System.Data.EntityKey("TM_SaaS_OA_EFModelContext.T_FB_BORROWAPPLYDETAIL", "BORROWAPPLYDETAILID", item.T_FB_BORROWAPPLYDETAIL.BORROWAPPLYDETAILID);
                    }

                    Add(item);
                }
                bRes = true;
            }
            catch (Exception ex)
            {
                Tracer.Debug(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "调用函数 UpdateRepayApplyDetail 出现异常,异常信息为:" + ex.ToString());
                bRes = false;
            }

            return(bRes);
        }
        private void DaGr_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (DaGr.SelectedItems.Count == 0)
            {
                return;
            }
            //SelectMeeting = DaGr.SelectedItems[0] as V_BumfCompanySendDoc;
            DataGrid grid = sender as DataGrid;

            if (grid.SelectedItems.Count > 0)
            {
                RepayEntity = grid.SelectedItem as T_FB_REPAYAPPLYMASTER;
            }
        }
Exemple #10
0
        private void OnBorrowIDChanged <TEntity>()
        {
            DetailGrid dgrid = this.EditForm.FindControl("OrderGrid") as DetailGrid;

            if (dgrid != null)
            {
                dgrid.ShowToolBar = false;
            }

            ObservableCollection <FBEntity> details = this.OrderEntity.GetRelationFBEntities(typeof(TEntity).Name);

            details.Clear();

            T_FB_BORROWAPPLYMASTER borrowMaster = this.OrderEntity.GetObjValue(typeof(T_FB_BORROWAPPLYMASTER).Name.ToEntityString()) as T_FB_BORROWAPPLYMASTER;

            if (borrowMaster == null)
            {
                return;
            }

            T_FB_REPAYAPPLYMASTER repayMaster = this.OrderEntity.Entity as T_FB_REPAYAPPLYMASTER;

            if (repayMaster.OWNERID == borrowMaster.OWNERID)
            {
                if (repayMaster.OWNERPOSTID != borrowMaster.OWNERPOSTID)
                {
                    repayMaster.OWNERPOSTID   = borrowMaster.OWNERPOSTID;
                    repayMaster.OWNERPOSTNAME = borrowMaster.OWNERPOSTNAME;
                }

                if (repayMaster.OWNERDEPARTMENTID != borrowMaster.OWNERDEPARTMENTID)
                {
                    repayMaster.OWNERDEPARTMENTID   = borrowMaster.OWNERDEPARTMENTID;
                    repayMaster.OWNERDEPARTMENTNAME = borrowMaster.OWNERDEPARTMENTNAME;
                }

                if (repayMaster.OWNERCOMPANYID != borrowMaster.OWNERCOMPANYID)
                {
                    repayMaster.OWNERCOMPANYID   = borrowMaster.OWNERCOMPANYID;
                    repayMaster.OWNERCOMPANYNAME = borrowMaster.OWNERCOMPANYNAME;
                }
            }

            QueryExpression qeBorrow    = QueryExpressionHelper.Equal("T_FB_BORROWAPPLYMASTER.BORROWAPPLYMASTERID", borrowMaster.BORROWAPPLYMASTERID);
            QueryExpression qeOwner     = this.OrderEntity.GetQueryExpression(FieldName.OwnerID);
            QueryExpression qeOwnerPost = this.OrderEntity.GetQueryExpression(FieldName.OwnerPostID);

            qeBorrow.QueryType         = typeof(TEntity).Name;
            qeBorrow.RelatedExpression = qeOwner;
            qeOwner.RelatedExpression  = qeOwnerPost;

            FBEntityService service = new FBEntityService();

            service.QueryFBEntitiesCompleted += (o, ea) =>
            {
                ea.Result.ToList().ForEach(item =>
                {
                    details.Add(item);
                    item.FBEntityState = FBEntityState.Added;
                });
            };
            service.QueryFBEntities(qeBorrow);
        }
Exemple #11
0
        /// <summary>
        /// 根据传回的XML,添加还款申请信息
        /// </summary>
        /// <param name="eGFunc"></param>
        /// <returns></returns>
        private static string RepayApplyAdd(IEnumerable<XElement> eGFunc)
        {
            try
            {
                if (eGFunc.Count() == 0)
                {
                    return "";
                }
                string strEmployeeID = string.Empty;
                string strOwnerID = string.Empty;
                string strOwnerName = string.Empty;
                string strOwnerPostID = string.Empty;
                string strOwnerPostName = string.Empty;
                string strOwnerDepartmentID = string.Empty;
                string strOwnerDepartmentName = string.Empty;
                string strOwnerCompanyID = string.Empty;
                string strOwnerCompanyName = string.Empty;
                string strCheckState = string.Empty;
                string strCreateCompanyID = string.Empty;
                string strCreateCompanyName = string.Empty;
                string strCreateDepartmentID = string.Empty;
                string strCreateDepartmentName = string.Empty;
                string strCreatePostID = string.Empty;
                string strCreatePostName = string.Empty;
                string strCreateID = string.Empty;
                string strCreateName = string.Empty;
                string strBorrowMasterID = string.Empty;
                decimal dBorrowTotal = 0;

                foreach (var q in eGFunc)
                {
                    string strName = q.Attribute("Name").Value;
                    switch (strName)
                    {
                        case "CREATEUSERID":
                            strEmployeeID = q.Attribute("Value").Value;
                            break;
                        case "OWNERID":
                            strOwnerID = q.Attribute("Value").Value;
                            break;
                        case "OWNERNAME":
                            strOwnerName = q.Attribute("Value").Value;
                            break;
                        case "OWNERPOSTID":
                            strOwnerPostID = q.Attribute("Value").Value;
                            break;
                        case "OWNERPOSTNAME":
                            strOwnerPostName = q.Attribute("Value").Value;
                            break;
                        case "OWNERDEPARTMENTID":
                            strOwnerDepartmentID = q.Attribute("Value").Value;
                            break;
                        case "OWNERDEPARTMENTNAME":
                            strOwnerDepartmentName = q.Attribute("Value").Value;
                            break;
                        case "OWNERCOMPANYID":
                            strOwnerCompanyID = q.Attribute("Value").Value;
                            break;
                        case "OWNERCOMPANYNAME":
                            strOwnerCompanyName = q.Attribute("Value").Value;
                            break;
                        case "CHECKSTATE":
                            strCheckState = q.Attribute("Value").Value;
                            break;
                        case "CREATEID":
                            strCreateID = q.Attribute("Value").Value;
                            break;
                        case "CREATENAME":
                            strCreateName = q.Attribute("Value").Value;
                            break;
                        case "CREATEPOSTID":
                            strCreatePostID = q.Attribute("Value").Value;
                            break;
                        case "CREATEPOSTNAME":
                            strCreatePostName = q.Attribute("Value").Value;
                            break;
                        case "CREATEDEPARTMENTID":
                            strCreateDepartmentID = q.Attribute("Value").Value;
                            break;
                        case "CREATEDEPARTMENTNAME":
                            strCreateDepartmentName = q.Attribute("Value").Value;
                            break;
                        case "CREATECOMPANYID":
                            strCreateCompanyID = q.Attribute("Value").Value;
                            break;
                        case "CREATECOMPANYNAME":
                            strCreateCompanyName = q.Attribute("Value").Value;
                            break;
                        case "BORROWAPPLYMASTERID":
                            strBorrowMasterID = q.Attribute("Value").Value;
                            break;
                    }
                }
                DailyManagementServices doc = new DailyManagementServices();
                string employeeid = strEmployeeID.Replace("{", "").Replace("}", "");

                T_FB_BORROWAPPLYMASTER borMaster = doc.GetBorrowApplyMasterByID(strBorrowMasterID);
                T_FB_REPAYAPPLYMASTER entity = new T_FB_REPAYAPPLYMASTER();
                entity.REPAYAPPLYMASTERID = Guid.NewGuid().ToString();
                entity.CHECKSTATES = 0;
                entity.CREATECOMPANYID = borMaster.CREATECOMPANYID;
                entity.CREATECOMPANYNAME = borMaster.CREATECOMPANYNAME;
                entity.CREATEDATE = DateTime.Now;
                entity.CREATEDEPARTMENTID = borMaster.CREATEDEPARTMENTID;
                entity.CREATEDEPARTMENTNAME = borMaster.CREATEDEPARTMENTNAME;
                entity.CREATEPOSTID = borMaster.CREATEPOSTID;
                entity.CREATEPOSTNAME = borMaster.CREATEPOSTNAME;
                entity.CREATEUSERID = borMaster.CREATEUSERID;
                entity.CREATEUSERNAME = borMaster.CREATEUSERNAME;
                entity.EDITSTATES = 0;
                entity.OWNERCOMPANYID = borMaster.OWNERCOMPANYID;
                entity.OWNERCOMPANYNAME = borMaster.OWNERCOMPANYNAME;
                entity.OWNERDEPARTMENTID = borMaster.OWNERDEPARTMENTID;
                entity.OWNERDEPARTMENTNAME = borMaster.OWNERDEPARTMENTNAME;
                entity.OWNERID = borMaster.OWNERID;
                entity.OWNERNAME = borMaster.OWNERNAME;
                entity.OWNERPOSTID = borMaster.OWNERPOSTID;
                entity.OWNERPOSTNAME = borMaster.OWNERPOSTNAME;
                entity.PROJECTEDREPAYDATE = DateTime.Now;
                entity.REMARK = "";
                entity.UPDATEDATE = DateTime.Now;
                entity.UPDATEUSERID = borMaster.UPDATEUSERID;
                entity.UPDATEUSERNAME = borMaster.UPDATEUSERNAME;
                entity.REPAYTYPE = borMaster.REPAYTYPE;
                entity.TOTALMONEY = 0;
                entity.T_FB_BORROWAPPLYMASTER = borMaster;

                //从表操作
                List<object> masterCode = new List<object>();
                masterCode.Add(entity.T_FB_BORROWAPPLYMASTER.BORROWAPPLYMASTERID);
                List<T_FB_BORROWAPPLYDETAIL> BorDetail = doc.GetBorrowApplyDetailByMasterID(masterCode);
                List<T_FB_REPAYAPPLYDETAIL> RepDetail = new List<T_FB_REPAYAPPLYDETAIL>();//还款从表

                dBorrowTotal = 0;
                foreach (var detail in BorDetail)
                {
                    T_FB_REPAYAPPLYDETAIL RepayDetailInfo = new T_FB_REPAYAPPLYDETAIL();
                    RepayDetailInfo.REPAYAPPLYDETAILID = Guid.NewGuid().ToString();
                    RepayDetailInfo.REPAYAPPLYDETAILID = System.Guid.NewGuid().ToString();
                    RepayDetailInfo.BORROWMONEY = detail.BORROWMONEY;
                    RepayDetailInfo.REMARK = detail.REMARK;
                    RepayDetailInfo.T_FB_SUBJECT = detail.T_FB_SUBJECT;
                    RepayDetailInfo.T_FB_BORROWAPPLYDETAIL = detail;
                    RepayDetailInfo.UPDATEDATE = DateTime.Now;
                    RepayDetailInfo.CREATEDATE = DateTime.Now;
                    RepayDetailInfo.T_FB_REPAYAPPLYMASTER = entity;
                    RepayDetailInfo.CREATEUSERID = detail.CREATEUSERID;
                    RepayDetailInfo.UPDATEUSERID = detail.UPDATEUSERID;
                    RepayDetailInfo.CHARGETYPE = 1;
                    RepayDetailInfo.REPAYMONEY = 0;
                    RepayDetailInfo.CREATEDATE = DateTime.Now;
                    dBorrowTotal += detail.BORROWMONEY;
                    RepDetail.Add(RepayDetailInfo);
                }
                entity.BRORROWEDMONEY = dBorrowTotal;

                string strRepayCode = string.Empty, strMsg = string.Empty;

                doc.AddRepayApplyMasterAndDetail(entity, RepDetail);

                SMT.SaaS.BLLCommonServices.EngineConfigWS.EngineWcfGlobalFunctionClient Client = new EngineWS.EngineWcfGlobalFunctionClient();
                EngineWS.CustomUserMsg[] user = new EngineWS.CustomUserMsg[1];
                user[0] = new EngineWS.CustomUserMsg() { UserID = entity.OWNERID, FormID = entity.REPAYAPPLYMASTERID };
                Dictionary<string, string> dic = new Dictionary<string, string>();
                dic.Add("BORROWAPPLYMASTERID", borMaster.BORROWAPPLYMASTERID);
                Client.ApplicationMsgTrigger(user, "FB", "T_FB_REPAYAPPLYMASTER", Utility.ObjListToXml<T_FB_REPAYAPPLYMASTER>(entity, "FB", null), EngineWS.MsgType.Task);

                return entity.REPAYAPPLYMASTERID;
            }
            catch (Exception e)
            {
                string abc = "<FB>Message=[" + e.Message + "]" + "<FB>Source=[" + e.Source + "]<FB>StackTrace=[" + e.StackTrace + "]<FB>TargetSite=[" + e.TargetSite + "]";
                Tracer.Debug(abc);
                return abc;
            }
        }
 private void btnDelete_Click(object sender, RoutedEventArgs e)
 {
     if (DaGr.SelectedItems.Count > 0)
     {
         string Result = "";
         string StrTip = "";
         DelInfosList = new ObservableCollection<string>();
         ComfirmWindow com = new ComfirmWindow();
         com.OnSelectionBoxClosed += (obj, result) =>
         {
             for (int i = 0; i < DaGr.SelectedItems.Count; i++)
             {
                 T_FB_REPAYAPPLYMASTER tmpRepay = new T_FB_REPAYAPPLYMASTER();
                 tmpRepay = DaGr.SelectedItems[i] as T_FB_REPAYAPPLYMASTER;
                 string RepayId = "";
                 RepayId = tmpRepay.REPAYAPPLYMASTERID;
                 if (SMT.SaaS.FrameworkUI.Common.Utility.ToolBarButtonOperationPermission(tmpRepay, "T_FB_REPAYAPPLYMASTER", OperationType.Delete, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID))
                 {
                     if (!(DelInfosList.IndexOf(RepayId) > -1))
                     {
                         if (tmpRepay.CHECKSTATES == (int)CheckStates.UnSubmit)
                         {
                             DelInfosList.Add(RepayId);
                         }
                     }
                 }
                 else
                 {
                     //Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("YOUDONOTHAVEPERMISSIONTOOPERATETHEDATA"));
                     StrTip = "您不能删除您选中的第" + (i + 1).ToString() + "条,单据编号为" + tmpRepay.REPAYAPPLYCODE + "的还款申请";
                     ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), StrTip, Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                     return;
                 }
             }
             if (DelInfosList.Count > 0)
             {
                 client.DelRepayApplyMasterAndDetailAsync(DelInfosList);
             }
             else
             {
                 //Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("SELECTITEMSNOTDELETE"));
                 ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), "只能删除未提交的单据!",
                 Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
             }
         };
         com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
     }
     else
     {
         ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
     }
 }
Exemple #13
0
 public string GetRepayOrderCode(T_FB_REPAYAPPLYMASTER entity)
 {
     return new OrderCodeBLL().GetAutoOrderCode(entity);
 }
Exemple #14
0
 public void UptRepayApplyMasterAndDetailForMobile(string strActionType, T_FB_REPAYAPPLYMASTER repayMaster,
     List<T_FB_REPAYAPPLYDETAIL> repayDetail, ref string strMsg)
 {
     using (RepayApplyMasterBLL repayBLL = new RepayApplyMasterBLL())
     {
         repayBLL.UptRepayApplyMasterAndDetailForMobile(strActionType, repayMaster, repayDetail, ref strMsg);
     }
 }
Exemple #15
0
 private void SaveRepayApply(T_FB_REPAYAPPLYMASTER repayMaster)
 {
     PersonnelServiceClient psc = new PersonnelServiceClient();
     psc.GetEmployeeDetailByIDCompleted += (sender, e) =>
     {
         RefreshUI(RefreshedTypes.HideProgressBar);
         var employee = e.Result;
         var strMsgE = string.Empty;
         if (employee == null || employee.EMPLOYEEPOSTS == null)
         {
             strMsgE = "申请人已不存在,请重新建单!";
         }
         else
         {
             var find = employee.EMPLOYEEPOSTS.FirstOrDefault(item => item.T_HR_POST.POSTID == strOwnerPostID);
             if (find == null)
             {
                 strMsgE = "申请人已异动, 请重新建单!";
             }
         }
         if (!string.IsNullOrEmpty(strMsgE))
         {
             Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("TIPS"), strMsgE);
         }
         else
         {
             // 没有错的情况再保存
             InnerSaveRepayApply(repayMaster);
         }
     };
     RefreshUI(RefreshedTypes.ShowProgressBar);
     psc.GetEmployeeDetailByIDAsync(strOwnerID);
 }
Exemple #16
0
 public string GetRepayOrderCode(T_FB_REPAYAPPLYMASTER entity)
 {
     return(new OrderCodeBLL().GetAutoOrderCode(entity));
 }
 private void DaGr_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (DaGr.SelectedItems.Count == 0)
     {
         return;
     }
     //SelectMeeting = DaGr.SelectedItems[0] as V_BumfCompanySendDoc;
     DataGrid grid = sender as DataGrid;
     if (grid.SelectedItems.Count > 0)
     {
         RepayEntity = grid.SelectedItem as T_FB_REPAYAPPLYMASTER;
     }
 }
Exemple #18
0
 public bool AddRepayApplyMasterAndDetail(T_FB_REPAYAPPLYMASTER repayMaster, List<T_FB_REPAYAPPLYDETAIL> repayDetail)
 {
     bool re;
     using(RepayApplyMasterBLL repayBLL = new RepayApplyMasterBLL())
     {
         re = repayBLL.AddRepayApplyMasterAndDetail(repayMaster, repayDetail);
         return re;
     }
 }
Exemple #19
0
 public void AddToT_FB_REPAYAPPLYMASTER(T_FB_REPAYAPPLYMASTER t_FB_REPAYAPPLYMASTER)
 {
     base.AddObject("T_FB_REPAYAPPLYMASTER", t_FB_REPAYAPPLYMASTER);
 }
Exemple #20
0
 public bool UptRepayApplyCheckState(T_FB_REPAYAPPLYMASTER entity, List<T_FB_REPAYAPPLYDETAIL> repayDetail)
 {
     using(RepayApplyMasterBLL repayBLL = new RepayApplyMasterBLL())
     {
         bool re = true;
         string sMsg = repayBLL.UptRepayApplyCheckState(entity, repayDetail);
         if(!string.IsNullOrEmpty(sMsg))
         {
             re = false;
         }
         return re;
     }
 }
Exemple #21
0
        void client_GetRepayApplyMasterByIDCompleted(object sender, GetRepayApplyMasterByIDCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        RepayMasterEntity = e.Result;
                        personclient.GetEmployeePostBriefByEmployeeIDAsync(RepayMasterEntity.OWNERID);
                        if(!string.IsNullOrEmpty(RepayMasterEntity.REPAYAPPLYCODE.Trim()))
                        {
                            txtCode.Text = RepayMasterEntity.REPAYAPPLYCODE;
                        }
                        else
                        {
                            hideCode();
                        }
                        txtRemark.Text = RepayMasterEntity.REMARK == null ? "" : RepayMasterEntity.REMARK;
                        txttotal.Text = RepayMasterEntity.TOTALMONEY.ToString();
                        txtPayInfo.Text = RepayMasterEntity.PAYMENTINFO==null?"":RepayMasterEntity.PAYMENTINFO;     //支付信息
                        strOwnerCompanyID = RepayMasterEntity.OWNERCOMPANYID;
                        strOwnerCompanyName = RepayMasterEntity.OWNERCOMPANYNAME;
                        strOwnerDepartmentID = RepayMasterEntity.OWNERDEPARTMENTID;
                        strOwnerDepartmentName = RepayMasterEntity.OWNERDEPARTMENTNAME;
                        strOwnerPostID = RepayMasterEntity.OWNERPOSTID;
                        strOwnerPostName = RepayMasterEntity.OWNERPOSTNAME;
                        strOwnerID = RepayMasterEntity.OWNERID;
                        strOwnerName = RepayMasterEntity.OWNERNAME;

                        client.GetRepayApplyDetailListByMasterIDAsync(RepayMasterEntity.REPAYAPPLYMASTERID);
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.ToString());
            }
        }
Exemple #22
0
 public bool AddRepayApplyMasterAndDetailForMobile(T_FB_REPAYAPPLYMASTER repayMaster, List<T_FB_REPAYAPPLYDETAIL> repayDetail,ref string strMsg)
 {
     bool re;
     using (RepayApplyMasterBLL repayBLL = new RepayApplyMasterBLL())
     {
         re = repayBLL.AddRepayApplyMasterAndDetailForMobile(repayMaster, repayDetail,ref strMsg);
         return re;
     }
 }
Exemple #23
0
        /// <summary>
        /// 保存还款单
        /// </summary>
        /// <param name="repayMaster"></param>
        private void InnerSaveRepayApply(T_FB_REPAYAPPLYMASTER repayMaster)
        {
            repayMaster.BRORROWEDMONEY = dBorrowTotal;
            repayMaster.CREATECOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            repayMaster.CREATECOMPANYNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName;
            repayMaster.CREATEDATE = DateTime.Now;
            repayMaster.CREATEDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
            repayMaster.CREATEDEPARTMENTNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentName;
            repayMaster.CREATEPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            repayMaster.CREATEPOSTNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostName;
            repayMaster.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
            repayMaster.CREATEUSERNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
            repayMaster.EDITSTATES = 0;
            repayMaster.OWNERCOMPANYID = strOwnerCompanyID;
            repayMaster.OWNERCOMPANYNAME = strOwnerCompanyName;
            repayMaster.OWNERDEPARTMENTID = strOwnerDepartmentID;
            repayMaster.OWNERDEPARTMENTNAME = strOwnerDepartmentName;
            repayMaster.OWNERID = strOwnerID;
            repayMaster.OWNERNAME = strOwnerName;
            repayMaster.OWNERPOSTID = strOwnerPostID;
            repayMaster.OWNERPOSTNAME = strOwnerPostName;
            repayMaster.PROJECTEDREPAYDATE = DateTime.Now;
            repayMaster.REMARK = txtRemark.Text;
            if (txtCode.Text.IndexOf('>') > 0)
            {
                repayMaster.REPAYAPPLYCODE = " ";
            }
            else
            {
                repayMaster.REPAYAPPLYCODE = txtCode.Text;
            }
            //repayMaster.REPAYTYPE = nRepayType;
            repayMaster.TOTALMONEY = decimal.Parse(txttotal.Text.ToString());
            repayMaster.UPDATEDATE = DateTime.Now;
            repayMaster.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
            repayMaster.UPDATEUSERNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
            repayMaster.PAYMENTINFO = txtPayInfo.Text;

            repayDetailData.Clear();
            string strMsg = string.Empty;
            foreach (object obj in dgvRepayDetailList.ItemsSource)
            {
                T_FB_REPAYAPPLYDETAIL ent = obj as T_FB_REPAYAPPLYDETAIL;
                T_FB_REPAYAPPLYDETAIL repay = new T_FB_REPAYAPPLYDETAIL();
                repay.REPAYAPPLYDETAILID = System.Guid.NewGuid().ToString();
                repay.UPDATEDATE = DateTime.Now;
                repay.CREATEDATE = DateTime.Now;
                repay.T_FB_REPAYAPPLYMASTER = repayMaster;
                repay.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                repay.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                repay.BORROWMONEY = ent.BORROWMONEY;
                repay.CHARGETYPE = ent.CHARGETYPE;
                repay.REPAYTYPE = ent.REPAYTYPE;

                if (dgvRepayDetailList.Columns[2].GetCellContent(obj) != null)
                {
                    TextBox txtMark = dgvRepayDetailList.Columns[2].GetCellContent(obj).FindName("txtRemark") as TextBox;
                    repay.REMARK = txtMark.Text;
                }
                if (dgvRepayDetailList.Columns[3].GetCellContent(obj) != null)
                {
                    TextBox tbMon = dgvRepayDetailList.Columns[3].GetCellContent(obj).FindName("txtMon") as TextBox;
                    repay.REPAYMONEY = decimal.Parse(string.IsNullOrEmpty(tbMon.Text.ToString()) == true ? "0" : tbMon.Text.ToString());
                }
                repayDetailData.Add(repay);
            }

            if (!string.IsNullOrWhiteSpace(strMsg))
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("TIPS"), strMsg);
                return;
            }

            RefreshUI(RefreshedTypes.ShowProgressBar);
            if (types == FormTypes.New)
            {
                string strCode = string.Empty, strResMsg = string.Empty;
                client.AddRepayApplyMasterAndDetailAsync(repayMaster, repayDetailData);
            }
            else if (types == FormTypes.Edit)
            {
                if (needsubmit == false)
                {
                    client.UptRepayApplyMasterAndDetailAsync("Edit", repayMaster, repayDetailData, strMsg, "Edit");
                }
                else
                {
                    RepayMasterEntity = repayMaster;
                    client.GetRepayOrderCodeAsync(repayMaster);
                }
            }
            else if (types == FormTypes.Resubmit)
            {
                client.UptRepayApplyMasterAndDetailAsync("ReSubmit", repayMaster, repayDetailData, strMsg, "ReSubmit");
            }
        }
Exemple #24
0
        /// <summary>
        /// 还款审核中时检查还款金额是否大于借款余额
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="detailList"></param>
        /// <param name="dCheckState"></param>
        /// <returns></returns>
        public string CheckRepMoneyForRepay(T_FB_REPAYAPPLYMASTER entity, List <T_FB_REPAYAPPLYDETAIL> detailList, decimal dCheckState)
        {
            string             sResult   = "";
            string             ErrInfo   = "";
            T_FB_PERSONACCOUNT entPerson = new T_FB_PERSONACCOUNT();

            try
            {
                IQueryable <T_FB_PERSONACCOUNT> qAccount = from a in dal.GetObjects()
                                                           where
                                                           a.OWNERID == entity.OWNERID &&
                                                           a.OWNERCOMPANYID == entity.OWNERCOMPANYID
                                                           select a;

                if (qAccount != null && qAccount.Count() > 0)
                {
                    ErrInfo = this.GetType().ToString() + "," + System.DateTime.Now.ToString() + " 还款单ID:" + entity.REPAYAPPLYMASTERID;
                    T_FB_PERSONACCOUNT obj = qAccount.FirstOrDefault();
                    foreach (T_FB_REPAYAPPLYDETAIL rep in detailList)
                    {
                        if (dCheckState == Convert.ToDecimal(FBAEnums.CheckStates.Approving) || dCheckState == Convert.ToDecimal(FBAEnums.CheckStates.Approved))
                        {
                            if (rep.REPAYTYPE == 1)
                            {
                                if (obj.SIMPLEBORROWMONEY < rep.REPAYMONEY)
                                {
                                    ErrInfo += " 明细ID:" + rep.REPAYAPPLYDETAILID + ", 还普通借款审核中时还款金额 " + rep.REPAYMONEY + " 大于借款余额 " + obj.SIMPLEBORROWMONEY + " 审核终止 ||";
                                    Tracer.Debug(ErrInfo);
                                    sResult = "还款额度不能大于借款余额,请审核不通过。";
                                    return(sResult);
                                }
                            }
                            else if (rep.REPAYTYPE == 2)
                            {
                                if (obj.BACKUPBORROWMONEY < rep.REPAYMONEY)
                                {
                                    ErrInfo += " 明细ID:" + rep.REPAYAPPLYDETAILID + ", 还备用金借款审核中时还款金额 " + rep.REPAYMONEY + " 大于借款余额 " + obj.BACKUPBORROWMONEY + " 审核终止 ||";
                                    Tracer.Debug(ErrInfo);
                                    sResult = "还款额度不能大于借款余额,请审核不通过。";
                                    return(sResult);
                                }
                            }
                            else if (rep.REPAYTYPE == 3)
                            {
                                if (obj.SPECIALBORROWMONEY < rep.REPAYMONEY)
                                {
                                    ErrInfo += " 明细ID:" + rep.REPAYAPPLYDETAILID + ", 还专项借款审核中时还款金额 " + rep.REPAYMONEY + " 大于借款余额 " + obj.SPECIALBORROWMONEY + " 审核终止 ||";
                                    Tracer.Debug(ErrInfo);
                                    sResult = "还款额度不能大于借款余额,请审核不通过。";
                                    return(sResult);
                                }
                            }
                        }
                    }
                }
                else
                {
                    ErrInfo = this.GetType().ToString() + "," + System.DateTime.Now.ToString() + " 还款单ID:" + entity.REPAYAPPLYMASTERID + ", PersonAccount表中找不到相关数据。";
                    Tracer.Debug(ErrInfo);
                    sResult = "没有找到相应的借款总账数据,审核终止!";
                    return(sResult);
                }
                return("");
            }
            catch (Exception ex)
            {
                ErrInfo = this.GetType().ToString() + ":CheckRepMoneyForRepay," + System.DateTime.Now.ToString() + "," + ex.Message;
                Tracer.Debug(ErrInfo);
                sResult = "还款金额检查程序异常,审核终止!";
                return(sResult);
            }
        }
Exemple #25
0
        /// <summary>
        /// 还款单审核通过后更新T_FB_PERSONACCOUNT表数据
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public bool UptPersonAccountByRepa(T_FB_REPAYAPPLYMASTER entity, List <T_FB_REPAYAPPLYDETAIL> detailList, decimal dCheckState)
        {
            bool               re;
            string             ErrInfo   = "";
            T_FB_PERSONACCOUNT entPerson = new T_FB_PERSONACCOUNT();

            try
            {
                IQueryable <T_FB_PERSONACCOUNT> qAccount = from a in dal.GetObjects()
                                                           where
                                                           a.OWNERID == entity.OWNERID &&
                                                           a.OWNERCOMPANYID == entity.OWNERCOMPANYID
                                                           select a;

                if (qAccount != null && qAccount.Count() > 0)
                {
                    ErrInfo = this.GetType().ToString() + "," + System.DateTime.Now.ToString() + " 还款单ID:" + entity.REPAYAPPLYMASTERID;
                    T_FB_PERSONACCOUNT obj = qAccount.FirstOrDefault();
                    foreach (T_FB_REPAYAPPLYDETAIL rep in detailList)
                    {
                        if (dCheckState == Convert.ToDecimal(FBAEnums.CheckStates.Approved))  //终审通过
                        {
                            if (rep.REPAYMONEY == 0)
                            {
                                continue;
                            }
                            if (rep.REPAYTYPE == 1)
                            {
                                obj.SIMPLEBORROWMONEY -= rep.REPAYMONEY;
                                ErrInfo += " 明细ID:" + rep.REPAYAPPLYDETAILID + ", 还款终审通过时更新PersonAccount表,还普通借款,扣减金额" + rep.REPAYMONEY + "||";
                            }
                            else if (rep.REPAYTYPE == 2)
                            {
                                obj.BACKUPBORROWMONEY -= rep.REPAYMONEY;
                                ErrInfo += " 明细ID:" + rep.REPAYAPPLYDETAILID + ", 还款终审通过时更新PersonAccount表,还备用金借款,扣减金额" + rep.REPAYMONEY + "||";
                            }
                            else if (rep.REPAYTYPE == 3)
                            {
                                obj.SPECIALBORROWMONEY -= rep.REPAYMONEY;
                                ErrInfo += " 明细ID:" + rep.REPAYAPPLYDETAILID + ", 还款终审通过时更新PersonAccount表,还专项借款,扣减金额" + rep.REPAYMONEY + "||";
                            }
                            obj.BORROWMONEY -= rep.REPAYMONEY;
                        }
                        obj.UPDATEUSERID = entity.UPDATEUSERID;
                        obj.UPDATEDATE   = DateTime.Now;

                        re = Update(obj);
                        if (!re)
                        {
                            ErrInfo += ", 失败!";
                            Tracer.Debug(ErrInfo);
                            return(false);
                        }
                        CreatePersonAccountWaterFlow(obj, rep);  //写流水
                    }
                }
                else
                {
                    ErrInfo = this.GetType().ToString() + "," + System.DateTime.Now.ToString() + " 还款单ID:" + entity.REPAYAPPLYMASTERID + ", PersonAccount表中找不到相关数据。";
                    Tracer.Debug(ErrInfo);
                    return(false);
                }
                ErrInfo += ", 成功!";
                Tracer.Debug(ErrInfo);
                return(true);
            }
            catch (Exception ex)
            {
                ErrInfo = this.GetType().ToString() + ":UptPersonAccountByRepa," + System.DateTime.Now.ToString() + "," + ex.Message;
                Tracer.Debug(ErrInfo);
                return(false);
            }
        }
Exemple #26
0
 public static T_FB_REPAYAPPLYMASTER CreateT_FB_REPAYAPPLYMASTER(
             string rEPAYAPPLYMASTERID, 
             decimal rEPAYTYPE, 
             decimal tOTALMONEY, 
             decimal eDITSTATES, 
             decimal cHECKSTATES, 
             string oWNERID, 
             string oWNERPOSTID, 
             string oWNERDEPARTMENTID, 
             string oWNERCOMPANYID, 
             string cREATEUSERID, 
             global::System.DateTime cREATEDATE, 
             string cREATECOMPANYID, 
             string cREATEDEPARTMENTID, 
             string cREATEPOSTID, 
             string uPDATEUSERID, 
             global::System.DateTime uPDATEDATE)
 {
     T_FB_REPAYAPPLYMASTER t_FB_REPAYAPPLYMASTER = new T_FB_REPAYAPPLYMASTER();
     t_FB_REPAYAPPLYMASTER.REPAYAPPLYMASTERID = rEPAYAPPLYMASTERID;
     t_FB_REPAYAPPLYMASTER.REPAYTYPE = rEPAYTYPE;
     t_FB_REPAYAPPLYMASTER.TOTALMONEY = tOTALMONEY;
     t_FB_REPAYAPPLYMASTER.EDITSTATES = eDITSTATES;
     t_FB_REPAYAPPLYMASTER.CHECKSTATES = cHECKSTATES;
     t_FB_REPAYAPPLYMASTER.OWNERID = oWNERID;
     t_FB_REPAYAPPLYMASTER.OWNERPOSTID = oWNERPOSTID;
     t_FB_REPAYAPPLYMASTER.OWNERDEPARTMENTID = oWNERDEPARTMENTID;
     t_FB_REPAYAPPLYMASTER.OWNERCOMPANYID = oWNERCOMPANYID;
     t_FB_REPAYAPPLYMASTER.CREATEUSERID = cREATEUSERID;
     t_FB_REPAYAPPLYMASTER.CREATEDATE = cREATEDATE;
     t_FB_REPAYAPPLYMASTER.CREATECOMPANYID = cREATECOMPANYID;
     t_FB_REPAYAPPLYMASTER.CREATEDEPARTMENTID = cREATEDEPARTMENTID;
     t_FB_REPAYAPPLYMASTER.CREATEPOSTID = cREATEPOSTID;
     t_FB_REPAYAPPLYMASTER.UPDATEUSERID = uPDATEUSERID;
     t_FB_REPAYAPPLYMASTER.UPDATEDATE = uPDATEDATE;
     return t_FB_REPAYAPPLYMASTER;
 }
Exemple #27
0
        private string GetXmlString(string StrSorce, T_FB_REPAYAPPLYMASTER Info)
        {
            string goouttomeet = string.Empty;
            string privateaffair = string.Empty;
            string companycar = string.Empty;
            string isagent = string.Empty;

            SMT.SaaS.MobileXml.MobileXml mx = new MobileXml();
            SMT.SaaS.MobileXml.AutoDictionary ad = new AutoDictionary();
            List<SMT.SaaS.MobileXml.AutoDictionary> AutoList = new List<SMT.SaaS.MobileXml.AutoDictionary>();

            string StrPayType = "";
            string StrEditState = "";
            switch (Info.REPAYTYPE.ToString())
            {
                case "1":
                    StrPayType = "现金还普通借款";
                    break;
                case "2":
                    StrPayType = "现金还备用金借款";
                    break;
                case "3":
                    StrPayType = "现金还专项借款";
                    break;
            }
            switch (Info.EDITSTATES.ToString())
            {
                case "0":
                    StrEditState = "删除状态";
                    break;
                case "1":
                    StrEditState = "已生效";
                    break;
                case "2":
                    StrEditState = "未生效";
                    break;
                case "3":
                    StrEditState = "撤消中";
                    break;
                case "4":
                    StrEditState = "已撤消";
                    break;
            }
            AutoList.Add(basedata("T_FB_REPAYAPPLYMASTER", "POSTLEVEL", txPostLevel, null));//POSTLEVEL
            AutoList.Add(basedata("T_FB_REPAYAPPLYMASTER", "REPAYTYPE", Info.REPAYTYPE.ToString(), StrPayType));//相关单据类型
            AutoList.Add(basedata("T_FB_REPAYAPPLYMASTER", "EDITSTATES", Info.EDITSTATES.ToString(), StrEditState));//编辑状态
            if (Info.OWNERID != null && !string.IsNullOrEmpty(strOwnerName))
            {
                AutoList.Add(basedata("T_FB_REPAYAPPLYMASTER", "OWNERID", Info.OWNERID, strOwnerName + "-" + strOwnerPostName + "-" + strOwnerDepartmentName + "-" + strOwnerCompanyName));
            }
            if (Info.OWNERCOMPANYID != null && !string.IsNullOrEmpty(strOwnerCompanyName))
            {
                AutoList.Add(basedata("T_FB_REPAYAPPLYMASTER", "OWNERCOMPANYID", Info.OWNERCOMPANYID, strOwnerCompanyName));
            }
            if (Info.OWNERDEPARTMENTID != null && !string.IsNullOrEmpty(strOwnerDepartmentName))
            {
                AutoList.Add(basedata("T_FB_REPAYAPPLYMASTER", "OWNERDEPARTMENTID", Info.OWNERDEPARTMENTID, strOwnerDepartmentName));
            }
            if (Info.OWNERPOSTID != null && !string.IsNullOrEmpty(strOwnerPostName))
            {
                AutoList.Add(basedata("T_FB_REPAYAPPLYMASTER", "OWNERPOSTID", Info.OWNERPOSTID, strOwnerPostName));
            }
            //AutoList.Add(basedata("T_FB_REPAYAPPLYMASTER", "BORROWAPPLYMASTERID", Info.T_FB_BORROWAPPLYMASTER.BORROWAPPLYMASTERCODE, Info.T_FB_BORROWAPPLYMASTER.BORROWAPPLYMASTERCODE));

            ObservableCollection<T_FB_REPAYAPPLYDETAIL> objR;
            if (repayDetailData != null && repayDetailData.Count > 0)
            {
                objR = repayDetailData;
            }
            else
            {
                objR = repayDetailData;
            }
            foreach (T_FB_REPAYAPPLYDETAIL objDetail in objR)
            {
                if (objDetail.T_FB_SUBJECT != null)
                {
                    AutoList.Add(basedataForChild("T_FB_REPAYAPPLYDETAIL", "SUBJECTID", objDetail.T_FB_SUBJECT.SUBJECTID, objDetail.T_FB_SUBJECT.SUBJECTID, objDetail.REPAYAPPLYDETAILID));
                    AutoList.Add(basedataForChild("T_FB_REPAYAPPLYDETAIL", "SUBJECTCODE", objDetail.T_FB_SUBJECT.SUBJECTCODE, objDetail.T_FB_SUBJECT.SUBJECTCODE, objDetail.REPAYAPPLYDETAILID));
                    AutoList.Add(basedataForChild("T_FB_REPAYAPPLYDETAIL", "SUBJECTNAME", objDetail.T_FB_SUBJECT.SUBJECTNAME, objDetail.T_FB_SUBJECT.SUBJECTNAME, objDetail.REPAYAPPLYDETAILID));
                }
                if (objDetail.T_FB_BORROWAPPLYDETAIL != null)
                {
                    AutoList.Add(basedataForChild("T_FB_REPAYAPPLYDETAIL", "BORROWAPPLYDETAILID", objDetail.T_FB_BORROWAPPLYDETAIL.BORROWAPPLYDETAILID, objDetail.T_FB_BORROWAPPLYDETAIL.BORROWAPPLYDETAILID, objDetail.REPAYAPPLYDETAILID));
                    //AutoList.Add(basedataForChild("T_FB_REPAYAPPLYDETAIL", "UNREPAYMONEY", objDetail.T_FB_BORROWAPPLYDETAIL.UNREPAYMONEY.ToString(), objDetail.T_FB_BORROWAPPLYDETAIL.UNREPAYMONEY.ToString(), objDetail.REPAYAPPLYDETAILID));
                    AutoList.Add(basedataForChild("T_FB_REPAYAPPLYDETAIL", "UNREPAYMONEY", (objDetail.T_FB_BORROWAPPLYDETAIL.UNREPAYMONEY - objDetail.REPAYMONEY).ToString(), (objDetail.T_FB_BORROWAPPLYDETAIL.UNREPAYMONEY - objDetail.REPAYMONEY).ToString(), objDetail.REPAYAPPLYDETAILID));
                }
                if (objDetail.T_FB_REPAYAPPLYMASTER != null)
                {
                    AutoList.Add(basedataForChild("T_FB_REPAYAPPLYDETAIL", "REPAYAPPLYMASTERID", objDetail.T_FB_REPAYAPPLYMASTER.REPAYAPPLYMASTERID, objDetail.T_FB_REPAYAPPLYMASTER.REPAYAPPLYMASTERID, objDetail.REPAYAPPLYDETAILID));
                }
                if (objDetail.CHARGETYPE != null)
                {
                    AutoList.Add(basedataForChild("T_FB_REPAYAPPLYDETAIL", "CHARGETYPE", objDetail.CHARGETYPE.ToString(), objDetail.CHARGETYPE.ToString() == "1" ? "个人预算费用" : "公共预算费用", objDetail.REPAYAPPLYDETAILID));
                }
                switch (objDetail.REPAYTYPE.ToString())
                {
                    case "1":
                        StrPayType = "普通借款";
                        break;
                    case "2":
                        StrPayType = "备用金借款";
                        break;
                    case "3":
                        StrPayType = "专项借款";
                        break;
                }
                if (objDetail.REPAYTYPE != null)
                {
                    AutoList.Add(basedataForChild("T_FB_REPAYAPPLYDETAIL", "REPAYTYPE", objDetail.REPAYTYPE.ToString(), StrPayType, objDetail.REPAYAPPLYDETAILID));
                }

            }
            string a = mx.TableToXml(Info, objR, StrSorce, AutoList);
            return a;

        }