Ejemplo n.º 1
0
 /// <summary>
 /// KNXControlBase 转 ControlBaseNode
 /// </summary>
 /// <param name="knx"></param>
 public ControlBaseNode(KNXControlBase knx, BackgroundWorker worker)
     : base(knx, worker)
 {
     this.HasTip    = (EBool)Enum.ToObject(typeof(EBool), knx.HasTip);
     this.Tip       = knx.Tip;
     this.Clickable = (EBool)Enum.ToObject(typeof(EBool), knx.Clickable);
 }
Ejemplo n.º 2
0
        public RoomNode(KNXRoom knx, BackgroundWorker worker)
            : base(knx, worker)
        {
            Name = ImageKey = SelectedImageKey = MyConst.View.KnxRoomType;
            SetText(this.Title);

            if (ImportedHelper.IsLessThan2_0_3())
            {
                if (!string.IsNullOrEmpty(knx.Symbol))
                {
                    this.Symbol = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, knx.Symbol));
                    //this.Symbol = ImageHelper.GetDiskImage(Path.Combine(this.ImagePath, knx.Symbol));
                }
            }
            else if (ImportedHelper.IsLessThan2_5_6())
            {
                this.Symbol = ProjResManager.CopyImageSole(Path.Combine(this.ImagePath, NAME_SYMBOL));
                //this.Symbol = ImageHelper.GetDiskImage(Path.Combine(this.ImagePath, NAME_SYMBOL));
            }
            else
            {
                this.Symbol = knx.Symbol;
            }

            PinCode            = knx.PinCode;
            this.IsDefaultRoom = (EBool)Enum.ToObject(typeof(EBool), knx.DefaultRoom);
        }
Ejemplo n.º 3
0
        public RoomNode(KNXRoom knx)
            : base(knx)
        {
            Symbol = knx.Symbol;
            PinCode = knx.PinCode;
            this.IsDefaultRoom = (EBool)Enum.ToObject(typeof(EBool), knx.DefaultRoom);

            Name = ImageKey = SelectedImageKey = MyConst.View.KnxRoomType;
        }
Ejemplo n.º 4
0
        public RoomNode(KNXRoom knx)
            : base(knx)
        {
            Symbol             = knx.Symbol;
            PinCode            = knx.PinCode;
            this.IsDefaultRoom = (EBool)Enum.ToObject(typeof(EBool), knx.DefaultRoom);

            Name = ImageKey = SelectedImageKey = MyConst.View.KnxRoomType;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 设置仓库的禁用和启用状态
        /// </summary>
        /// <param name="storageNum"></param>
        /// <param name="isForbid"></param>
        /// <returns></returns>
        public int SetForbid(string storageNum, EBool isForbid)
        {
            StorageEntity entity = new StorageEntity();

            entity.IsDefault = (int)isForbid;
            entity.IncludeIsDefault(true);
            entity.Where(a => a.StorageNum == storageNum);
            int line = this.Storage.Update(entity);

            return(line);
        }
Ejemplo n.º 6
0
        public RoomNode()
        {
            index++;

            Text = ResourceMng.GetString("TextRoom") + "_" + index;

            Symbol = MyConst.DefaultIcon;
            PinCode = "";
            this.IsDefaultRoom = EBool.No;

            Name = ImageKey = SelectedImageKey = MyConst.View.KnxRoomType;
        }
Ejemplo n.º 7
0
        public RoomNode()
        {
            index++;

            Text = ResourceMng.GetString("TextRoom") + "_" + index;

            Symbol             = MyConst.DefaultIcon;
            PinCode            = "";
            this.IsDefaultRoom = EBool.No;

            Name = ImageKey = SelectedImageKey = MyConst.View.KnxRoomType;
        }
Ejemplo n.º 8
0
        public SliderSwitchNode(KNXSliderSwitch knx)
            : base(knx)
        {
            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxSliderSwitchType;

            this.ReadAddressId   = knx.ReadAddressId ?? new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = knx.WriteAddressIds ?? new Dictionary <string, KNXSelectedAddress>();

            this.LeftImage         = knx.LeftImage;
            this.RightImage        = knx.RightImage;
            this.SliderImage       = knx.SliderImage;
            this.IsRelativeControl = (EBool)Enum.ToObject(typeof(EBool), knx.IsRelativeControl);
        }
Ejemplo n.º 9
0
        public RoomNode()
        {
            index++;

            this.Name = ImageKey = SelectedImageKey = MyConst.View.KnxRoomType;

            this.Text  = UIResMang.GetString("TextRoom");
            this.Title = UIResMang.GetString("TextRoom") + index;
            SetText(this.Title);

            this.Symbol = ProjResManager.CopyImage(Path.Combine(MyCache.ProjectResImgDir, "room.png"));

            //this.Symbol = ImageHelper.GetDiskImage(Path.Combine(MyCache.ProjectResImgDir, "Room.png"));
            this.PinCode       = "";
            this.IsDefaultRoom = EBool.No;
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 设置禁用和启用
        /// </summary>
        /// <returns></returns>
        public int SetForbid(string LocalNum, EBool IsForbid)
        {
            string Key = string.Format(CacheKey.JOOSHOW_LOCATION_CACHE, this.CompanyID);

            LocationEntity entity = new LocationEntity();

            entity.IsForbid = (int)IsForbid;
            entity.IncludeIsForbid(true);
            entity.Where(a => a.LocalNum == LocalNum)
            .And(a => a.CompanyID == this.CompanyID)
            ;
            int line = this.Location.Update(entity);

            if (line > 0)
            {
                CacheHelper.Remove(Key);
            }
            return(line);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 设置仓库的禁用和启用状态
        /// </summary>
        /// <param name="storageNum"></param>
        /// <param name="isForbid"></param>
        /// <returns></returns>
        public int SetForbid(string SnNum, EBool isForbid)
        {
            string Key = string.Format(CacheKey.JOOSHOW_STORAGE_CACHE, this.CompanyID);

            StorageEntity entity = new StorageEntity();

            entity.IsForbid = (int)isForbid;
            entity.IncludeIsForbid(true);
            entity.Where(a => a.SnNum == SnNum)
            .And(a => a.CompanyID == this.CompanyID);

            int line = this.Storage.Update(entity);

            if (line > 0)
            {
                CacheHelper.Remove(Key);
            }
            return(line);
        }
Ejemplo n.º 12
0
        public SliderSwitchNode()
        {
            index++;

            this.Text = ResourceMng.GetString("TextSliderSwitch") + "_" + index;
            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxSliderSwitchType;

            this.Width  = 260;
            this.Height = 40;
            //this.Size = new Size(260, 40);
            this.FlatStyle = EFlatStyle.Stereo;

            this.ReadAddressId   = new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = new Dictionary <string, KNXSelectedAddress>();

            this.LeftImage         = "sl_left.png";
            this.RightImage        = "sl_right.png";
            this.SliderImage       = "sl.png";
            this.IsRelativeControl = EBool.No;

            string FileLeftImage = Path.Combine(MyCache.ProjImagePath, this.LeftImage);

            if (!File.Exists(FileLeftImage))
            {
                File.Copy(Path.Combine(MyCache.ProjectResImgDir, this.LeftImage), FileLeftImage);
            }

            string FileRightImage = Path.Combine(MyCache.ProjImagePath, this.RightImage);

            if (!File.Exists(FileRightImage))
            {
                File.Copy(Path.Combine(MyCache.ProjectResImgDir, this.RightImage), FileRightImage);
            }

            string FileSliderImage = Path.Combine(MyCache.ProjImagePath, this.SliderImage);

            if (!File.Exists(FileSliderImage))
            {
                File.Copy(Path.Combine(MyCache.ProjectResImgDir, this.SliderImage), FileSliderImage);
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 启用或禁用仓库
        /// </summary>
        /// <returns></returns>
        public ActionResult SetForbid()
        {
            string          SnNum     = WebUtil.GetFormValue <string>("SnNum");
            string          CompanyID = WebUtil.GetFormValue <string>("CompanyID");
            int             IsForbid  = WebUtil.GetFormValue <int>("IsForbid");
            EBool           EIsForbid = EnumHelper.GetModel <EBool>(IsForbid);
            StorageProvider provider  = new StorageProvider(CompanyID);
            int             line      = provider.SetForbid(SnNum, EIsForbid);
            DataResult      result    = new DataResult();

            if (line > 0)
            {
                result.Code    = (int)EResponseCode.Success;
                result.Message = "设置成功";
            }
            else
            {
                result.Code    = (int)EResponseCode.Exception;
                result.Message = "设置失败";
            }
            return(Content(JsonHelper.SerializeObject(result)));
        }
Ejemplo n.º 14
0
        public SliderSwitchNode()
        {
            index++;

            this.Text = ResourceMng.GetString("TextSliderSwitch") + "_" + index;
            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxSliderSwitchType;

            this.Width = 260;
            this.Height = 40;
            //this.Size = new Size(260, 40);
            this.FlatStyle = EFlatStyle.Stereo;

            this.ReadAddressId = new Dictionary<string, KNXSelectedAddress>();
            this.WriteAddressIds = new Dictionary<string, KNXSelectedAddress>();

            this.LeftImage = "sl_left.png";
            this.RightImage = "sl_right.png";
            this.SliderImage = "sl.png";
            this.IsRelativeControl = EBool.No;

            string FileLeftImage = Path.Combine(MyCache.ProjImagePath, this.LeftImage);
            if (!File.Exists(FileLeftImage))
            {
                File.Copy(Path.Combine(MyCache.ProjectResImgDir, this.LeftImage), FileLeftImage);
            }

            string FileRightImage = Path.Combine(MyCache.ProjImagePath, this.RightImage);
            if (!File.Exists(FileRightImage))
            {
                File.Copy(Path.Combine(MyCache.ProjectResImgDir, this.RightImage), FileRightImage);
            }

            string FileSliderImage = Path.Combine(MyCache.ProjImagePath, this.SliderImage);
            if (!File.Exists(FileSliderImage))
            {
                File.Copy(Path.Combine(MyCache.ProjectResImgDir, this.SliderImage), FileSliderImage);
            }
        }
Ejemplo n.º 15
0
 /// <summary>
 /// Set the talk value.
 /// </summary>
 /// <param name="val">talk value.</param>
 /// <see cref="EBool">Bool enumeration.</see>
 public void setTalk(EBool val)
 {
     this.talk = val;
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Set the startConfOnEnter value.
 /// </summary>
 /// <param name="val">startConfOnEnter value.</param>
 /// <see cref="EBool">Bool enumeration.</see>
 public void setStartConfOnEnter(EBool val)
 {
     this.startConfOnEnter = val;
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Set the privacyMode value.
 /// </summary>
 /// <param name="val">privacyMode value.</param>
 /// <see cref="EBool">Bool enumeration.</see>
 public void setPrivacyMode(EBool val)
 {
     this.privacyMode = val;
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Sets the playBeep object value.
 /// </summary>
 /// <param name="val">playBeep value.</param>
 /// <see cref="EBool">Boolean enumeration.</see>
 public void setPlayBeep(EBool val)
 {
     this.playBeep = val;
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Set the flushBuffer value.
 /// </summary>
 /// <param name="val">flushBuffer value.</param>
 /// <see cref="EBool">Bool enumeration.</see>
 public void setFlushBuffer(EBool val)
 {
     this.flushBuffer = val;
 }
 /// <summary>
 /// Set the record value.
 /// </summary>
 /// <param name="val">record value.</param>
 public void setRecord(EBool val)
 {
     this.record = val;
 }
Ejemplo n.º 21
0
 public ControlBaseNode() : base()
 {
     this.HasTip    = EBool.No;
     this.Tip       = "";
     this.Clickable = EBool.Yes;
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Set the detectEnergy value.
 /// </summary>
 /// <param name="val">detectEnergy value.</param>
 /// <see cref="EBool">Bool enumeration.</see>
 public void setDetectEnergy(EBool val)
 {
     this.detectEnergy = val;
 }
Ejemplo n.º 23
0
        public SliderSwitchNode(KNXSliderSwitch knx)
            : base(knx)
        {
            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxSliderSwitchType;

            this.ReadAddressId = knx.ReadAddressId ?? new Dictionary<string, KNXSelectedAddress>();
            this.WriteAddressIds = knx.WriteAddressIds ?? new Dictionary<string, KNXSelectedAddress>();

            this.LeftImage = knx.LeftImage;
            this.RightImage = knx.RightImage;
            this.SliderImage = knx.SliderImage;
            this.IsRelativeControl = (EBool)Enum.ToObject(typeof(EBool), knx.IsRelativeControl);
        }
Ejemplo n.º 24
0
 /// <summary>
 /// 设置仓库的禁用和启用状态
 /// </summary>
 /// <param name="storageNum"></param>
 /// <param name="isForbid"></param>
 /// <returns></returns>
 public int SetForbid(string storageNum, EBool isForbid)
 {
     StorageEntity entity = new StorageEntity();
     entity.IsDefault = (int)isForbid;
     entity.IncludeIsDefault(true);
     entity.Where(a => a.StorageNum == storageNum);
     int line = this.Storage.Update(entity);
     return line;
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Set the listen value.
 /// </summary>
 /// <param name="val">listen value.</param>
 /// <see cref="EBool">Bool enumeration.</see>
 public void setListen(EBool val)
 {
     this.listen = val;
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Set the allowCallControl value.
 /// </summary>
 /// <param name="val">allowCallControl value.</param>
 /// <see cref="EBool">Bool enumeration.</see>
 public void setAllowCallControl(EBool val)
 {
     this.allowCallControl = val;
 }
Ejemplo n.º 27
0
 /// <summary>
 /// Set the autoStart value.
 /// </summary>
 /// <param name="val">autoStart value.</param>
 /// <see cref="EBool">Bool enumeration.</see>
 public void setAutoStart(EBool val)
 {
     this.autoStart = val;
 }