コード例 #1
0
        /// <summary>
        /// 根据单位编码获取火险等级
        /// </summary>
        /// <param name="sw">参见模型</param>
        /// <returns>火险等级</returns>
        public static string getLevelByOrgNo(YJ_DANGERCLASS_SW sw)
        {
            var DANGERCLASS = "";

            if (!string.IsNullOrEmpty(sw.BYORGNO))
            {
                DANGERCLASS = YJ_DANGERCLASSCls.getModel(new YJ_DANGERCLASS_SW {
                    BYORGNO = sw.BYORGNO
                }).DANGERCLASS;
                if (string.IsNullOrEmpty(DANGERCLASS))
                {
                    sw.BYORGNO  = sw.BYORGNO.Substring(0, 6) + "000000000";//如果乡镇没有,查市的
                    DANGERCLASS = YJ_DANGERCLASSCls.getModel(new YJ_DANGERCLASS_SW {
                        BYORGNO = sw.BYORGNO
                    }).DANGERCLASS;
                    if (string.IsNullOrEmpty(DANGERCLASS))
                    {
                        //BYORGNO = "532503000";//如果市没有,查州的
                        sw.BYORGNO  = ConfigCls.getProvincialCapital();// ConfigurationManager.AppSettings["ProvincialCapital"].ToString();//如果市没有,查州的
                        DANGERCLASS = YJ_DANGERCLASSCls.getModel(new YJ_DANGERCLASS_SW {
                            BYORGNO = sw.BYORGNO
                        }).DANGERCLASS;
                        if (string.IsNullOrEmpty(DANGERCLASS))
                        {
                            DANGERCLASS = "";
                            return(DANGERCLASS);
                        }
                    }
                }
            }

            return(DANGERCLASS);
        }