Esempio n. 1
0
        /// <summary>
        /// 根据设备类别获取设备的富士I类
        /// </summary>
        /// <param name="equipmentClass1">设备类别I</param>
        /// <param name="equipmentClass2">设备类别II</param>
        /// <returns>设备的富士I类</returns>
        public JsonResult GetFujiClass1ByEquipmentClass(string equipmentClass1, string equipmentClass2)
        {
            if (CheckSession(false) == false)
            {
                return(Json(ResultModelBase.CreateTimeoutModel(), JsonRequestBehavior.AllowGet));
            }
            if (CheckSessionID() == false)
            {
                return(Json(ResultModelBase.CreateLogoutModel(), JsonRequestBehavior.AllowGet));
            }
            ResultModel <FujiClass1Info> result = new ResultModel <FujiClass1Info>();

            try
            {
                FujiClass1Info info = this.fujiClassDao.GetFujiClass1ByEquipmentClass(equipmentClass1, equipmentClass2);

                if (info == null)
                {
                    info = this.fujiClassDao.GetFujiClass1ByID(-1);
                }
                result.Data = info;
            }
            catch (Exception ex)
            {
                NLog.LogManager.GetCurrentClassLogger().Error(ex, ex.Message);
                result.SetFailed(ResultCodes.SystemError, ControlManager.GetSettingInfo().ErrorMessage);
            }
            return(JsonResult(result));
        }
Esempio n. 2
0
        public int SaveFujiClass1(FujiClass1Info info, bool isUpdate)
        {
            if (info.ID == 0)
            {
                info.ID = this.fujiClassDao.AddFujiClass1(info);
                this.fujiClassDao.AddFujiClass1EqpType(info);
            }
            else
            {
                //引用富士I类
                if (!isUpdate)
                {
                    this.fujiClassDao.AddFujiClass1EqpType(info);
                }
                else
                {
                    this.fujiClassDao.UpdateFujiClass1(info);
                }
            }

            return(info.ID);
        }
Esempio n. 3
0
        public JsonResult CheckEquipmentClassExisted(FujiClass1Info info)
        {
            if (CheckSession(false) == false)
            {
                return(Json(ResultModelBase.CreateTimeoutModel(), JsonRequestBehavior.AllowGet));
            }
            if (CheckSessionID() == false)
            {
                return(Json(ResultModelBase.CreateLogoutModel(), JsonRequestBehavior.AllowGet));
            }
            ResultModel <bool> result = new ResultModel <bool>();

            try
            {
                result.Data = this.fujiClassDao.CheckEquipmentClassExisted(info);
            }
            catch (Exception ex)
            {
                NLog.LogManager.GetCurrentClassLogger().Error(ex, ex.Message);
                result.SetFailed(ResultCodes.SystemError, ControlManager.GetSettingInfo().ErrorMessage);
            }
            return(JsonResult(result));
        }