Beispiel #1
0
 private void peopleCanShuSetPower()
 {
     if (!PeoplePowerModel.getPeoplePowerModel().isCanshuChange())
     {
         ButtonVisibistFalse(button4);
         ButtonVisibistFalse(button5);
         ButtonVisibistFalse(button6);
         ButtonVisibistFalse(button7);
         ButtonVisibistFalse(button8);
         ButtonVisibistFalse(button10);
         ButtonVisibistFalse(button11);
         ButtonVisibistFalse(button12);
         ButtonVisibistFalse(button17);
         ButtonVisibistFalse(button18);
         ButtonVisibistFalse(button19);
         ButtonVisibistFalse(button13);
         ButtonVisibistFalse(button20);
         ButtonVisibistFalse(button23);
         ButtonVisibistFalse(button14);
         ButtonVisibistFalse(button15);
         ButtonVisibistFalse(button16);
         ButtonVisibistFalse(button21);
         ButtonVisibistFalse(button22);
         ButtonVisibistFalse(button1);
         ButtonVisibistFalse(button2);
         ButtonVisibistFalse(button3);
     }
     if (!PeoplePowerModel.getPeoplePowerModel().isAllPower())
     {
         if (checkBox14.Enabled)
         {
             checkBox14.Enabled = false;
         }
     }
 }
Beispiel #2
0
 private void button1_Click(object sender, EventArgs e) //開始接受數據
 {
     if (!PeoplePowerModel.getPeoplePowerModel().isMonitor())
     {
         show(10, "您無此權限");
         return;
     }
     if (PeoplePowerModel.getPeoplePowerModel().Jurisdiction != PeoplePowerModel.getPeoplePowerModel().CongjiValue)
     {
         UDPOpen();
     }
     else if (fromMainModel != null)
     {
         if (!getcdInterface3Open())
         {
             if (button1.Tag.Equals("green"))
             {
                 show(30, "請在設置界面->網絡管理->開啟TCPClien");
             }
             else
             {
                 btnChangeYellow();
             }
             return;
         }
         fromMainModel.sendConjiYanzheng((string)button1.Tag);
     }
 }
Beispiel #3
0
        private void CanShuSet_Load(object sender, EventArgs e)
        {
            this.FormClosed += formClosedEventHandler;
            cssCon.removeTabControlTitle(tabControl1, tabPage1);
            cssCon.loadData5(comboBox6, textBox19, comboBox8, textBox26);
            if (PeoplePowerModel.getPeoplePowerModel().Jurisdiction == PeoplePowerModel.getPeoplePowerModel().CongjiValue)
            {
                listView1.Items.Clear();
                listView1.Items.Add("網絡設定");
                try
                {
                    tabControl1.SelectedIndex = 4;
                }
                catch { }
                return;
            }

            cssCon.loadData(listView3, listView4, comboBox2, comboBox4, comboBox5);
            cssCon.loadData2(listView2, comboBox3, textBox8, comboBox1, PeoplePowerModel.getPeoplePowerModel().Jurisdiction);
            cssCon.loadData3(listView5, listView6);
            cssCon.loadData4(checkBox1, checkBox2, checkBox3, checkBox4, textBox17, textBox18, textBox20);
            cssCon.loadData6(checkBox15, textBox25);
            peopleCanShuSetPower();

            this.listView2.ColumnClick += new ColumnClickEventHandler(listView_ColumnClick);
            this.listView3.ColumnClick += new ColumnClickEventHandler(listView_ColumnClick);
            this.listView4.ColumnClick += new ColumnClickEventHandler(listView_ColumnClick);
            this.listView5.ColumnClick += new ColumnClickEventHandler(listView_ColumnClick);
            this.listView6.ColumnClick += new ColumnClickEventHandler(listView_ColumnClick);
        }
Beispiel #4
0
 public void tcpServerHandle(bool isOpen, CommunicationMode comMode)
 {
     if (comMode == CommunicationMode.TCPServer)
     {
         if (isOpen)
         {
             button19.Text = "關閉";
         }
         else
         {
             button19.Text = "打開TCPServer";
         }
     }
     else if (comMode == CommunicationMode.TCPClien)
     {
         if (isOpen)
         {
             button24.Text = "關閉";
         }
         else
         {
             button24.Text = "連接TCPServer";
         }
     }
     else if (comMode == CommunicationMode.TCPClien_File)
     {
         if (PeoplePowerModel.getPeoplePowerModel().Jurisdiction == PeoplePowerModel.getPeoplePowerModel().CongjiValue)
         {
             button25.Visible = isOpen;
         }
     }
 }
Beispiel #5
0
        public void commOver3CallBack(string msg, CommunicationMode comMode)
        {
            addFromBaseModel(fromMainModel);
            timer1.Interval = 500;
            timer1.Start();

            if (button1.Tag.Equals("green") && getcdInterface3Open() && PeoplePowerModel.getPeoplePowerModel().IsConnect)
            {
                panel6.BackgroundImage  = Resources.tag_2;
                panel7.BackgroundImage  = Resources.pc_2;
                button1.BackgroundImage = Resources.start_3;
                button1.Tag             = "yellow";
                button1.Text            = "關閉連接";
                fromMainModel.setListViewCanInfos();
                fromMainModel.sendConjiReveLocaData();
                new Thread(tongBuAllData).Start();
                if (!timer3.Enabled)
                {
                    timer3.Start();
                }
                fromMainModel.OpenUDPtime = XwDataUtils.GetTimeStamp();
                //    timer2.Interval = 1000;
                //    if (!timer2.Enabled) timer2.Start();
            }
            else if (button1.Tag.Equals("yellow") && getcdInterface3Open() && !PeoplePowerModel.getPeoplePowerModel().IsConnect)
            {
                panel6.BackgroundImage     = Resources.tag_1;
                panel7.BackgroundImage     = Resources.pc_1;
                button1.BackgroundImage    = Resources.start_1;
                button1.Tag                = "green";
                button1.Text               = "開始連接監控";
                fromMainModel.CloseUDPtime = XwDataUtils.GetTimeStamp();
            }
        }
Beispiel #6
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (!PeoplePowerModel.getPeoplePowerModel().isSerchTag())
            {
                MessageBox.Show("您無此權限");
                return;
            }
            string name     = textBox2.Text;
            string cardName = serchIDFrom(name);
            string cardID   = cardName == null?name.ToUpper() : cardName;

            if (locaModel.setSerchCARDID(cardID))
            {
                panel1_Resize(null, null);
                if (dataType < 0 && locaModel != null)
                {
                    locaModel.draw(1);
                }
                MessageBox.Show("搜索成功");
            }
            else
            {
                MessageBox.Show("搜索失敗");
            }
        }
Beispiel #7
0
        public void onMItemClick(int index, QuYuBean quYuBean)
        {
            if (!PeoplePowerModel.getPeoplePowerModel().isLocationShow())
            {
                MessageBox.Show("您無此權限");
                return;
            }
            LocationViewFrom locaViewFrom = new LocationViewFrom();

            locaViewFrom.QUYUBean  = quYuBean;
            locaViewFrom.CkdBeans  = FileModel.getFlModel().ChFlBean.CanKaoDians;
            locaViewFrom.CengjiID  = selectCenJiBean.ID;
            locaViewFrom.MFormMian = this;
            locaViewFrom.setDataLoad();
            fromMainModel.onTagData            += locaViewFrom.locaModel.distributionData;    //绕的有点多
            fromMainModel.onCanKData           += locaViewFrom.locaModel.distributionCKDData; //绕的有点多
            fromMainModel.onNODEData           += locaViewFrom.locaModel.changeCanKaiDianIDtIME;
            locaViewFrom.locaModel.CloseUDPtime = fromMainModel.CloseUDPtime;
            locaViewFrom.locaModel.OpenUDPtime  = fromMainModel.OpenUDPtime;

            fromMainModel.dirHandle();
            locaViewFrom.FormClosed += locaFormClosedEventHandler;
            timer1_Tick(null, null);
            locaViewFrom.ShowDialog();
            //  loadOnNOdata();
        }
Beispiel #8
0
 //主機驗證
 private string mainYanzhen(string count, string pasword)
 {
     if (!PeoplePowerModel.getPeoplePowerModel().textPeoplePower(count, pasword))
     {
         //MessageBox.Show();
         return("帳號密碼錯誤!");
     }
     return("驗證成功!");
 }
Beispiel #9
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (!PeoplePowerModel.getPeoplePowerModel().isLocationShow())
     {
         MessageBox.Show("您無此權限");
         return;
     }
     loadAllViewShow(null, null);
 }
Beispiel #10
0
 private void mainFormClosingEventHandler(object sender, FormClosingEventArgs e)
 {
     if (!PeoplePowerModel.getPeoplePowerModel().isHaveExeOC())
     {
         MessageBox.Show("您無權關閉軟體!");
         e.Cancel = true;
     }
     isfromClose = true;
     FileTcpClienModel.getFileTcpClienMidel().classClose();
 }//
Beispiel #11
0
        private void button9_Click_1(object sender, EventArgs e)
        {
            if (!PeoplePowerModel.getPeoplePowerModel().isWarnDeal())
            {
                MessageBox.Show("您無此權限");
                return;
            }
            WarnForm warForm = new WarnForm();

            warForm.ShowDialog();
        }
Beispiel #12
0
        private void showLoginForm()
        {
            createLoginForm();
            if (loginForm.Visible)
            {
                return;
            }
            DialogResult dResult = loginForm.ShowDialog();

            if (dResult != DialogResult.OK)
            {
                closeFromBaseModel();
                Application.Exit();
            }
            else
            {
                label6.Text = "[退出]";
                if (loginForm != null)
                {
                    label7.Text = loginForm.getAccount();
                }
                if (PeoplePowerModel.getPeoplePowerModel().Jurisdiction != PeoplePowerModel.getPeoplePowerModel().CongjiValue)
                {
                    if (!button10.Visible)
                    {
                        button10.Visible = true;
                    }
                    if (button11.Visible)
                    {
                        button11.Visible = false;
                    }
                    if (!getcdInterface2Open())
                    {
                        canshuButton19_Click(null, null);
                    }
                }
                else
                {
                    if (button10.Visible)
                    {
                        button10.Visible = false;
                    }
                    if (!button11.Visible)
                    {
                        button11.Visible = true;
                    }
                    if (!getcdInterface3Open())
                    {
                        canshuButton24_Click(null, null);
                    }
                }
            }
        }
Beispiel #13
0
 private void setPeopleValueInCheckBox(int peopleValue)
 {
     checkBox6.Checked  = (peopleValue & PeoplePowerModel.getPeoplePowerModel().ExeOC) > 0;
     checkBox7.Checked  = (peopleValue & PeoplePowerModel.getPeoplePowerModel().Monitor) > 0;
     checkBox8.Checked  = (peopleValue & PeoplePowerModel.getPeoplePowerModel().CanshuOC) > 0;
     checkBox9.Checked  = (peopleValue & PeoplePowerModel.getPeoplePowerModel().WarnDeal) > 0;
     checkBox10.Checked = (peopleValue & PeoplePowerModel.getPeoplePowerModel().SerchTag) > 0;
     checkBox11.Checked = (peopleValue & PeoplePowerModel.getPeoplePowerModel().LocationShow) > 0;
     checkBox12.Checked = (peopleValue & PeoplePowerModel.getPeoplePowerModel().CanshuChange) > 0;
     checkBox13.Checked = (peopleValue & PeoplePowerModel.getPeoplePowerModel().HisData) > 0;
     checkBox14.Checked = (peopleValue & PeoplePowerModel.getPeoplePowerModel().PeopleOperation) > 0;
 }
Beispiel #14
0
        private void button3_Click(object sender, EventArgs e) // 查询
        {
            if (!PeoplePowerModel.getPeoplePowerModel().isSerchTag())
            {
                MessageBox.Show("您無此權限");
                return;
            }
            serchCardFrom serFrom = new serchCardFrom();

            serFrom.serchCard += serchCardId;
            tagSerchHandle    += serFrom.tagSerchHandle;
            serFrom.Show();
        }
Beispiel #15
0
        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (PeoplePowerModel.getPeoplePowerModel().Jurisdiction == PeoplePowerModel.getPeoplePowerModel().CongjiValue)
            {
                return;
            }
            int index = cssCon.setTabPageFromList(sender, tabControl1);

            if (index == 5)
            {
                cssCon.loadData3(listView5, null);
            }
            else if (index == 2)
            {
                cssCon.loadData(listView3, listView4, comboBox2, comboBox4, comboBox5);
            }
        }
Beispiel #16
0
        private void button2_Click(object sender, EventArgs e) //参数设置
        {
            if (!PeoplePowerModel.getPeoplePowerModel().isCanshuChange())
            {
                MessageBox.Show("您無此權限");
                return;
            }
            CanShuSetFrom mCanShuSet = new CanShuSetFrom();

            mCanShuSet.button19.Click += canshuButton19_Click;
            mCanShuSet.button24.Click += canshuButton24_Click;
            tcpHandle += mCanShuSet.tcpServerHandle;
            mCanShuSet.Show();
            tcpServerHandle(getcdInterface2Open(), getCommunicationMode2());
            tcpServerHandle(getcdInterface3Open(), getCommunicationMode3());

            tcpServerHandle(button1.Tag.Equals("yellow"), CommunicationMode.TCPClien_File);
        }
Beispiel #17
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!PeoplePowerModel.getPeoplePowerModel().isSerchTag())
            {
                MessageBox.Show("您無此權限");
                return;
            }

            if (textBox1.Text.Length < 1)
            {
                return;
            }
            serch = true;
            if (serchCardAllView != null)
            {
                serchCardAllView(textBox1.Text);
            }
            locaViewFrom.setCardID(textBox1.Text);
        }
Beispiel #18
0
 private void timer2_Tick(object sender, EventArgs e) //长时间未操作,程序退出
 {
     if (PeoplePowerModel.getPeoplePowerModel().Jurisdiction == PeoplePowerModel.getPeoplePowerModel().CongjiValue)
     {
         timeTickCount++;
         if (timeTickCount > 21 && timeTickCount < 24)
         {
             conjiWarnEleData();
         }
         else if (timeTickCount > 44 && timeTickCount < 47)
         {
             conjiWarnCardData();
         }
         else if (timeTickCount > 66 && timeTickCount < 69)
         {
             conjiWarnNODEData();
         }
         else if (timeTickCount > 88)
         {
             conjiTongBu();
         }
         if (timeTickCount >= 90)
         {
             timeTickCount = 0;
         }
     }
     else
     {
         iOperCount++;
         if (iOperCount > 300)
         {
             showLoginForm();
             iOperCount = 0;
         }
     }
     if (runTimeCount > 21600 && appOpenCount > 300)
     {
         appOpenCount = 0;
         appRestart();
     }
     appOpenCount++;
     runTimeCount++;
 }
Beispiel #19
0
        private int getPeopleValue()
        {
            int value = 0;

            if (checkBox6.Checked)
            {
                value |= PeoplePowerModel.getPeoplePowerModel().ExeOC;
            }
            if (checkBox7.Checked)
            {
                value |= PeoplePowerModel.getPeoplePowerModel().Monitor;
            }
            if (checkBox8.Checked)
            {
                value |= PeoplePowerModel.getPeoplePowerModel().CanshuOC;
            }
            if (checkBox9.Checked)
            {
                value |= PeoplePowerModel.getPeoplePowerModel().WarnDeal;
            }
            if (checkBox10.Checked)
            {
                value |= PeoplePowerModel.getPeoplePowerModel().SerchTag;
            }
            if (checkBox11.Checked)
            {
                value |= PeoplePowerModel.getPeoplePowerModel().LocationShow;
            }
            if (checkBox12.Checked)
            {
                value |= PeoplePowerModel.getPeoplePowerModel().CanshuChange;
            }
            if (checkBox13.Checked)
            {
                value |= PeoplePowerModel.getPeoplePowerModel().HisData;
            }
            if (checkBox14.Checked)
            {
                value |= PeoplePowerModel.getPeoplePowerModel().PeopleOperation;
            }
            return(value);
        }
Beispiel #20
0
 private void loginForm_Load(object sender, EventArgs e)
 {
     this.Text = FormMain.getMainName() + "帳號驗證";
     if (FormMain.MainModel == 1)
     {
         radioButton1.Checked = true;
         radioButton2.Visible = false;
     }
     else
     {
         radioButton2.Checked = true;
         radioButton1.Visible = false;
     }
     PeoplePowerModel.getPeoplePowerModel().startCheck();
     textBox2.Text = "";
     if (PeoplePowerModel.getPeoplePowerModel().Jurisdiction == PeoplePowerModel.getPeoplePowerModel().CongjiValue)
     {
         radioButton2.Checked = true;
     }
 }
Beispiel #21
0
        private void appRestart()
        {
            Thread.Sleep(5000);

            RestartBean resBean = new RestartBean();

            resBean.UDPopen              = getcdInterfaceOpen();
            resBean.TCPopen              = getcdInterface2Open();
            resBean.TCPClienopen         = getcdInterface3Open();
            resBean.CardLowEleWarnMsgs   = new Dictionary <string, DrivaceWarnMessage>(WarnMessage.getWarnMessage().CardLowEleWarnMsgs);
            resBean.CardUnanswerWranMsgs = new Dictionary <string, DrivaceWarnMessage>(WarnMessage.getWarnMessage().CardUnanswerWranMsgs);
            resBean.NODEUnanswerWranMsgs = new Dictionary <string, DrivaceWarnMessage>(WarnMessage.getWarnMessage().NODEUnanswerWranMsgs);
            resBean.PcType          = PeoplePowerModel.getPeoplePowerModel().Jurisdiction == PeoplePowerModel.getPeoplePowerModel().CongjiValue ? 2 : 1;
            resBean.Count           = loginForm.getAccount();
            resBean.Password        = PeoplePowerModel.getPeoplePowerModel().Password;
            resBean.PowerValue      = PeoplePowerModel.getPeoplePowerModel().PowerValue;
            resBean.Jurisdiction    = PeoplePowerModel.getPeoplePowerModel().Jurisdiction;
            resBean.DealUpCardDatas = fromMainModel.DealUpCardDatas.ToList();
            resBean.RestartTime     = XwDataUtils.GetTimeStamp();
            FileModel.getFlModel().setRestartData(resBean);
            new Thread(ApplicationRestart).Start();
        }
Beispiel #22
0
 private void closeTcpClien(string msg)
 {
     PeoplePowerModel.getPeoplePowerModel().IsConnect = false;
     Debug.Write("TCPClien.recvException" + msg);
     FileModel.getFlModel().setErrorData("TCPClien.recvException" + msg);
 }
Beispiel #23
0
        private void pcRestart_Load()
        {
            RestartBean resBean = FileModel.getFlModel().getRestartData();

            if (resBean == null)
            {
                return;
            }
            Thread.Sleep(200);
            if (resBean.PcType == 1)
            {
                if (resBean.CardLowEleWarnMsgs != null)
                {
                    WarnMessage.getWarnMessage().CardLowEleWarnMsgs = new Dictionary <string, DrivaceWarnMessage>(resBean.CardLowEleWarnMsgs);
                }
                if (resBean.CardUnanswerWranMsgs != null)
                {
                    WarnMessage.getWarnMessage().CardUnanswerWranMsgs = new Dictionary <string, DrivaceWarnMessage>(resBean.CardUnanswerWranMsgs);
                }
                if (resBean.NODEUnanswerWranMsgs != null)
                {
                    WarnMessage.getWarnMessage().NODEUnanswerWranMsgs = new Dictionary <string, DrivaceWarnMessage>(resBean.NODEUnanswerWranMsgs);
                }
                if ((resBean.CardLowEleWarnMsgs != null && resBean.CardLowEleWarnMsgs.Count > 0) ||
                    (resBean.CardUnanswerWranMsgs != null && resBean.CardUnanswerWranMsgs.Count > 0) ||
                    (resBean.NODEUnanswerWranMsgs != null && resBean.NODEUnanswerWranMsgs.Count > 0))
                {
                    WarnMessage.getWarnMessage().warnMsgCallBack();
                }
                if (resBean.DealUpCardDatas != null)
                {
                    fromMainModel.DealUpCardDatas = resBean.DealUpCardDatas.ToList();
                }
                PeoplePowerModel.getPeoplePowerModel().PowerValue   = resBean.PowerValue;
                PeoplePowerModel.getPeoplePowerModel().Jurisdiction = resBean.Jurisdiction;
                if (!getcdInterface2Open() && resBean.TCPopen)
                {
                    canshuButton19_Click(null, null);
                }
                if (!getcdInterfaceOpen() && resBean.UDPopen)
                {
                    UDPOpen();
                }
                FileModel.getFlModel().deleteRestartData();
            }
            else if (resBean.PcType == 2)
            {
                Thread.Sleep(300);
                PeoplePowerModel.getPeoplePowerModel().Password     = resBean.Password;
                PeoplePowerModel.getPeoplePowerModel().Count        = resBean.Count;
                PeoplePowerModel.getPeoplePowerModel().PowerValue   = resBean.PowerValue;
                PeoplePowerModel.getPeoplePowerModel().Jurisdiction = resBean.Jurisdiction;
                if (!getcdInterface3Open() && resBean.TCPClienopen)
                {
                    canshuButton24_Click(null, null);
                }
                if (resBean.TCPClienopen)
                {
                    new Thread(congjiOpenDataThread).Start();
                }
                FileModel.getFlModel().deleteRestartData();
            }
        }
Beispiel #24
0
 //從機驗證
 private string congjiYanZhen(string count, string pasword)
 {
     PeoplePowerModel.getPeoplePowerModel().congJiPeoplePower(count, pasword);
     return("驗證成功!");
 }
Beispiel #25
0
        //关闭界面时,触发一些设置参数的保存操作
        private void formClosedEventHandler(object sender, FormClosedEventArgs e)
        {
            FileTcpClienModel.getFileTcpClienMidel().tcpHandle -= tongbuMessage;
            if (!PeoplePowerModel.getPeoplePowerModel().isCanshuChange())
            {
                return;
            }

            int blTime = XWUtils.stringToInt1(textBox17.Text);

            if (blTime > -1)
            {
                FileModel.getFlModel().ChFlBean.BlackTimeText = blTime;
            }
            if (!checkBox3.Checked)
            {
                blTime = int.MaxValue;
            }
            if (blTime > -1)
            {
                FileModel.getFlModel().ChFlBean.BlackTime = blTime;
            }

            int noReTime = XWUtils.stringToInt1(textBox18.Text);

            if (noReTime > -1)
            {
                FileModel.getFlModel().ChFlBean.NoReveTimeText = noReTime;
            }
            if (!checkBox4.Checked)
            {
                noReTime = int.MaxValue;
            }
            if (noReTime > -1)
            {
                FileModel.getFlModel().ChFlBean.NoReveTime = noReTime;
            }

            int checkC = XWUtils.stringToInt1(textBox20.Text);

            if (checkC > -1)
            {
                FileModel.getFlModel().ChFlBean.CheckCText = checkC;
            }
            if (!checkBox5.Checked)
            {
                checkC = 0;
            }
            if (checkC > -1)
            {
                FileModel.getFlModel().ChFlBean.CheckC = checkC;
            }

            int tagLowInt = XWUtils.stringToInt1(textBox25.Text);

            if (tagLowInt > -1)
            {
                FileModel.getFlModel().ChFlBean.TagLowText = tagLowInt;
            }
            if (!checkBox15.Checked)
            {
                tagLowInt = -1;
            }
            if (tagLowInt > -2)
            {
                FileModel.getFlModel().ChFlBean.TagLow = tagLowInt;
            }

            FileModel.getFlModel().setCFData();
        }