Пример #1
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;
        }
Пример #2
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;
        }