Exemplo n.º 1
0
        private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            try
            {
                int     rowhandle = gridView1.FocusedRowHandle;
                DataRow dr        = gridView1.GetDataRow(rowhandle);
                PointDefineGetByPointRequest PointDefineRequest = new PointDefineGetByPointRequest();
                PointDefineRequest.Point = dr["Point"].ToString();
                Jc_DefInfo def = pointDefineService.GetPointDefineCacheByPoint(PointDefineRequest).Data;
                def.Z2  = def.DeviceInfoItem.UpAarmValue;
                def.Z3  = def.DeviceInfoItem.UpDdValue;
                def.Z4  = def.DeviceInfoItem.UpHfValue;
                def.Z6  = def.DeviceInfoItem.DownAarmValue;
                def.Z7  = def.DeviceInfoItem.DownDdValue;
                def.Z8  = def.DeviceInfoItem.DownHfValue;
                def.Bz8 = def.DeviceInfoItem.SeniorGradeAlarmValue1 + "," + def.DeviceInfoItem.SeniorGradeAlarmValue2
                          + "," + def.DeviceInfoItem.SeniorGradeAlarmValue3 + "," + def.DeviceInfoItem.SeniorGradeAlarmValue4;
                def.Bz9 = def.DeviceInfoItem.SeniorGradeTimeValue1 + "," + def.DeviceInfoItem.SeniorGradeTimeValue2
                          + "," + def.DeviceInfoItem.SeniorGradeTimeValue3 + "," + def.DeviceInfoItem.SeniorGradeTimeValue4;
                PointDefineUpdateRequest PointDefineUpdateRequest = new PointDefineUpdateRequest();
                PointDefineUpdateRequest.PointDefineInfo = def;
                pointDefineService.UpdatePointDefine(PointDefineUpdateRequest); //修改测点的基础属性

                _ConfigService.SaveInspection();                                //保存巡检
            }
            catch (Exception ex)
            {
                Basic.Framework.Logging.LogHelper.Error(ex);
            }
        }
        /// <summary>
        /// 更新def
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public static bool UpdateDEFCache(Jc_DefInfo item)
        {
            PointDefineUpdateRequest PointDefineRequest = new PointDefineUpdateRequest();

            PointDefineRequest.PointDefineInfo = item;
            var result = _PointDefineService.UpdatePointDefine(PointDefineRequest);

            if (result.IsSuccess == true)
            {
                return(true);
            }
            else
            {
                throw new Exception(result.Message);
            }
        }
 public BasicResponse UpdatePointDefine(PointDefineUpdateRequest PointDefineRequest)
 {
     return(_PointDefineService.UpdatePointDefine(PointDefineRequest));
 }