public T_FB_CHARGEAPPLYMASTER GetChargeApplyMasterByID(string strChargeApplyMasterId) { T_FB_CHARGEAPPLYMASTER entRd = new T_FB_CHARGEAPPLYMASTER(); using (ChargeApplyMasterBLL bllChargeApplyMaster = new ChargeApplyMasterBLL()) { entRd = bllChargeApplyMaster.GetChargeApplyMasterByID(strChargeApplyMasterId); return(entRd); } }
public bool UpdateChargeApplyDetail(string strChargeMasterID, List <T_FB_CHARGEAPPLYDETAIL> detailList) { bool bRes = false; try { if (string.IsNullOrWhiteSpace(strChargeMasterID)) { return(bRes); } ChargeApplyMasterBLL masterBLL = new ChargeApplyMasterBLL(); T_FB_CHARGEAPPLYMASTER entMaster = masterBLL.GetChargeApplyMasterByID(strChargeMasterID); bRes = DelChargeApplyDetail(strChargeMasterID); foreach (T_FB_CHARGEAPPLYDETAIL item in detailList) { if (item.EntityKey != null) { item.EntityKey = null; } item.CHARGEAPPLYDETAILID = System.Guid.NewGuid().ToString(); if (item.T_FB_CHARGEAPPLYMASTER == null) { item.T_FB_CHARGEAPPLYMASTER = entMaster; } item.T_FB_CHARGEAPPLYMASTER.EntityKey = new System.Data.EntityKey("TM_SaaS_OA_EFModelContext.T_FB_CHARGEAPPLYMASTER", "CHARGEAPPLYMASTERID", entMaster.CHARGEAPPLYMASTERID); 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") + "调用函数 UpdateChargeApplyDetail 出现异常,异常信息为:" + ex.ToString()); bRes = false; } return(bRes); }
public T_FB_CHARGEAPPLYMASTER GetChargeApplyMasterByID(string strChargeApplyMasterId) { T_FB_CHARGEAPPLYMASTER entRd = new T_FB_CHARGEAPPLYMASTER(); using (ChargeApplyMasterBLL bllChargeApplyMaster = new ChargeApplyMasterBLL()) { entRd = bllChargeApplyMaster.GetChargeApplyMasterByID(strChargeApplyMasterId); return entRd; } }
/// <summary> /// 根据扩展单据,生成其关联的费用报销单据(仅仅是保存,不冻结/扣除预算额度) /// </summary> /// <param name="entAdd"></param> private void SaveChargeRdByExtenOrder(string strFormType, T_FB_EXTENSIONALORDER entTemp) { //1.判定当前是否进行了月结 bool bIsChecked = false; IsCheckedAccount(ref bIsChecked); if (!bIsChecked) { throw new Exception("本月尚未结算,无法提交!"); } if (strFormType == Convert.ToInt32(FBAEnums.FormTypes.Resubmit).ToString()) { CancelOldChargeRdByExtenOrder(entTemp.EXTENSIONALORDERID); } ChargeApplyMasterBLL bllCharge = new ChargeApplyMasterBLL(); T_FB_CHARGEAPPLYMASTER entCharge = bllCharge.GetChargeApplyMasterByID(entTemp.INNERORDERID); if (entCharge == null) { entCharge = new T_FB_CHARGEAPPLYMASTER(); entCharge.CHARGEAPPLYMASTERID = entTemp.INNERORDERID; entCharge.CHARGEAPPLYMASTERCODE = "自动生成"; entCharge.BUDGETARYMONTH = System.DateTime.Now.Date; entCharge.PAYTYPE = 1; } entCharge.EDITSTATES = 1; entCharge.CHECKSTATES = entTemp.CHECKSTATES; entCharge.T_FB_EXTENSIONALORDER = entTemp; entCharge.BANKACCOUT = entTemp.BANKACCOUT; entCharge.BANK = entTemp.BANK; entCharge.RECEIVER = entTemp.RECEIVER; entCharge.PAYTARGET = entTemp.PAYTARGET; entCharge.TOTALMONEY = entTemp.TOTALMONEY.Value; entCharge.REMARK = entTemp.REMARK; entCharge.CREATECOMPANYID = entTemp.CREATECOMPANYID; entCharge.CREATEDEPARTMENTID = entTemp.CREATEDEPARTMENTID; entCharge.CREATEPOSTID = entTemp.CREATEPOSTID; entCharge.CREATEUSERID = entTemp.CREATEUSERID; entCharge.CREATEDATE = entTemp.CREATEDATE; entCharge.OWNERCOMPANYID = entTemp.OWNERCOMPANYID; entCharge.OWNERDEPARTMENTID = entTemp.OWNERDEPARTMENTID; entCharge.OWNERID = entTemp.OWNERID; entCharge.OWNERPOSTID = entTemp.OWNERPOSTID; entCharge.CREATECOMPANYNAME = entTemp.CREATECOMPANYNAME; entCharge.CREATEDEPARTMENTNAME = entTemp.CREATEDEPARTMENTNAME; entCharge.CREATEPOSTNAME = entTemp.CREATEPOSTNAME; entCharge.CREATEUSERNAME = entTemp.CREATEUSERNAME; entCharge.OWNERCOMPANYNAME = entTemp.OWNERCOMPANYNAME; entCharge.OWNERDEPARTMENTNAME = entTemp.OWNERDEPARTMENTNAME; entCharge.OWNERNAME = entTemp.OWNERNAME; entCharge.OWNERPOSTNAME = entTemp.OWNERPOSTNAME; entCharge.UPDATEUSERID = entTemp.UPDATEUSERID; entCharge.UPDATEDATE = entTemp.UPDATEDATE; }
/// <summary> /// 根据扩展单据,生成其关联的费用报销单据(仅仅是保存,不冻结/扣除预算额度) /// </summary> /// <param name="entAdd"></param> private void SaveChargeRdByExtenOrder(string strFormType, T_FB_EXTENSIONALORDER entTemp) { //1.判定当前是否进行了月结 bool bIsChecked = false; IsCheckedAccount(ref bIsChecked); if (!bIsChecked) { throw new Exception("本月尚未结算,无法提交!"); } if (strFormType == Convert.ToInt32(FBAEnums.FormTypes.Resubmit).ToString()) { CancelOldChargeRdByExtenOrder(entTemp.EXTENSIONALORDERID); } ChargeApplyMasterBLL bllCharge = new ChargeApplyMasterBLL(); T_FB_CHARGEAPPLYMASTER entCharge = bllCharge.GetChargeApplyMasterByID(entTemp.INNERORDERID); if (entCharge == null) { entCharge = new T_FB_CHARGEAPPLYMASTER(); entCharge.CHARGEAPPLYMASTERID = entTemp.INNERORDERID; entCharge.CHARGEAPPLYMASTERCODE = "自动生成"; entCharge.BUDGETARYMONTH = System.DateTime.Now.Date; entCharge.PAYTYPE = 1; } entCharge.EDITSTATES = 1; entCharge.CHECKSTATES = entTemp.CHECKSTATES; entCharge.T_FB_EXTENSIONALORDER = entTemp; entCharge.BANKACCOUT = entTemp.BANKACCOUT; entCharge.BANK = entTemp.BANK; entCharge.RECEIVER = entTemp.RECEIVER; entCharge.PAYTARGET = entTemp.PAYTARGET; entCharge.TOTALMONEY = entTemp.TOTALMONEY.Value; entCharge.REMARK = entTemp.REMARK; entCharge.CREATECOMPANYID = entTemp.CREATECOMPANYID; entCharge.CREATEDEPARTMENTID = entTemp.CREATEDEPARTMENTID; entCharge.CREATEPOSTID = entTemp.CREATEPOSTID; entCharge.CREATEUSERID = entTemp.CREATEUSERID; entCharge.CREATEDATE = entTemp.CREATEDATE; entCharge.OWNERCOMPANYID = entTemp.OWNERCOMPANYID; entCharge.OWNERDEPARTMENTID = entTemp.OWNERDEPARTMENTID; entCharge.OWNERID = entTemp.OWNERID; entCharge.OWNERPOSTID = entTemp.OWNERPOSTID; entCharge.CREATECOMPANYNAME = entTemp.CREATECOMPANYNAME; entCharge.CREATEDEPARTMENTNAME = entTemp.CREATEDEPARTMENTNAME; entCharge.CREATEPOSTNAME = entTemp.CREATEPOSTNAME; entCharge.CREATEUSERNAME = entTemp.CREATEUSERNAME; entCharge.OWNERCOMPANYNAME = entTemp.OWNERCOMPANYNAME; entCharge.OWNERDEPARTMENTNAME = entTemp.OWNERDEPARTMENTNAME; entCharge.OWNERNAME = entTemp.OWNERNAME; entCharge.OWNERPOSTNAME = entTemp.OWNERPOSTNAME; entCharge.UPDATEUSERID = entTemp.UPDATEUSERID; entCharge.UPDATEDATE = entTemp.UPDATEDATE; }