Exemple #1
0
        public frmDefWB(long _PointID)
        {
            InitializeComponent();
            ClientItem _ClientItem = Basic.Framework.Common.JSONHelper.ParseJSONString <ClientItem>(Basic.Framework.Data.PlatRuntime.Items["_ClientItem"].ToString());
            string     strUserCode = _ClientItem != null ? _ClientItem.UserName : "";
            var        request     = new UserGetByCodeRequest()
            {
                Code = strUserCode
            };
            var response = userService.GetUserByCode(request);

            if (response.Data != null)
            {
                this.txtUserName.Text = response.Data.UserName;
                this.txtUserName.Tag  = response.Data.UserID;
            }

            PointDefineGetByPointIDRequest PointDefineRequest = new PointDefineGetByPointIDRequest();

            PointDefineRequest.PointID = _PointID.ToString();
            List <Jc_DefInfo> DefList = _PointDefineService.GetPointDefineCacheByPointID(PointDefineRequest).Data;
            Jc_DefInfo        dto     = null;

            if (DefList.Count > 0)
            {
                dto = DefList[0];
            }
            if (dto != null)
            {
                this.txtDefName.Text = dto.Point;
                this.txtDefName.Tag  = dto.PointID;
            }
        }
        /// <summary>根据测点编号查询测点
        /// </summary>
        /// <param name="pointCode"></param>
        /// <returns></returns>
        public static Jc_DefInfo QueryPointByPointID(string PointID)
        {
            PointDefineGetByPointIDRequest PointIDDefineRequest = new PointDefineGetByPointIDRequest();

            PointIDDefineRequest.PointID = PointID;
            var result = _PointDefineService.GetPointDefineCacheByPointID(PointIDDefineRequest);

            if (result.IsSuccess == true)
            {
                return(result.Data[0]);
            }
            else
            {
                throw new Exception(result.Message);
            }
        }
 public BasicResponse <List <Jc_DefInfo> > GetPointDefineCacheByPointID(PointDefineGetByPointIDRequest PointDefineRequest)
 {
     return(_PointDefineService.GetPointDefineCacheByPointID(PointDefineRequest));
 }