Esempio n. 1
0
        /// <summary>
        /// 判断新增设备 打开台账编辑页面
        /// </summary>
        public static string IsNewEquipmentAndURL(ObjectId objectId)
        {
            var  urlstr = string.Empty;
            long id = 0, fid = 0, fno = 0;

            try
            {
                var selectedEntity = PublicMethod.Instance.GetObject(objectId, OpenMode.ForRead);
                if (selectedEntity is DBText)
                {
                    PublicMethod.Instance.ShowMessage("你选择的是设备标注,请重新选择!");
                    return(null);
                }
                if (DBEntityFinder.Instance.GetG3EIds(selectedEntity.ObjectId, ref id, ref fid, ref fno))
                {
                    var ptVlaue = PublicMethod.Instance.GetDBSymbolFinder(objectId) as ElectronSymbol;
                    var com     = CYZCommonFunc.GetModelEntity(fid) as Common_n;
                    if (ptVlaue == null || com == null)
                    {
                        return(string.Empty);
                    }
                    //获取gis工单ID
                    var ltt_id = ptVlaue.GetValue("LTT_ID").ToString();

                    var sbmc = string.Empty;
                    if (!string.IsNullOrEmpty(com.SBMC))
                    {
                        sbmc = BitConverter.ToString(Encoding.UTF8.GetBytes(com.SBMC)).Replace("-", "<M>");
                    }
                    //获取FID 新增设备需加a
                    var g3efid = ptVlaue.EntityState == EntityState.Insert ? string.Format("a{0}", fid) : fid.ToString();
                    //编辑设备台帐信息默认为'Y'
                    urlstr = string.Format(
                        "http://localhost:9090/emmis/equipGisMappingTemp/getInstallEquipments.gis?" +
                        "g3e_fid={0}&" +
                        "jobId={1}&" +
                        "g3e_fno={2}&editAble=Y&" +
                        "funcplaceName={3}&jgdh=009",
                        g3efid, ltt_id, fno, sbmc);
                }
            }
            catch (System.Exception ex)
            {
                LogManager.Instance.Error(ex);
            }
            return(urlstr);
        }