Ejemplo n.º 1
0
        /// <summary>
        /// 根据扩展单编号查询申请单编号。
        /// </summary>
        /// <param name="extensionalOrderID">扩展单编号。</param>
        /// <returns>返回申请单编号。</returns>
        public string GetTravelExpApplyMasterCode(string extensionalOrderID)
        {
            using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
            {
                if (string.IsNullOrWhiteSpace(extensionalOrderID))
                {
                    return string.Empty;
                }

                QueryExpression qe = QueryExpression.Equal("T_FB_EXTENSIONALORDER.EXTENSIONALORDERID", extensionalOrderID);
                qe.QueryType = typeof(T_FB_TRAVELEXPAPPLYMASTER).Name;

                FBEntity entFBEntity = fbCommonBLL.GetFBEntity(qe);
                if (entFBEntity == null)
                {
                    return string.Empty;
                }

                if (entFBEntity.Entity == null)
                {
                    return string.Empty;
                }

                return ((T_FB_TRAVELEXPAPPLYMASTER)entFBEntity.Entity).TRAVELEXPAPPLYMASTERID;
            }
        }
Ejemplo n.º 2
0
        public QueryResult Query(QueryExpression qe)
        {
            try
            {
                using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
                {
                    return fbCommonBLL.QueryData(qe);
                }
            }
            catch (Exception ex)
            {
                QueryExpression qeTemp = qe;
                string parameter = "";
                while (qeTemp != null)
                {
                    parameter += string.Format("Name:{0} ; Value:{1}  ; QueryType:{2}", qeTemp.PropertyName, qeTemp.PropertyValue, qeTemp.QueryType) + "\r\n";
                    qeTemp = qeTemp.RelatedExpression;
                }

                Tracer.Debug(ex.ToString() + "\r\n参数: " + parameter);
                //  throw ex;
                QueryResult qr = new QueryResult();
                qr.Exception = ex.ToString();
                qr.Result = new List<FBEntity>();
                qr.Pager = qe.Pager;

                return qr;
            }
        }
Ejemplo n.º 3
0
 public FBEntity GetFBEntity(QueryExpression qp)
 {
     try
     {
         using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
         {
             return fbCommonBLL.GetFBEntity(qp);
         }
     }
     catch (Exception ex)
     {
         Tracer.Debug(ex.ToString());
         throw ex;
     }
     
 }
Ejemplo n.º 4
0
        public List<EntityObject> GetTravelExpApplyMaster(string travelExpApplyMasterID)
        {
            using (FBCommonBLL bll = new FBCommonBLL())
            {
                List<EntityObject> list = new List<EntityObject>();
                QueryExpression qe = QueryExpression.Equal("T_FB_EXTENSIONALORDER.TRAVELEXPAPPLYMASTERID", travelExpApplyMasterID);
                qe.QueryType = typeof(T_FB_TRAVELEXPAPPLYMASTER).Name;
                FBEntity entitys = bll.GetFBEntity(qe);

                if (entitys == null || entitys.Entity == null)
                {
                    return null;
                }
                IEnumerable listResult = entitys as IEnumerable;
                foreach (var entity in listResult)
                {
                    list.Add(entity as EntityObject);
                }

                return list;
            }
        }
Ejemplo n.º 5
0
        public List<FBEntity> QueryFBEntities(QueryExpression qe)
        {
            try
            {
                using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
                {
                    return fbCommonBLL.QueryFBEntities(qe);
                }
            }
            catch (Exception ex)
            {
                QueryExpression qeTemp = qe;
                string parameter = "";
                while (qeTemp != null)
                {
                    parameter += string.Format("Name:{0} ; Value:{1}  ; QueryType:{2}", qeTemp.PropertyName, qeTemp.PropertyValue, qeTemp.QueryType) + "\r\n";
                    qeTemp = qeTemp.RelatedExpression;
                }

                Tracer.Debug(ex.ToString() + "\r\n参数: " + parameter);
                throw ex;
            }
        }
Ejemplo n.º 6
0
        public int UpdateCheckState(string strModelCode, string orderID, string strCheckStates, ref string strMsg)
        {
            int i = -1;
            try
            {
                SystemBLL.Debug("UpdateCheckState方法已被调用,参数:strModelCode: " + strModelCode + ", orderID: " + orderID + ", strCheckStates: " + strCheckStates);

                // begin 用于出差报销、事项审批的手机提交
                if (strModelCode == "Travel")
                {
                    var tempResult = UpdateExtensionOrder(strModelCode, orderID, strCheckStates, ref strMsg);
                    return (tempResult == null) ? -1 : 1;

                }
                // end 
                FBCommonService fbCommonService = new FBCommonService();
                List<EntityInfo> EntityInfoList = fbCommonService.GetEntityInfoList();
                if (EntityInfoList == null)
                {
                    strMsg = "预算服务初始化异常,请重试。";
                    return -1;
                }

                if (EntityInfoList.Count() == 0)
                {
                    strMsg = "预算服务初始化异常,请重试。";
                    return -1;
                }

                string strTypeName = "";
                string strKeyName = "";
                CheckStates cs = CheckStates.UnSubmit;
                switch (strCheckStates)
                {
                    case "1":
                        cs = CheckStates.Approving;
                        break;
                    case "2":
                        cs = CheckStates.Approved;
                        break;
                    case "3":
                        cs = CheckStates.UnApproved;
                        break;
                    default:
                        break;
                }

                var entityInfo = EntityInfoList.Where(t => t.Type == strModelCode).FirstOrDefault();
                strTypeName = entityInfo.Type;
                strKeyName = entityInfo.KeyName;
                /////add 2012.12.12
                /////传入报销月份为时间去和当前时间判断,如果不在同一年
                /////说明该报销单是跨年的,则不能进行审核操作,即当年的报销单只能在当年进行报销
                //if (dNewCheckStates == FBAEnums.CheckStates.Approved || dNewCheckStates == FBAEnums.CheckStates.Approving)
                //{
                //    if (IsOverYear(entity.BUDGETARYMONTH))
                //    {
                //        strMsg = "报销单跨年后只能终审不通过(财务规定)";
                //        Tracer.Debug(strMsg);
                //        return;
                //    }
                //}
                using (FBCommonBLL bllCommon = new FBCommonBLL())
                {
                    bllCommon.BeginTransaction();
                    SystemBLL.Debug("BeginTransaction "+ strModelCode + " 的单据[" + orderID + "]"); 
                    try
                    {
                        QueryExpression qe = QueryExpression.Equal(strKeyName, orderID);
                        qe.QueryType = strTypeName;

                        var data = qe.Query(bllCommon);
                        var order = data.FirstOrDefault();
                        if (order == null)
                        {
                            strMsg = "没有可操作的数据";
                            return -1;
                        }

                        bllCommon.AuditFBEntityWithoutFlow(order, cs, ref strMsg);
                        i = 1;
                        if (string.IsNullOrEmpty(strMsg))
                        {
                            bllCommon.CommitTransaction();
                            SystemBLL.Debug("CommitTransaction " + strModelCode + " 的单据[" + orderID + "]");
                        }
                        else
                        {
                            bllCommon.RollbackTransaction();
                            SystemBLL.Debug("RollbackTransaction 审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg);
                        
                        }
                     
                    }
                    catch (Exception ex)
                    {
                        bllCommon.RollbackTransaction();
                        SystemBLL.Debug("RollbackTransaction 审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg);
                        throw ex;
                    }
                }
            }
            catch (Exception ex)
            {
                strMsg = "单据审核异常,请联系管理员";
                throw ex;
            }
            
            // 把消息通过异常机制返回
            if (!string.IsNullOrWhiteSpace(strMsg))
            {
                
                SystemBLL.Debug("审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg);
                throw new Exception(strMsg);
            }

            return i;
        }
Ejemplo n.º 7
0
 public List<FBEntity> GetFBEntities(QueryExpression qp)
 {
     using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
     {
         return fbCommonBLL.GetFBEntities(qp);
     }
 }
Ejemplo n.º 8
0
 public List<FBEntity> QueryFBEntities(QueryExpression queryExpression)
 {
     using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
     {
         List<string> listOrder = new List<string>();
         listOrder.Add(typeof(T_FB_EXTENSIONORDERDETAIL).Name);
         listOrder.Add(typeof(T_FB_EXTENSIONALORDER).Name);
         listOrder.Add(typeof(T_FB_EXTENSIONALTYPE).Name);
         if (!listOrder.Contains(queryExpression.QueryType))
         {
             return new List<FBEntity>();
         }
         queryExpression.IsUnCheckRight = true;
         List<FBEntity> listDetail = fbCommonBLL.QueryFBEntities(queryExpression);
         return listDetail;
     }
 }
Ejemplo n.º 9
0
        public SaveResult Save(SaveEntity saveEntity)
        {
            using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
            {
                SaveResult result = new SaveResult();
                try
                {
                    result = fbCommonBLL.Save(saveEntity);
                }
                catch (Exception ex)
                {
                    result.Successful = false;
                    result.Exception = ex.Message;
                    Tracer.Debug(ex.ToString());

                }
                return result;
            }
        }
Ejemplo n.º 10
0
 public SaveResult Save(FBEntity fbEntity)
 {
     SaveResult result = new SaveResult();
     try
     {
         using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
         {
             result = fbCommonBLL.FBCommSaveEntity(fbEntity);
         }
     }
     catch (Exception ex)
     {
         result.Successful = false;
         result.Exception = ex.Message;
     }
     return result;
 }
Ejemplo n.º 11
0
        /// <summary>
        /// 根据实体名,实体的主键ID及审核状态,更新指定实体的记录
        /// </summary>
        /// <param name="strModelCode">实体名</param>
        /// <param name="orderID">实体的主键ID</param>
        /// <param name="strCheckStates">审核状态</param>
        public int UpdateCheckState(string strModelCode, string orderID, string strCheckStates, ref string strMsg)
        {
            int i = -1;

            try
            {
                SystemBLL.Debug("UpdateCheckState方法已被调用,参数:strModelCode: " + strModelCode + ", orderID: " + orderID + ", strCheckStates: " + strCheckStates);

                // begin 用于出差报销、事项审批的手机提交
                //if (strModelCode == "Travel")
                //{
                //    var tempResult = UpdateExtensionOrder(strModelCode, orderID, strCheckStates, ref strMsg);
                //    return (tempResult == null) ? -1 : 1;

                //}
                List <EntityInfo> EntityInfoList = FBCommonBLL.FBCommonEntityList;
                if (EntityInfoList == null)
                {
                    strMsg = "预算服务初始化异常,请重试。";
                    return(-1);
                }

                if (EntityInfoList.Count() == 0)
                {
                    strMsg = "预算服务初始化异常,请重试。";
                    return(-1);
                }

                string      strTypeName = "";
                string      strKeyName  = "";
                CheckStates cs          = CheckStates.UnSubmit;
                switch (strCheckStates)
                {
                case "1":
                    cs = CheckStates.Approving;
                    break;

                case "2":
                    cs = CheckStates.Approved;
                    break;

                case "3":
                    cs = CheckStates.UnApproved;
                    break;

                default:
                    break;
                }

                var entityInfo = EntityInfoList.Where(t => t.Type == strModelCode).FirstOrDefault();
                strTypeName = entityInfo.Type;
                strKeyName  = entityInfo.KeyName;
                /////add 2012.12.12
                /////传入报销月份为时间去和当前时间判断,如果不在同一年
                /////说明该报销单是跨年的,则不能进行审核操作,即当年的报销单只能在当年进行报销
                //if (dNewCheckStates == FBAEnums.CheckStates.Approved || dNewCheckStates == FBAEnums.CheckStates.Approving)
                //{
                //    if (IsOverYear(entity.BUDGETARYMONTH))
                //    {
                //        strMsg = "报销单跨年后只能终审不通过(财务规定)";
                //        Tracer.Debug(strMsg);
                //        return;
                //    }
                //}
                using (FBCommonBLL bllCommon = new FBCommonBLL())
                {
                    bllCommon.BeginTransaction();
                    SystemBLL.Debug("BeginTransaction " + strModelCode + " 的单据[" + orderID + "]");
                    try
                    {
                        QueryExpression qe = QueryExpression.Equal(strKeyName, orderID);
                        qe.QueryType = strTypeName;

                        var data  = qe.Query(bllCommon);
                        var order = data.FirstOrDefault();
                        if (order == null)
                        {
                            strMsg = "没有可操作的数据";
                            return(-1);
                        }

                        bllCommon.AuditFBEntityWithoutFlow(order, cs, ref strMsg);
                        i = 1;
                        if (string.IsNullOrEmpty(strMsg))
                        {
                            bllCommon.CommitTransaction();
                            SystemBLL.Debug("CommitTransaction " + strModelCode + " 的单据[" + orderID + "]");
                        }
                        else
                        {
                            bllCommon.RollbackTransaction();
                            SystemBLL.Debug("RollbackTransaction 审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg);
                        }
                    }
                    catch (Exception ex)
                    {
                        bllCommon.RollbackTransaction();
                        SystemBLL.Debug("RollbackTransaction 审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg);
                        throw ex;
                    }
                }
            }
            catch (Exception ex)
            {
                strMsg = "单据审核异常,请联系管理员";
                throw ex;
            }

            // 把消息通过异常机制返回
            if (!string.IsNullOrWhiteSpace(strMsg))
            {
                SystemBLL.Debug("审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg);
                throw new Exception(strMsg);
            }

            return(i);
        }
Ejemplo n.º 12
0
        public int UpdateCheckState(string strModelCode, string orderID, string strCheckStates, ref string strMsg)
        {
            int i = -1;
            try
            {
                
                using(FBCommonBLL bll=new FBCommonBLL())
                {
                   i= bll.UpdateCheckState(strModelCode, orderID, strCheckStates, ref strMsg);
                }
            }
            catch (Exception ex)
            {
                strMsg = "单据审核异常,请联系管理员";
                throw ex;
            }
            
            // 把消息通过异常机制返回
            if (!string.IsNullOrWhiteSpace(strMsg))
            {
                
                SystemBLL.Debug("审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg);
                throw new Exception(strMsg);
            }

            return i;
        }
Ejemplo n.º 13
0
 public AuditResult AuditFBEntity(FBEntity fbEntity, SMT.FB.BLL.CheckStates checkStates)
 {
     try
     {
         using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
         {
             return fbCommonBLL.AuditFBEntity(fbEntity, checkStates);
         }
     }
     catch (Exception ex)
     {
         Tracer.Debug(ex.ToString());
         throw ex;
     }
     
 }
Ejemplo n.º 14
0
 public bool SaveList(List<FBEntity> fbEntityList,CurrentUserPost user)
 {
     try
     {
         using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
         {
             fbCommonBLL.user = user;
             return fbCommonBLL.FBcommonBllSaveList(fbEntityList);
         }
     }
     catch (Exception ex)
     {
         Tracer.Debug(ex.ToString());
         throw ex;
     }
     
 }
Ejemplo n.º 15
0
 public SaveResult Save(FBEntity fbEntity,CurrentUserPost user)
 {
     SaveResult result = new SaveResult();
     try
     {
         using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
         {
             fbCommonBLL.user = user;
             fbCommonBLL.BeginTransaction();
             result = fbCommonBLL.FBCommSaveEntity(fbEntity);
             if (result.Successful)
             {
                 fbCommonBLL.CommitTransaction();
             }
         }
     }
     catch (Exception ex)
     {
         result.Successful = false;
         result.Exception = ex.Message;
         Tracer.Debug(ex.ToString());
     }
     return result;
 }
Ejemplo n.º 16
0
        public T_FB_EXTENSIONALORDER UpdateExtensionOrder(string strModelCode, string orderID, string strCheckStates, ref string strMsg)
        {
            using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
            {
                try
                {
                    SystemBLL.Debug("UpdateExtensionOrder方法已被调用,参数:strModelCode: " + strModelCode + ", orderID: " + orderID + ", strCheckStates: " + strCheckStates);

                    QueryExpression queryExpression = QueryExpression.Equal("ORDERID", orderID);

                    if (strModelCode == "Travel")
                    {
                        QueryExpression tempQE = QueryExpression.Equal("TravelSubject", "1");

                        tempQE.RelatedExpression = QueryExpression.Equal("EXTENSIONALTYPECODE", "CCPX");
                        queryExpression.RelatedExpression = tempQE;
                    }
                    //查出保存的外部单据
                    queryExpression.QueryType = typeof(T_FB_EXTENSIONALORDER).Name;
                    queryExpression.IsNoTracking = true;
                    List<FBEntity> listDetail = fbCommonBLL.QueryFBEntities(queryExpression);
                    //如果存在外部单据
                    if (listDetail.Count > 0)
                    {
                        var saveFBEntity = listDetail[0];
                        saveFBEntity.Entity.SetValue("CHECKSTATES", Decimal.Parse(strCheckStates));
                        saveFBEntity.FBEntityState = FBEntityState.Modified;
                        //var temp = fbCommonBLL.FBCommSaveEntity(listDetail[0]);
                        SaveResult temp = new SaveResult();
                        try
                        {
                            temp.FBEntity = fbCommonBLL.SaveT_FB_EXTENSIONALORDER(listDetail[0]);
                            temp.Successful = true;
                        }
                        catch(Exception ex)
                        {
                            temp.Exception = ex.Message;
                            temp.Successful = false;
                        }
                         
                        if (temp.Successful)
                        {
                            return temp.FBEntity.Entity as T_FB_EXTENSIONALORDER;
                        }
                        else
                        {
                            strMsg = temp.Exception;
                        }
                    }
                    else
                    {
                        strMsg = "没有可操作的数据";
                    }
                }
                catch (Exception ex)
                {
                    strMsg = ex.Message;
                    if (!(ex is FBBLLException))
                    {
                        // strMsg = "单据审核异常,请联系管理员";
                        Tracer.Debug("审核" + strModelCode + "的单据[" + orderID + "]出现异常,错误消息为:" + ex.ToString());
                    }
                }
                return null;
            }
        }
Ejemplo n.º 17
0
        public bool HRPersonPostChanged(T_HR_EMPLOYEEPOSTCHANGE personChange, ref string message)
        {
            try
            {
                using (FBCommonBLL bll = new FBCommonBLL())
                {
                    var setting = SystemBLL.GetSetting(null);

                    var qePostID = QueryExpression.Equal(FieldName.OwnerPostID, personChange.FROMPOSTID);
                    var qeOwnerID = QueryExpression.Equal(FieldName.OwnerID, personChange.T_HR_EMPLOYEE.EMPLOYEEID);
                    var qeSubjectID = QueryExpression.Equal("T_FB_SUBJECT.SUBJECTID", setting.MONEYASSIGNSUBJECTID);
                    qePostID.RelatedExpression = qeOwnerID;
                    qeOwnerID.RelatedExpression = qeSubjectID;


                    var entity = bll.GetEntity<T_FB_BUDGETACCOUNT>(qePostID);

                    if (entity != null)
                    {
                        entity.OWNERCOMPANYID = personChange.TOCOMPANYID;
                        entity.OWNERDEPARTMENTID = personChange.TODEPARTMENTID;
                        entity.OWNERPOSTID = personChange.TOPOSTID;
                        entity.OWNERID = personChange.T_HR_EMPLOYEE.EMPLOYEEID;

                        bll.BassBllSave(entity, FBEntityState.Modified);
                    }

                    return true;
                }
            }
            catch (Exception ex)
            {
                message = "修改异动后的预算活动经费数据异常!";
                Tracer.Debug(message + " 异常信息: " + ex.ToString());
                return false;
            }


            
        }
Ejemplo n.º 18
0
        private List<DebtInfo> GetDebtInfo(QueryExpression qe)
        {
            using (FBCommonBLL bll = new FBCommonBLL())
            {
                List<DebtInfo> result = new List<DebtInfo>();
                qe.Include = new string[] { typeof(T_FB_BORROWAPPLYDETAIL).Name };
                qe.OrderBy = new string[] { "PLANREPAYDATE" };

                List<T_FB_BORROWAPPLYMASTER> list = bll.GetEntities<T_FB_BORROWAPPLYMASTER>(qe);

                list = list.OrderBy(item => item.PLANREPAYDATE).ToList();
                result = list.CreateList(item =>
                {
                    DebtInfo debtInfo = new DebtInfo();
                    decimal? deblt = item.T_FB_BORROWAPPLYDETAIL.Sum(detail =>
                    {
                        return detail.UNREPAYMONEY;
                    });
                    debtInfo.Debt = deblt == null ? 0 : deblt.Value;
                    debtInfo.EmployeeID = item.OWNERID;
                    debtInfo.OrderType = "T_FB_BORROWAPPLYMASTER";
                    debtInfo.OrderCode = item.BORROWAPPLYMASTERCODE;
                    return debtInfo;
                });
                return result;
            }
        }
Ejemplo n.º 19
0
        public List<string> RemoveExtensionOrder(List<string> orderIDs)
        {
            using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
            {
                List<string> listResult = new List<string>();
                fbCommonBLL.BeginTransaction();
                QueryExpression qe = new QueryExpression();
                qe.Operation = QueryExpression.Operations.Equal;
                qe.PropertyName = "ORDERID";

                orderIDs.ForEach(item =>
                {
                    qe.PropertyValue = item;
                    List<T_FB_EXTENSIONALORDER> list = fbCommonBLL.GetEntities<T_FB_EXTENSIONALORDER>(qe);
                    list.ForEach(entity =>
                    {
                        // 只能删除未提交的单据
                        if (((int)entity.CHECKSTATES) != (int)CheckStates.UnSubmit)
                        {
                            listResult.Add(item);
                        }
                        else
                        {
                            fbCommonBLL.Remove(entity);
                        }
                    });
                });
                return listResult;
            }
        }
Ejemplo n.º 20
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="SysType">系统类型</param>
        /// <param name="EntityType">实体类型</param>
        /// <param name="EntityKey">实体主键名</param>
        /// <param name="EntityId">主键ID</param>
        /// <param name="CheckState">审核状态</param>
        /// <returns></returns>
        public static bool InnerUpdateFormCheckState(string SysType, string EntityType, string EntityKey, string EntityId, SMT.HRM.BLL.Common.CheckStates CheckState, ref string message, string strXmlParams)
        {
            bool IsResult = false;
            try
            {
                Tracer.Debug("系统名称:" + SysType);
                Tracer.Debug("流程修改审核状态UpdateFormCheckState" + "实体名: " + EntityType);
                Tracer.Debug("表单ID名:" + EntityKey + "表单值:" + EntityId);
                Tracer.Debug("审核状态:" + ((int)CheckState).ToString());
                int i = 0;
                if (SysType == "HR")
                {
                    i = SMT.HRM.BLL.Utility.UpdateCheckState(EntityType, EntityKey, EntityId, ((int)CheckState).ToString());
                    if (i > 0)
                    {
                        IsResult = true;
                    }
                }
                if (SysType == "OA")
                {
                    if (EntityType.ToUpper() == "T_OA_GIFTAPPLYMASTER")
                    {
                        //GSCommonWS.GSCommonServicesClient gsClient = new GSCommonWS.GSCommonServicesClient();
                        //var iresult = gsClient.UpdateCheckState(EntityType, EntityId, ((int)CheckState).ToString(), ref message);
                        //if (iresult > 0)
                        //{
                        //    IsResult = true;
                        //}
                    }
                    else
                    {
                        CommBll<T_OA_AGENTSET> Combll = new CommBll<T_OA_AGENTSET>();
                        i = Combll.UpdateCheckState(EntityType, EntityKey, EntityId, ((int)CheckState).ToString());
                        if (i > 0)
                        {
                            IsResult = true;
                        }
                    }
                }
                if (SysType == "FB")
                {
                    //日常管理的状态改动
                    if (EntityType == "T_FB_BORROWAPPLYMASTER" || EntityType == "T_FB_CHARGEAPPLYMASTER" || EntityType == "T_FB_REPAYAPPLYMASTER")
                    {
                        SMT.FBAnalysis.BLL.CommBll<T_FB_BORROWAPPLYMASTER> Combll = new SMT.FBAnalysis.BLL.CommBll<T_FB_BORROWAPPLYMASTER>();
                        i = Combll.UpdateCheckState(EntityType, EntityKey, EntityId, ((int)CheckState).ToString());
                        if (i > 0)
                        {
                            IsResult = true;
                        }
                    }
                    else
                    {
                        string strMsg = string.Empty;
                        using (FBCommonBLL bll = new FBCommonBLL())
                        {
                            i = bll.UpdateCheckState(EntityType, EntityId, ((int)CheckState).ToString(), ref strMsg);
                        }
                        if (i > 0)
                        {
                            IsResult = true;
                        }
                        else
                        {
                            Tracer.Debug(strMsg);
                        }

                    }
                }
                if (SysType == "RM")
                {
                    //OrgClient = new OrganizationWS.OrganizationServiceClient();
                    Tracer.Debug("调用了招聘系统中的:" + EntityType);
                    //RMServicesClient rmClient = new RMServicesClient();
                    //int i = rmClient.UpdateCheckState(EntityType, EntityKey, EntityId, ((int)CheckState), strXmlParams);
                    //if (i > 0)
                    //{
                    //    IsResult = true;
                    //}
                }

                if (SysType == "WP")
                {
                    //WPServicesWS.WPServicesClient wpClient = new WPServicesClient();
                    //Tracer.Debug("调用了工作计划中的:EntityType:" + EntityType + " EntityKey:" + EntityKey + "\r\n" + " EntityId:" + EntityId + " CheckState:" + CheckState + " URL:" + wpClient.Endpoint.Address);
                    //Tracer.Debug("(int)CheckState):" + ((int)CheckState).ToString());
                    //int i = wpClient.UpdateCheckState(EntityType, EntityKey, EntityId, ((int)CheckState), strXmlParams, ref message);
                    //Tracer.Debug("调用工作计划返回结果" + i.ToString() + "\r\n" + message);
                    //if (i > 0)
                    //{
                    //    IsResult = true;
                    //}
                }
                if (SysType == "TM")
                {
                    //OrgClient = new OrganizationWS.OrganizationServiceClient();

                    //TMServicesWS.TMServicesClient tmClient = new TMServicesClient();
                    //Tracer.Debug("调用了培训系统中的:EntityType:" + EntityType + " EntityKey:" + EntityKey + "\r\n" + " EntityId:" + EntityId + " CheckState:" + CheckState + " URL:" + tmClient.Endpoint.Address);

                    //int i = tmClient.UpdateCheckState(EntityType, EntityKey, EntityId, ((int)CheckState), strXmlParams);
                    //Tracer.Debug("调用培训系统返回结果" + i.ToString());
                    //if (i > 0)
                    //{
                    //    IsResult = true;
                    //}
                }
                //考试系统
                if (SysType == "EM")
                {
                    //EMServiceWS.EMServicesClient emClient = new EMServiceWS.EMServicesClient();
                    //Tracer.Debug("调用了考试系统中的:EntityType:" + EntityType + " EntityKey:" + EntityKey + "\r\n" + " EntityId:" + EntityId + " CheckState:" + CheckState + " URL:" + emClient.Endpoint.Address + " strXmlParams:" + strXmlParams);

                    //int i = emClient.UpdateCheckState(EntityType, EntityKey, EntityId, ((int)CheckState), strXmlParams);
                    //Tracer.Debug("调用考试系统返回结果" + i.ToString());
                    //if (i > 0)
                    //{
                    //    IsResult = true;
                    //}
                }
                if (SysType == "VM")
                {
                    //VMServiceWS.VMServicesClient vmClient = new VMServiceWS.VMServicesClient();
                    //Tracer.Debug("调用了车辆系统中的:EntityType:" + EntityType + " EntityKey:" + EntityKey + "\r\n" + " EntityId:" + EntityId + " CheckState:" + CheckState + " URL:" + vmClient.Endpoint.Address + " strXmlParams:" + strXmlParams);

                    //int i = vmClient.UpdateCheckState(EntityType, EntityKey, EntityId, ((int)CheckState), strXmlParams);
                    //Tracer.Debug("调用车辆系统返回结果" + i.ToString());
                    //if (i > 0)
                    //{
                    //    IsResult = true;
                    //}
                }
                if (SysType == "TK")
                {
                    //TKServicesWS.TKServicesClient tkClient = new TKServicesWS.TKServicesClient();
                    //Tracer.Debug("调用了任务系统中的:EntityType:" + EntityType + " EntityKey:" + EntityKey + "\r\n" + " EntityId:" + EntityId + " CheckState:" + CheckState + " URL:" + tkClient.Endpoint.Address + " strXmlParams:" + strXmlParams);

                    //int i = tkClient.UpdateCheckState(EntityType, EntityKey, EntityId, ((int)CheckState), strXmlParams);
                    //Tracer.Debug("调用任务系统返回结果" + i.ToString());
                    //if (i > 0)
                    //{
                    //    IsResult = true;
                    //}
                }else
                {
                    //直接更新单据审核状态
                    string sql = "update " + EntityType + " set checkstate='" + ((int)CheckState).ToString() + "'"
                        + " where " + EntityKey + " ='" + EntityId + "'";
                    i=dao.ExecuteNonQuery(sql);
                    if (i > 0)
                    {
                        IsResult = true;
                    }
                }

                SMT.Foundation.Log.Tracer.Debug("WF流程UpdateCheckState成功: strEntityName:" + EntityType
                + " EntityKeyName:" + EntityKey + " EntityKeyValue:" + EntityId
                + " CheckState:" + CheckState + " 受影响的记录数:" + i.ToString());
            }
            catch (Exception  bex)
            {
                Tracer.Debug("手机版修改审核状态UpdateFormCheckState" + System.DateTime.Now.ToString() + " " + bex.ToString());
                throw bex;
            }
            return IsResult;
        }