黄学彪
2020-12-16 0d9f64668fd7350d6a21fd157e32009a96d98134
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Shared.Common;
using Shared.Phone.UserCenter.SmartSound.Util;
using Shared.Phone.UserCenter.SmartSound.Widget;
using ZigBee.Device;
 
namespace Shared.Phone.UserCenter.SmartSound.Forms
{
    public class SmartSoundControlContentForm : EditorCommonForm
    {
        /// <summary>
        /// 临时数据
        /// </summary>
        private List<SmartSound.Layer> TempDatas = new List<SmartSound.Layer>();
 
        private SmartSoundInfo.SoundInfo mSoundInfo;
        /// <summary>
        /// 列表控件
        /// </summary>
        private VerticalListControl listView = null;
        
        private FrameLayout contentLayout = null;
        /// <summary>
        /// 当前楼层的索引
        /// </summary>
        public int CurrentIndex = 0;
        private BottomClickButton bottomClickButton = null;
        /// <summary>
        /// 当前楼层的名称
        /// </summary>
        private static NormalViewControl pullLayoutText = null;
 
        public SmartSoundControlContentForm(SmartSoundInfo.SoundInfo soundInfo)            
        {
            this.mSoundInfo = soundInfo;
        }
 
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
        public void ShowForm()
        {
            IniFloorData();//先加载数据
            TempDatas.Clear();
 
            this.ScrollEnabled = false;
            base.SetTitleText("选择房间");//设置标题信息
 
            contentLayout = new FrameLayout();
            this.bodyFrameLayout.AddChidren(contentLayout);
            
            IniAllDataView();
        }
 
        #region 加载本地所有数据,生成供用户选择房间的界面
 
        private void IniAllDataView()
        {
            contentLayout.RemoveAll();
 
            var pullLayout = new MyPullControl(this, SmartSound.LocaData);
            contentLayout.AddChidren(pullLayout);
            pullLayout.InitControl();
 
            LoadAllRoomListView();
 
            bottomClickButton = new BottomClickButton();
            this.bodyFrameLayout.AddChidren(bottomClickButton);
            bottomClickButton.Text = "确认";
            bottomClickButton.ButtonClickEvent += (sender, e) =>
            {
                if (SmartSound.getInstantiate().LayerList != null && SmartSound.getInstantiate().LayerList.Count > 0)
                {
                    //生成一个弹窗画面
                    var dialogForm = new TextDialog("确认删除现有房间列表的所有控制内容,添加全新的场景和功能?", "确认");
                    dialogForm.SetTitleText("提示");
 
                    //按下确认按钮
                    dialogForm.ComfirmClickEvent += () =>
                    {
                        //画面关闭
                        dialogForm.CloseDialog();
                        uploadData();
                    };
                }
                else
                {
                    uploadData();
                }
               
            };
 
            bottomClickButton.Visible = false;
        }
 
        /// <summary>
        /// 提交数据到服务器
        /// </summary>
        private void uploadData()
        {
            HdlThreadLogic.Current.RunThread(async () =>
            {
                this.ShowProgressBar();
                //保存数据
                if (SmartSound.getInstantiate().LayerList == null)
                    SmartSound.getInstantiate().LayerList = new List<SmartSound.Layer>();
 
                SmartSound.getInstantiate().LayerList.Clear();
                SmartSound.getInstantiate().LayerList = CollateData();
                SmartSound.getInstantiate().TokenID = mSoundInfo.Id;
                SmartSound.getInstantiate().UserID = mSoundInfo.UserID;
                SmartSound.getInstantiate().HomeID = mSoundInfo.HomeID;
 
                //上传数据到服务器
                string str = await postBatchEdit();
                CloseProgressBar();
 
                HdlThreadLogic.Current.RunMainInThread(() =>
                {
                    CloseForm();
                });
            });
        }
 
        private void LoadAllRoomListView()
        {
            try
            {                
 
                if (SmartSound.LocaData == null || SmartSound.LocaData.Count < 1)
                    return;
 
                // 加载当前楼层的所有房间 ListView
                SmartSound.Layer layer = SmartSound.LocaData[CurrentIndex];
                if (listView == null)
                {                    
                    listView = new VerticalListControl();
                    contentLayout.AddChidren(listView);
                    listView.Y = Application.GetRealHeight(173);
                    listView.Height = bodyFrameLayout.Height- Application.GetRealHeight(173);                    
                }
 
                pullLayoutText.Text = layer.LayerName;
                listView.RemoveAll();
 
                foreach(SmartSound.Room room in layer.RoomList)
                {
                    var roomRowLayout = new RoomRowLayout(this, room);
                    listView.AddChidren(roomRowLayout);
                    roomRowLayout.InitControl();
                }
 
                //多个的时候,确认按钮会遮挡一部分。追加三个空的行的高度,把它顶上来
                if (listView.ChildrenCount > 5)
                {
                    TextView textView = new TextView();
                    textView.Height = Application.GetRealHeight(127 * 3);
                    listView.AddChidren(textView);
                }
            }
            catch { }
        }
 
        private async Task<string> postBatchEdit()
        {
            // The remote server returned an error: (400) Bad Request.
            string url = "https://developer.hdlcontrol.com/zigbeespeakerservice/BatchEdit";
            string json = Newtonsoft.Json.JsonConvert.SerializeObject(SmartSound.getInstantiate());
            string response_str = MyHttpWebResponse.PostWebRequest(url, json, Encoding.UTF8);
            return response_str;
        }
 
        #endregion
 
        /// <summary>
        /// 将数据转换为智能音箱使用的数据
        /// </summary>
        private void IniFloorData()
        {
 
            if (SmartSound.LocaData == null)
                SmartSound.LocaData = new List<SmartSound.Layer>();
 
            SmartSound.LocaData.Clear();
            
            Dictionary<string, string> floorDictionary = Config.Instance.Home.FloorDics;//楼层列表
 
            #region 分楼层
            if (floorDictionary.Count < 1)
            {
                //没有楼层,模拟一个
                SmartSound.Layer layer = new SmartSound.Layer();
                layer.LayerID = DateTime.Now.ToString("yyyyMMddHHmmssms");
                layer.LayerName = "一楼";
                layer.RoomList.Clear();
                SmartSound.LocaData.Add(layer);
            }
            else
            {
                foreach (string layer_id in floorDictionary.Keys)
                {
                    SmartSound.Layer layer = new SmartSound.Layer();
                    layer.LayerID = layer_id;
                    layer.LayerName = floorDictionary[layer_id];
                    layer.RoomList.Clear();
                    SmartSound.LocaData.Add(layer);
                }
            }
            #endregion
 
            #region 房间入住对应的楼层
            var roomList = HdlRoomLogic.Current.GetAllListRooms();//获取所有房间
 
            for (int n = 0; n < SmartSound.LocaData.Count; n++)
            {
                SmartSound.Layer layer = SmartSound.LocaData[n];
                foreach (Room room in roomList)
                {
                    try
                    {
                        if (layer.LayerID != room.FloorId && SmartSound.LocaData.Count > 1)
                            continue;
 
                        //添加房间
                        SmartSound.Room smartRoom = new SmartSound.Room();
                        layer.RoomList.Add(smartRoom);
 
                        smartRoom.RoomID = room.Id;
                        smartRoom.RoomName = room.Name;
                        smartRoom.DeviceList.Clear();
                        smartRoom.SceneList.Clear();
 
                        #region 添加设备 灯光、窗帘、场景、空调
                        for (int j = 0; j < room.ListDevice.Count; j++)
                        {
                            string key = room.ListDevice[j].ToString();
                            var device = HdlDeviceCommonLogic.Current.GetDevice(key);
                            if (device == null)
                                continue;
 
                            SmartSound.Device smartDevice = new SmartSound.Device();
                            smartDevice.DeviceAddress = device.DeviceAddr;//设备 MAC
                            smartDevice.Epoint = device.DeviceEpoint;//设备端口
                            smartDevice.DeviceName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device);//设备名称
                            smartDevice.NicksName = "";
                            smartDevice.DeviceType = GetDeviceType(device);//设备类型
                            if (smartDevice.DeviceType == 0)
                                continue;
 
                            if(ZbGateway.DicGatewayBaseInfo.ContainsKey(device.CurrentGateWayId) ==true)
                            {
                                smartDevice.GatewayID = ZbGateway.DicGatewayBaseInfo[device.CurrentGateWayId].Id;//网关 Id
                            }
                            else
                            {
                                smartDevice.GatewayID = device.CurrentGateWayId;//网关 Id
                            }
       
                            if (smartDevice.DeviceName == "" || smartDevice.DeviceName == string.Empty)
                                continue;
 
                            smartRoom.DeviceList.Add(smartDevice);
                        }
                        #endregion
 
                        var sceneList = HdlSceneLogic.Current.GetRoomSceneList(room);
 
                        #region //添加场景
                        for (int k = 0; k < sceneList.Count; k++)
                        {
                            try
                            {
                                SceneUI scene = sceneList[k];
 
                                if (scene == null) continue;
                                SmartSound.Scene smartScene = new SmartSound.Scene();
                                smartScene.SceneName = scene.Name;
                                smartScene.SceneID = scene.Id;
                                smartScene.DelayTime = scene.DelayTime;
                                smartScene.NicksName = "";
                                if (ZbGateway.DicGatewayBaseInfo.ContainsKey(ZbGateway.MainGateWay.GwId) == true)
                                {
                                    smartScene.GatewayID = ZbGateway.DicGatewayBaseInfo[ZbGateway.MainGateWay.GwId].Id;//网关 Id
                                }
                                else
                                {
                                    smartScene.GatewayID = ZbGateway.MainGateWay.GwId;//网关 Id
                                }
 
                                if (smartScene.SceneName == "" || smartScene.SceneName == string.Empty)
                                    continue;
 
                                smartRoom.SceneList.Add(smartScene);
                            }
                            catch (Exception e) { }
                        }
                        #endregion
 
                        if (smartRoom.DeviceList.Count == 0 && sceneList.Count == 0)
                            layer.RoomList.Remove(smartRoom);
 
                    }
                    catch (Exception e)
                    {
                        string errpr = e.Message;
                    }
                }
            }
            #endregion
 
        }
 
        /// <summary>
        /// Zigbee设备类型转换为智能音箱使用的类型
        /// </summary>
        /// <returns></returns>
        private int GetDeviceType(ZigBee.Device.CommonDevice device)
        {
            int type = 0;//1=开关灯,2=调光灯,3=RGB 灯,4=窗帘模块,5=开合帘,6=卷帘,7=空调,8=面板,9=新风
 
            if (device.Type == DeviceType.OnOffOutput && device.DfunctionType == DeviceFunctionType.A灯光)
            {
                type = 1;//这里面的就是继电器灯光了
            }
            else if (device.Type == DeviceType.DimmableLight)
            {
                type = 2;//调光
            }
            else if (device.Type == DeviceType.ColorDimmableLight)
            {
                type = 3;
            }
            else if (device.Type == DeviceType.WindowCoveringDevice)
            {
                //窗帘
                if (((Rollershade)device).WcdType == 4)//开合帘
                {
                    type = 5;
                }
                else if (((Rollershade)device).WcdType == 0)//卷帘
                    type = 6;//卷帘
            }
            else if (device.Type == DeviceType.Thermostat)
            {
                type = 7;
            }
            else if (device.Type == DeviceType.FreshAir)
            {
                type = 9;
            }
 
            return type;
        }
 
        /// <summary>
        /// 将选中的数据添加到临时数据列表中,便于后期的"保存"
        /// </summary>
        private void AddData(SmartSound.Room room)
        {
            if (TempDatas == null)
                TempDatas = new List<SmartSound.Layer>();
 
            SmartSound.Layer tempLayer = SmartSound.LocaData[CurrentIndex];
            if (tempLayer == null) return;
 
          
            #region 添加楼层
 
            bool floor_exists = false;
            // 过滤相同的楼层
            for (int i = 0; i < TempDatas.Count; i++)
            {
                if (tempLayer.LayerID == TempDatas[i].LayerID)
                {
                    floor_exists = true;
                    break;
                }
            }
 
            if (!floor_exists)
            {
                tempLayer.RoomList.Clear();
                TempDatas.Add(tempLayer);
            }
              
 
            #endregion
 
            #region 添加房间
 
            for (int i = 0; i < TempDatas.Count; i++)
            {
                if (SmartSound.LocaData[CurrentIndex].LayerID != TempDatas[i].LayerID)
                    continue;
 
                bool room_exists = false;
 
                for (int n = 0; n < TempDatas[i].RoomList.Count; n++)
                {
                    if (room.RoomID == TempDatas[i].RoomList[n].RoomID)
                    {
                        room_exists = true;
                        break;
                    }
                }
 
                if (!room_exists)
                {
                    TempDatas[i].RoomList.Add(room);
                    CheckedAll(room);//添加房间成功,默认选中所有设备
                    break;
                }
            }
 
            #endregion
 
        }
 
        private void RemoveData(SmartSound.Room room)
        {
            try
            {
                for (int i = 0; i < TempDatas.Count; i++)
                {
                 
                    for (int j = 0; j < TempDatas[i].RoomList.Count; j++)
                    {
                        if (TempDatas[i].RoomList[j].RoomID == room.RoomID)
                        {
                            TempDatas[i].RoomList.RemoveAt(j);
                        }
                    }
                }
            }
            catch { }
        }
 
        /// <summary>
        /// 默认选择所有设备
        /// </summary>
        /// <param name="room"></param>
        private void CheckedAll(SmartSound.Room room)
        {
            // 标记所有场景
            for (int n = 0; n < room.SceneList.Count; n++)
            {
                SmartSound.Scene _scene = room.SceneList[n];
                _scene.Checked = true;
            }
 
            //标记所有设备
            for (int k = 0; k < room.DeviceList.Count; k++)
            {
 
                SmartSound.Device _device = room.DeviceList[k];
                _device.Checked = true;
            }
        }
 
        /// <summary>
        /// 重新整理数据,把没有选中的数据都剔除掉
        /// </summary>
        private List<SmartSound.Layer> CollateData()
        {
            try
            {
                //移出未选中的设备、场景
                for (int i = 0; i < TempDatas.Count; i++)
                {
                    SmartSound.Layer _layer = TempDatas[i];
 
                    for (int j = 0; j < _layer.RoomList.Count; j++)
                    {
                        SmartSound.Room _room = _layer.RoomList[j];
                        if (_room.Checked)
                        {
                            #region 清除未选中的设备
                            for (int k = 0; k < _room.DeviceList.Count; k++)
                            {
                                SmartSound.Device _device = _room.DeviceList[k];
                                if (!_device.Checked)
                                {
                                    _room.DeviceList.Remove(_device);
                                    k--;
                                }
                            }
                            #endregion
 
                            #region 清除未选中的场景
                            for (int n = 0; n < _room.SceneList.Count; n++)
                            {
                                SmartSound.Scene _scene = _room.SceneList[n];
                                if (!_scene.Checked)
                                {
                                    _room.SceneList.Remove(_scene);
                                    n--;
                                }
                            }
                            #endregion
                        }
                        else
                        {
                            _layer.RoomList.Remove(_room);
                            j--;
                        }
                    }
                }
 
                //移出没有设备的房间
                for (int j = 0; j < TempDatas.Count; j++)
                {
                    SmartSound.Layer _layer = TempDatas[j];
                    if (_layer.RoomList.Count < 1)
                    {
                        TempDatas.Remove(_layer);
                        j--;
                    }
                }
            }
            catch { }
 
            return TempDatas;
        }
 
        #region ■ 自定义楼层选择控件_____________________
 
        /// <summary>
        /// 房间列表行
        /// </summary>
        private class MyPullControl : FrameRowControl
        {
 
            private SmartSoundControlContentForm smartSoundDataAdd = null;
            private List<SmartSound.Layer> Layers = null;
            /// <summary>
            /// 房间列表
            /// </summary>
            private NormalViewControl btnName = null;
 
            /// <summary>
            /// 房间列表行
            /// </summary>
            public MyPullControl(SmartSoundControlContentForm _SmartSoundDataAdd,List<SmartSound.Layer> _layers)
            {
                this.smartSoundDataAdd = _SmartSoundDataAdd;
                this.Layers = _layers;
                this.UseClickStatu = false;
                this.BackgroundColor = UserCenterColor.Current.White;
                this.Height = Application.GetRealHeight(173);
            }
            
            /// <summary>
            /// 初始化控件
            /// </summary>
            public void InitControl()
            {
                //显示文本
                btnName = this.AddLeftCaption(string.Empty, 700);
                btnName.Height = Application.GetRealHeight(60);
                btnName.TextSize = 17;
                btnName.Y = Application.GetRealHeight(57);
                btnName.Text = "房间列表";
 
                var right_icon=this.AddRightArrow();
                right_icon.SelectedImagePath = "SmartSound/PullDown.png";
                right_icon.UnSelectedImagePath = "SmartSound/PullDown.png";
                right_icon.ButtonClickEvent += (sender, e) =>
                {
                    ShowPullList();
                };
 
                pullLayoutText = this.AddMostRightView(Layers[smartSoundDataAdd.CurrentIndex].LayerName, 300, false);
                pullLayoutText.Name = "pullLayout";
                pullLayoutText.ButtonClickEvent += (sender, e) =>
                {
                    ShowPullList();
                };
                pullLayoutText.Text = Layers[smartSoundDataAdd.CurrentIndex].LayerName;
 
                if (Layers.Count == 1)
                {
                    right_icon.Visible = false;
                    pullLayoutText.Visible = false;
                }                
            }
 
            private void ShowPullList()
            {
                //房间列表行{房间列表 textView,楼层下拉窗}
                //显示房间{带选择框的;当选中了房间后需要在底部弹出确认按钮,点击确认跳转到新的界面}
                var pull_frame = new TopRightMenuControl(Layers.Count, 2);
                
                pull_frame.Y = this.Height;
 
                for (int i = 0; i < Layers.Count; i++)
                {
                    int index = i;
                    //创建楼层
                    pull_frame.AddRowMenu(Layers[i].LayerName, "Item/CreatFloor.png", "Item/CreatFloorSelected.png", () =>
                    {
                        smartSoundDataAdd.CurrentIndex = index;
                        smartSoundDataAdd.LoadAllRoomListView();
                    });
                }
            }
        }
        #endregion
               
        #region ■ 自定义房间选择控件_____________________
 
        /// <summary>
        /// 房间列表行
        /// </summary>
        private class RoomRowLayout : FrameRowControl
        {
            private SmartSoundControlContentForm smartSoundControlContentForm = null;
 
            private SmartSound.Room mRoom = null;
            /// <summary>
            /// 房间名称
            /// </summary>
            private NormalViewControl btnName = null;
 
            private MostRightIconControl Right_icon = null;            
 
            /// <summary>
            /// 房间列表行
            /// </summary>
            public RoomRowLayout(SmartSoundControlContentForm _smartSoundControlContentForm,SmartSound.Room _room)
            {
                this.smartSoundControlContentForm = _smartSoundControlContentForm;
                this.mRoom = _room;
                this.UseClickStatu = false;
                this.BackgroundColor = UserCenterColor.Current.White;
                this.Height = Application.GetRealHeight(170);
            }
 
            /// <summary>
            /// 初始化控件
            /// </summary>
            public void InitControl()
            {
                //显示文本
                btnName = this.AddLeftCaption(string.Empty, 2000);
                btnName.Height = Application.GetRealHeight(60);
                btnName.TextSize = 14;
                btnName.Y = Application.GetRealHeight(57);
                btnName.Text = mRoom.RoomName;
 
                Right_icon = this.AddMostRightEmptyIcon(58, 58);
                Right_icon.Gravity = Gravity.CenterVertical;
 
                btnName.ButtonClickEvent += (sender, e) =>
                {
                    mRoom.Checked = true;
                    RefreshRightIconState(mRoom.Checked);
                    SmartSoundContentForDevice deviceForm = new SmartSoundContentForDevice(mRoom);
                    deviceForm.AddForm();
                };
 
                this.Right_icon.ButtonClickEvent += (sender, e) =>
                {
                    mRoom.Checked = !mRoom.Checked;
                    RefreshRightIconState(mRoom.Checked);
                };
 
                RefreshRightIconState(mRoom.Checked);
                AddBottomLine();
 
            }
 
            private void RefreshRightIconState(bool bol = false)
            {
                try
                {
                    if (bol)
                    {
                        Right_icon.SelectedImagePath = "Item/ItemSelected.png";
                        Right_icon.UnSelectedImagePath = "Item/ItemSelected.png";
 
                        smartSoundControlContentForm.AddData(mRoom);
                    }
                    else
                    {
                        Right_icon.SelectedImagePath = "Item/ItemUnSelected.png";
                        Right_icon.UnSelectedImagePath = "Item/ItemUnSelected.png";
 
                        smartSoundControlContentForm.RemoveData(mRoom);
                    }
 
                    bool isShow = false;
 
                    if(smartSoundControlContentForm==null) return;
 
                    foreach (SmartSound.Room _room in SmartSound.LocaData[smartSoundControlContentForm.CurrentIndex].RoomList)
                    {
                        if (_room.Checked)
                        {
                            isShow = true;                           
                            break;
                        }
                    }
 
                    smartSoundControlContentForm.bottomClickButton.Visible = isShow;
                }
                catch(Exception e)
                {
                    string error = e.Message;
                }
            }
 
        }
        #endregion
    }
}